diff mbox series

[4/7] oeqa/selftest/oelib/buildhistory: git default branch

Message ID 20240208082821.430510-5-adrian.freihofer@siemens.com
State Accepted, archived
Commit 7df99843d8f31d8e0c2872ff625f4a5abf28f740
Headers show
Series python 3.12 related fixes | expand

Commit Message

Adrian Freihofer Feb. 8, 2024, 8:27 a.m. UTC
Define the git default branch to main and use it for all test cases.
This is also in line with what the build history does in practice with
newer Git versions.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/lib/oeqa/selftest/cases/oelib/buildhistory.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Richard Purdie Feb. 8, 2024, 11:04 p.m. UTC | #1
On Thu, 2024-02-08 at 09:27 +0100, Adrian Freihofer wrote:
> Define the git default branch to main and use it for all test cases.
> This is also in line with what the build history does in practice with
> newer Git versions.
> 
> Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
> ---
>  meta/lib/oeqa/selftest/cases/oelib/buildhistory.py | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Unfortunately:

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6406/steps/14/logs/stdio

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
index c3c15d83c0f..762c0d47bff 100644
--- a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
@@ -19,7 +19,7 @@  class TestBlobParsing(OESelftestTestCase):
 
         try:
             from git import Repo
-            self.repo = Repo.init(self.repo_path)
+            self.repo = Repo.init(self.repo_path, initial_branch='main')
         except ImportError as e:
             self.skipTest('Python module GitPython is not present (%s)  (%s)' % (e, sys.path))
 
@@ -67,10 +67,10 @@  class TestBlobParsing(OESelftestTestCase):
         changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")}
 
         self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" })
-        blob1 = self.repo.heads.master.commit.tree.blobs[0]
+        blob1 = self.repo.heads.main.commit.tree.blobs[0]
 
         self.commit_vars(to_add = { "foo-2" : "8", "bar" : "4", "bar-2" : "5" })
-        blob2 = self.repo.heads.master.commit.tree.blobs[0]
+        blob2 = self.repo.heads.main.commit.tree.blobs[0]
 
         change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
             blob1, blob2, False, False)
@@ -86,10 +86,10 @@  class TestBlobParsing(OESelftestTestCase):
         defaultmap = { x : ("default", "1")  for x in ["PKG", "PKGE", "PKGV", "PKGR"]}
 
         self.commit_vars(to_add = { "foo" : "1" })
-        blob1 = self.repo.heads.master.commit.tree.blobs[0]
+        blob1 = self.repo.heads.main.commit.tree.blobs[0]
 
         self.commit_vars(to_add = { "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" })
-        blob2 = self.repo.heads.master.commit.tree.blobs[0]
+        blob2 = self.repo.heads.main.commit.tree.blobs[0]
 
         change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
             blob1, blob2, False, False)