toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
Subject: [PATCH 1/2] Toaster: tests: add passthroughs for relevant build environment variables
Date: Thu, 23 Nov 2023 10:12:14 -0500	[thread overview]
Message-ID: <20231123151215.4390-2-alexander.lussier-cullen@savoirfairelinux.com> (raw)
In-Reply-To: <20231123151215.4390-1-alexander.lussier-cullen@savoirfairelinux.com>

Toaster build tests create new build environments which do not utlize
any existing build environment variables.
In particular, DL_DIR and SSTATE_DIR from an existing environment can
be passed in to allow for faster builds.

Adding these as passthroughs specifically resolves slow builds
related to the autobuilder integrations of the toaster test suite.

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
---
 bitbake/lib/toaster/tests/builds/buildtest.py | 9 +++++++++
 bitbake/lib/toaster/tox.ini                   | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/bitbake/lib/toaster/tests/builds/buildtest.py b/bitbake/lib/toaster/tests/builds/buildtest.py
index 13b51fb0d8..53cd7a9ffa 100644
--- a/bitbake/lib/toaster/tests/builds/buildtest.py
+++ b/bitbake/lib/toaster/tests/builds/buildtest.py
@@ -116,6 +116,15 @@ class BuildTest(unittest.TestCase):
         project = Project.objects.create_project(name=BuildTest.PROJECT_NAME,
                                                  release=release)
 
+        passthrough_variable_names = ["SSTATE_DIR", "DL_DIR"]
+        for variable_name in passthrough_variable_names:
+            current_variable = os.environ.get(variable_name)
+            if current_variable:
+                ProjectVariable.objects.get_or_create(
+                    name=variable_name,
+                    value=current_variable,
+                    project=project)
+
         if os.environ.get("TOASTER_TEST_USE_SSTATE_MIRROR"):
             ProjectVariable.objects.get_or_create(
                 name="SSTATE_MIRRORS",
diff --git a/bitbake/lib/toaster/tox.ini b/bitbake/lib/toaster/tox.ini
index d058558b05..9928657106 100644
--- a/bitbake/lib/toaster/tox.ini
+++ b/bitbake/lib/toaster/tox.ini
@@ -5,6 +5,9 @@ toxworkdir = {env:TOX_WORKDIR:.tox}
 passenv = *
 
 [testenv]
+passenv =
+    SSTATE_DIR
+    DL_DIR
 setenv =
     DJANGO_SETTINGS_MODULE=toastermain.settings_test
     TOASTER_BUILDSERVER=1
-- 
2.34.1



  reply	other threads:[~2023-11-23 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 15:12 [PATCH 0/2] Toaster test improvements for autobuilder Alexander Lussier-Cullen
2023-11-23 15:12 ` Alexander Lussier-Cullen [this message]
2023-11-23 15:12 ` [PATCH 2/2] Toaster: make django temp directory configurable Alexander Lussier-Cullen

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=20231123151215.4390-2-alexander.lussier-cullen@savoirfairelinux.com \
    --to=alexander.lussier-cullen@savoirfairelinux.com \
    --cc=toaster@lists.yoctoproject.org \
    /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;
as well as URLs for NNTP newsgroup(s).