public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v2 08/12] CI: Enable sstate dir sharing
Date: Fri,  3 Mar 2023 16:47:23 +0200	[thread overview]
Message-ID: <20230303144727.481716-9-amikan@ilbers.de> (raw)
In-Reply-To: <20230303144727.481716-1-amikan@ilbers.de>

Test cases performed in different build dirs now can share SSTATE_DIR.
Enable it by default and disable sharing for cache-related test cases.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 testsuite/cibase.py    | 8 ++++----
 testsuite/cibuilder.py | 7 +++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 6239b4d..3267c17 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -31,7 +31,7 @@ class CIBaseTest(CIBuilder):
         gpg_pub_key = os.path.dirname(__file__) + '/keys/base-apt/test_pub.key'
         gpg_priv_key = os.path.dirname(__file__) + '/keys/base-apt/test_priv.key'
 
-        self.configure(gpg_pub_key=gpg_pub_key if signed else None, **kwargs)
+        self.configure(gpg_pub_key=gpg_pub_key if signed else None, sstate_dir="", **kwargs)
 
         os.chdir(self.build_dir)
 
@@ -44,7 +44,7 @@ class CIBaseTest(CIBuilder):
         self.bitbake(targets, **kwargs)
 
         self.delete_from_build_dir('tmp')
-        self.configure(gpg_pub_key=gpg_pub_key if signed else None, offline=True, **kwargs)
+        self.configure(gpg_pub_key=gpg_pub_key if signed else None, offline=True, sstate_dir="", **kwargs)
 
         self.bitbake(targets, **kwargs)
 
@@ -67,7 +67,7 @@ class CIBaseTest(CIBuilder):
                             count += int(content[field])
             return count
 
-        self.configure(ccache=True, **kwargs)
+        self.configure(ccache=True, sstate_dir="", **kwargs)
 
         # Field that stores direct ccache hits
         direct_cache_hit = 22
@@ -119,7 +119,7 @@ class CIBaseTest(CIBuilder):
                     return False
             return True
 
-        self.configure(sstate=True, **kwargs)
+        self.configure(sstate=True, sstate_dir="", **kwargs)
 
         # Cleanup sstate and tmp before test
         self.delete_from_build_dir('sstate-cache')
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 0a07bf0..ef46352 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -58,6 +58,7 @@ class CIBuilder(Test):
     def configure(self, compat_arch=True, cross=True, debsrc_cache=False,
                   container=False, ccache=False, sstate=False, offline=False,
                   gpg_pub_key=None, wic_deploy_parts=False, dl_dir=None,
+                  sstate_dir=None,
                   source_date_epoch=None, image_install=None, **kwargs):
         # write configuration file and set bitbake_args
         # can run multiple times per test case
@@ -66,8 +67,11 @@ class CIBuilder(Test):
         # get parameters from avocado cmdline
         quiet = bool(int(self.params.get('quiet', default=1)))
 
+        # set those to "" to not set dir value but use system default
         if dl_dir is None:
             dl_dir = os.path.join(isar_root, 'downloads')
+        if sstate_dir is None:
+            sstate_dir = os.path.join(isar_root, 'sstate-cache')
 
         # get parameters from environment
         distro_apt_premir = os.getenv('DISTRO_APT_PREMIRRORS')
@@ -85,6 +89,7 @@ class CIBuilder(Test):
                       f'  wic_deploy_parts = {wic_deploy_parts}\n'
                       f'  source_date_epoch = {source_date_epoch} \n'
                       f'  dl_dir = {dl_dir}\n'
+                      f'  sstate_dir = {sstate_dir}\n'
                       f'  image_install = {image_install}\n'
                       f'===================================================')
 
@@ -124,6 +129,8 @@ class CIBuilder(Test):
                 f.write('SOURCE_DATE_EPOCH = "%s"\n' % source_date_epoch)
             if dl_dir:
                 f.write('DL_DIR = "%s"\n' % dl_dir)
+            if sstate_dir:
+                f.write('SSTATE_DIR = "%s"\n' % sstate_dir)
             if image_install is not None:
                 f.write('IMAGE_INSTALL = "%s"' % image_install)
 
-- 
2.34.1


  parent reply	other threads:[~2023-03-03 14:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 14:47 [PATCH v2 00/12] Next avocado improvements​ Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 01/12] CI: Update Avocado version Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 02/12] CI: Add avocado version checking Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 03/12] scripts: Add option to directly specify avocado tags Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 04/12] gitlab-ci.yml: Run dev tests set on push Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 05/12] CI: Set default QEMU timeout to 10 minutes Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 06/12] CI: Make quiet option to be set by default Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 07/12] CI: Remove norun option Anton Mikanovich
2023-03-03 14:47 ` Anton Mikanovich [this message]
2023-03-03 14:47 ` [PATCH v2 09/12] CI: Enable ccache dir sharing Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 10/12] CI: Add Jenkins pipeline configuration Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 11/12] CI: Update avocado install documentation Anton Mikanovich
2023-03-03 14:47 ` [PATCH v2 12/12] CI: Add documentation for test case creation Anton Mikanovich
2023-03-07  4:10 ` [PATCH v2 00/12] Next avocado improvements​ 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=20230303144727.481716-9-amikan@ilbers.de \
    --to=amikan@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