diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2020-05-05 15:01:14 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-07 12:15:59 +0100 |
commit | 095d7301101e2b57e8f7469e4e9b2b5b50edad0c (patch) | |
tree | 4572e72d5ee098bb38081f3d1c1f5e7d0fb2ac94 /meta | |
parent | af24c40ca46eff0390408f7b4e442ec9bdcd0c1e (diff) | |
download | poky-095d7301101e2b57e8f7469e4e9b2b5b50edad0c.tar.gz |
testsdkext/devtool: initialize the test component's git repo
Devtool is relying on externalsrc class, which, in order to determine
if a rebuild is needed, relies on git to checksum files (if the
component tree is a git repo), or sets a flag to always rebuild if
the component tree is not a git repo.
This is problematic in testsdkext scenario, where the test component
is inside a build directory, which itself is inside the poky repo
checkout, and listed in .gitignore. What happens is that git walks
up the tree and uses the index of the poky repo. This works okay
with older versions of git, but git 2.26 complains that we're inside
a directory that is ignored, and returns an error.
To fix the issue, the git repository is initialized directly in the
component directory, just prior to running the tests.
(From OE-Core rev: a5b21af4884c322be173b045ec2fad57ef76e98e)
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/sdkext/cases/devtool.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py index 8e92bf8064..a5c6a76e02 100644 --- a/meta/lib/oeqa/sdkext/cases/devtool.py +++ b/meta/lib/oeqa/sdkext/cases/devtool.py | |||
@@ -20,10 +20,16 @@ class DevtoolTest(OESDKExtTestCase): | |||
20 | myapp_src = os.path.join(cls.tc.esdk_files_dir, "myapp") | 20 | myapp_src = os.path.join(cls.tc.esdk_files_dir, "myapp") |
21 | cls.myapp_dst = os.path.join(cls.tc.sdk_dir, "myapp") | 21 | cls.myapp_dst = os.path.join(cls.tc.sdk_dir, "myapp") |
22 | shutil.copytree(myapp_src, cls.myapp_dst) | 22 | shutil.copytree(myapp_src, cls.myapp_dst) |
23 | subprocess.check_output(['git', 'init', '.'], cwd=cls.myapp_dst) | ||
24 | subprocess.check_output(['git', 'add', '.'], cwd=cls.myapp_dst) | ||
25 | subprocess.check_output(['git', 'commit', '-m', "'test commit'"], cwd=cls.myapp_dst) | ||
23 | 26 | ||
24 | myapp_cmake_src = os.path.join(cls.tc.esdk_files_dir, "myapp_cmake") | 27 | myapp_cmake_src = os.path.join(cls.tc.esdk_files_dir, "myapp_cmake") |
25 | cls.myapp_cmake_dst = os.path.join(cls.tc.sdk_dir, "myapp_cmake") | 28 | cls.myapp_cmake_dst = os.path.join(cls.tc.sdk_dir, "myapp_cmake") |
26 | shutil.copytree(myapp_cmake_src, cls.myapp_cmake_dst) | 29 | shutil.copytree(myapp_cmake_src, cls.myapp_cmake_dst) |
30 | subprocess.check_output(['git', 'init', '.'], cwd=cls.myapp_cmake_dst) | ||
31 | subprocess.check_output(['git', 'add', '.'], cwd=cls.myapp_cmake_dst) | ||
32 | subprocess.check_output(['git', 'commit', '-m', "'test commit'"], cwd=cls.myapp_cmake_dst) | ||
27 | 33 | ||
28 | @classmethod | 34 | @classmethod |
29 | def tearDownClass(cls): | 35 | def tearDownClass(cls): |