[PATCH 3/3] reduce test execution time by using shallow clones

0 views
Skip to first unread message

Felix Moessbauer

unread,
May 24, 2024, 10:00:19 AMMay 24
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The environment variables test clones the heavy bitbake repository. To
speedup the test execution, we enable shallow clones for this.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
tests/test_environment_variables.py | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tests/test_environment_variables.py b/tests/test_environment_variables.py
index 4da839418..3b6b909e3 100644
--- a/tests/test_environment_variables.py
+++ b/tests/test_environment_variables.py
@@ -36,6 +36,7 @@ def test_build_dir_is_placed_inside_work_dir_by_default(monkeykas, tmpdir):
shutil.copytree('tests/test_environment_variables', conf_dir)

monkeykas.chdir(conf_dir)
+ monkeykas.setenv('KAS_CLONE_DEPTH', '1')

kas.kas(['checkout', 'test.yml'])

@@ -49,6 +50,7 @@ def test_build_dir_can_be_specified_by_environment_variable(monkeykas, tmpdir):
monkeykas.chdir(conf_dir)

monkeykas.setenv('KAS_BUILD_DIR', build_dir)
+ monkeykas.setenv('KAS_CLONE_DEPTH', '1')
kas.kas(['checkout', 'test.yml'])

assert os.path.exists(os.path.join(build_dir, 'conf'))
@@ -58,6 +60,7 @@ def test_ssh_agent_setup(monkeykas, tmpdir, capsys):
conf_dir = str(tmpdir / 'test_ssh_agent_setup')
shutil.copytree('tests/test_environment_variables', conf_dir)
monkeykas.chdir(conf_dir)
+ monkeykas.setenv('KAS_CLONE_DEPTH', '1')

SSH_AUTH_SOCK = '/tmp/ssh-KLTafE/agent.64708'

@@ -115,6 +118,7 @@ def _test_env_section_export(monkeykas, tmpdir, bb_env_var, bb_repo):

shutil.copytree('tests/test_environment_variables', str(conf_dir))
monkeykas.chdir(conf_dir)
+ monkeykas.setenv('KAS_CLONE_DEPTH', '1')

# Overwrite oe-init-build-env script
# BB_ENV_* filter variables are only exported by
@@ -127,6 +131,7 @@ def _test_env_section_export(monkeykas, tmpdir, bb_env_var, bb_repo):
init_build_env.chmod(0o775)

# Before executing bitbake, first get the bitbake.conf
+
kas.kas(['checkout', 'test_env.yml'])
shutil.copy(str(conf_dir / bb_repo / 'conf' / 'bitbake.conf'),
str(pathlib.Path('build') / 'conf' / 'bitbake.conf'))
--
2.39.2

Jan Kiszka

unread,
May 24, 2024, 10:08:11 AMMay 24
to Felix Moessbauer, kas-...@googlegroups.com
Ok, nice, but more important are the image tests, specifically the one
for yocto as it pulls poky.

Jan

--
Siemens AG, Technology
Linux Expert Center

Jan Kiszka

unread,
May 24, 2024, 10:09:04 AMMay 24
to Felix Moessbauer, kas-...@googlegroups.com
Strike that, that's what patch 1 does.

Jan Kiszka

unread,
May 24, 2024, 10:12:07 AMMay 24
to Felix Moessbauer, kas-...@googlegroups.com
On 24.05.24 16:00, Felix Moessbauer wrote:
Hmm, maybe rather remove the newline after shutil.copy to form one
logical block?

> kas.kas(['checkout', 'test_env.yml'])
> shutil.copy(str(conf_dir / bb_repo / 'conf' / 'bitbake.conf'),
> str(pathlib.Path('build') / 'conf' / 'bitbake.conf'))

Reply all
Reply to author
Forward
0 new messages