[PATCH 1/3] ci: enable shallow-cloning for container tests

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
By that, we gain more test coverage for the shallow-clone feature, as
well as speedup our CI runs (esp. for poky).

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
Note, that this reduces the poky clone time on gh actions from
~45sec to ~3sec.

.github/workflows/next.yml | 1 +
1 file changed, 1 insertion(+)

diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml
index b30644171..b86275b2d 100644
--- a/.github/workflows/next.yml
+++ b/.github/workflows/next.yml
@@ -98,6 +98,7 @@ jobs:
run: |
cd image-tests/${{ matrix.image-name }}
KAS_CONTAINER_IMAGE=ghcr.io/${{ github.repository }}/${{ matrix.image-name }}:next \
+ KAS_CLONE_DEPTH=1 \
../../kas-container build kas.yml
- name: Complete build and deploy ${{ matrix.image-name }} image
uses: docker/build-push-action@v5
--
2.39.2

Felix Moessbauer

unread,
May 24, 2024, 10:00:20 AMMay 24
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The test9.yml file is no longer used in any test. By that, drop it.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
tests/test_refspec/test9.yml | 10 ----------
1 file changed, 10 deletions(-)
delete mode 100644 tests/test_refspec/test9.yml

diff --git a/tests/test_refspec/test9.yml b/tests/test_refspec/test9.yml
deleted file mode 100644
index a7213ed95..000000000
--- a/tests/test_refspec/test9.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-header:
- version: 15
-
-repos:
- this:
-
- bitbake:
- url: https://github.com/openembedded/bitbake.git
- branch: '2.2'
- commit: 191e6eb2bceb467c97e315301f1f64722cf0e976
--
2.39.2

Jan Kiszka

unread,
May 24, 2024, 10:07:14 AMMay 24
to Felix Moessbauer, kas-...@googlegroups.com
On 24.05.24 16:00, Felix Moessbauer wrote:
> The test9.yml file is no longer used in any test. By that, drop it.
>

In fact, it was never used, was it?

How about renumbering the test files at this chance?

Jan

> Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
> ---
> tests/test_refspec/test9.yml | 10 ----------
> 1 file changed, 10 deletions(-)
> delete mode 100644 tests/test_refspec/test9.yml
>
> diff --git a/tests/test_refspec/test9.yml b/tests/test_refspec/test9.yml
> deleted file mode 100644
> index a7213ed95..000000000
> --- a/tests/test_refspec/test9.yml
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -header:
> - version: 15
> -
> -repos:
> - this:
> -
> - bitbake:
> - url: https://github.com/openembedded/bitbake.git
> - branch: '2.2'
> - commit: 191e6eb2bceb467c97e315301f1f64722cf0e976

--
Siemens AG, Technology
Linux Expert Center

Felix Moessbauer

unread,
May 24, 2024, 10:23:12 AMMay 24
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
By that, we gain more test coverage for the shallow-clone feature, as
well as speedup our CI runs (esp. for poky).

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---

Felix Moessbauer

unread,
May 24, 2024, 10:23:12 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>
---
Changes since v1: only apply KAS_CLONE_DEPTH to cases where something
is cloned.

tests/test_environment_variables.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/tests/test_environment_variables.py b/tests/test_environment_variables.py
index 4da839418..95d9c2954 100644
--- a/tests/test_environment_variables.py
+++ b/tests/test_environment_variables.py
@@ -115,6 +115,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
--
2.39.2

Felix Moessbauer

unread,
May 24, 2024, 10:23:13 AMMay 24
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The test9.yml file is no longer used in any test. By that, drop it.
While doing so, renumber the higher-numbered tests.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
tests/test_refspec.py | 4 ++--
tests/test_refspec/test10.yml | 9 ++++-----
tests/test_refspec/test11.yml | 10 ----------
tests/test_refspec/test9.yml | 9 +++++----
4 files changed, 11 insertions(+), 21 deletions(-)
delete mode 100644 tests/test_refspec/test11.yml

diff --git a/tests/test_refspec.py b/tests/test_refspec.py
index f8183c142..18c1b4393 100644
--- a/tests/test_refspec.py
+++ b/tests/test_refspec.py
@@ -225,7 +225,7 @@ def test_branch_and_tag(monkeykas, tmpdir):
shutil.copytree('tests/test_refspec', tdir)
monkeykas.chdir(tdir)
with pytest.raises(RepoRefError):
- kas.kas(['checkout', 'test10.yml'])
+ kas.kas(['checkout', 'test9.yml'])

with pytest.raises(RepoRefError):
- kas.kas(['checkout', 'test11.yml'])
+ kas.kas(['checkout', 'test10.yml'])
diff --git a/tests/test_refspec/test10.yml b/tests/test_refspec/test10.yml
index 1e59321cc..71cf5a89f 100644
--- a/tests/test_refspec/test10.yml
+++ b/tests/test_refspec/test10.yml
@@ -4,8 +4,7 @@ header:
repos:
this:

- evolve:
- url: https://repo.mercurial-scm.org/evolve/
- type: hg
- branch: stable
- commit: '6634:991cbf0f66f2'
+ kas:
+ url: https://github.com/siemens/kas.git
+ tag: 3.0.1
+ branch: master
diff --git a/tests/test_refspec/test11.yml b/tests/test_refspec/test11.yml
deleted file mode 100644
index 71cf5a89f..000000000
--- a/tests/test_refspec/test11.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-header:
- version: 15
-
-repos:
- this:
-
- kas:
- url: https://github.com/siemens/kas.git
- tag: 3.0.1
- branch: master
diff --git a/tests/test_refspec/test9.yml b/tests/test_refspec/test9.yml
index a7213ed95..1e59321cc 100644
--- a/tests/test_refspec/test9.yml
+++ b/tests/test_refspec/test9.yml
@@ -4,7 +4,8 @@ header:
repos:
this:

- bitbake:
- url: https://github.com/openembedded/bitbake.git
- branch: '2.2'
- commit: 191e6eb2bceb467c97e315301f1f64722cf0e976
+ evolve:
+ url: https://repo.mercurial-scm.org/evolve/
+ type: hg
+ branch: stable
+ commit: '6634:991cbf0f66f2'
--
2.39.2

Jan Kiszka

unread,
May 24, 2024, 10:45:17 AMMay 24
to Felix Moessbauer, kas-...@googlegroups.com
Thanks, all 3 applied.

Jan
Reply all
Reply to author
Forward
0 new messages