From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH 2/3] testsuite: Rework cache populating of sstate-cache in SstateTest
Date: Thu, 14 Sep 2023 12:43:12 +0200 [thread overview]
Message-ID: <20230914104313.30231-3-ubely@ilbers.de> (raw)
In-Reply-To: <20230914104313.30231-1-ubely@ilbers.de>
In SstateTest class we run first build to populate sstate-cache and
the following builds to check if it's used or not.
Since both first and following builds are started from the same isar
location, this approach doesn't allow to find possible issues that are
sensitive to this path.
This patch moves sstate-cache populating to a separate test so that
it uses a different isar location, e.g.:
1st build: "./isar-sstate" => "./isar-sstate/../sstate-cache";
2nd build: "." => "./sstate-cache".
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/cibase.py | 26 +++++++++++++++++++-------
testsuite/citest.py | 6 ++++++
2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index d9641377..d7010387 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -106,6 +106,25 @@ class CIBaseTest(CIBuilder):
self.delete_from_build_dir('ccache')
self.unconfigure()
+ def perform_sstate_populate(self, image_target, **kwargs):
+ # Use a different isar root for populating sstate cache
+ isar_sstate = f"{isar_root}/isar-sstate"
+ os.makedirs(isar_sstate)
+ process.run(f'git --work-tree={isar_sstate} checkout HEAD -- .')
+
+ self.init('../build-sstate', isar_dir=isar_sstate)
+ self.configure(sstate=True, sstate_dir="", **kwargs)
+
+ # Cleanup sstate and tmp before test
+ self.delete_from_build_dir('sstate-cache')
+ self.delete_from_build_dir('tmp')
+
+ # Populate cache
+ self.bitbake(image_target, **kwargs)
+
+ # Remove isar configuration so the the following test creates a new one
+ self.delete_from_build_dir('conf')
+
def perform_sstate_test(self, image_target, package_target, **kwargs):
def check_executed_tasks(target, expected):
taskorder_file = glob.glob(f'{self.build_dir}/tmp/work/*/{target}/*/temp/log.task_order')
@@ -129,13 +148,6 @@ class CIBaseTest(CIBuilder):
self.configure(sstate=True, sstate_dir="", **kwargs)
- # Cleanup sstate and tmp before test
- self.delete_from_build_dir('sstate-cache')
- self.delete_from_build_dir('tmp')
-
- # Populate cache
- self.bitbake(image_target, **kwargs)
-
# Check signature files for cachability issues like absolute paths in signatures
result = process.run(f'{isar_root}/scripts/isar-sstate lint {self.build_dir}/sstate-cache '
f'--build-dir {self.build_dir} --sources-dir {isar_root}')
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 48b10286..1e7a32c0 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -276,6 +276,12 @@ class SstateTest(CIBaseTest):
:avocado: tags=sstate,full
"""
+
+ def test_sstate_populate(self):
+ image_target = 'mc:qemuamd64-bullseye:isar-image-base'
+
+ self.perform_sstate_populate(image_target)
+
def test_sstate(self):
image_target = 'mc:qemuamd64-bullseye:isar-image-base'
package_target = 'mc:qemuamd64-bullseye:hello'
--
2.20.1
next prev parent reply other threads:[~2023-09-14 10:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 10:43 [PATCH 0/3] Improve testsuite and fix bootstrap sstate issue Uladzimir Bely
2023-09-14 10:43 ` [PATCH 1/3] testsuite: Allow using custom isar location in test initialization Uladzimir Bely
2023-09-14 10:43 ` Uladzimir Bely [this message]
2023-09-14 10:43 ` [PATCH 3/3] isar-bootstrap: Avoid absolute paths in SRC_URI Uladzimir Bely
2023-09-19 4:18 ` [PATCH 0/3] Improve testsuite and fix bootstrap sstate issue Uladzimir Bely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230914104313.30231-3-ubely@ilbers.de \
--to=ubely@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox