osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887?usp=email )
Change subject: testenv: add TESTENV_REBUILD_OUTDATED_IMAGE
......................................................................
testenv: add TESTENV_REBUILD_OUTDATED_IMAGE
Add an environment variable that allows rebuilding the podman image
whenever it appears to be outdated. This is useful when working on the
Dockerfile. As requested by Pau.
Change-Id: Ia1243320b6d310c69ef9291cca69a1594b1a8a70
---
M _testenv/README.md
M _testenv/testenv/podman.py
2 files changed, 25 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/37887/1
diff --git a/_testenv/README.md b/_testenv/README.md
index 8b868d6..d713a1c 100644
--- a/_testenv/README.md
+++ b/_testenv/README.md
@@ -123,6 +123,12 @@
Set the directory for sources of Osmocom components. The default is the
directory above your osmo-ttcn3-hacks.git clone.
+* `TESTENV_REBUILD_OUTDATED_IMAGE`:
+ Automatically rebuild the outdated image, instead of only displaying a
+ warning. This is not the default because rebuilding it takes some time and is
+ oftentimes not needed (e.g. if a dependency was added that is not relevant to
+ the testsuite that the user is currently testing).
+
* `TESTENV_NO_IMAGE_UP_TO_DATE_CHECK`:
Do not compare the timestamp of `data/podman/Dockerfile` with the date of the
podman image. This check does not work on jenkins where we always have
diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index a972d95..2668b0d 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -52,13 +52,14 @@
return mtime < created
-def image_build():
- if image_exists() and image_up_to_date():
- logging.debug(f"Podman image is up-to-date: {image_name}")
- if testenv.args.force:
- logging.debug("Building anyway since --force was used")
- else:
- return
+def image_build(check_existing=True):
+ if check_existing:
+ if image_exists() and image_up_to_date():
+ logging.debug(f"Podman image is up-to-date: {image_name}")
+ if testenv.args.force:
+ logging.debug("Building anyway since --force was used")
+ else:
+ return
logging.info(f"Building podman image: {image_name}")
testenv.cmd.run(
@@ -110,7 +111,17 @@
if not image_exists():
raise testenv.NoTraceException("Missing podman image, run 'testenv.py init podman' first to build it")
if not image_up_to_date():
- logging.warning("The podman image might be outdated, consider running 'testenv.py init podman' to rebuild it")
+ if os.environ.get("TESTENV_REBUILD_OUTDATED_IMAGE") == "1":
+ logging.warning("The podman image is outdated, rebuilding it... (TESTENV_REBUILD_OUTDATED_IMAGE=1)")
+ image_build(False)
+ else:
+ # Rebuilding the image takes some time, and oftentimes it is not
+ # needed. So by default don't force the user to rebuild it, just
+ # show a warning.
+ logging.warning(
+ "The podman image might be outdated, consider running 'testenv.py init podman' to rebuild it"
+ )
+ logging.debug("Set TESTENV_REBUILD_OUTDATED_IMAGE=1 to rebuild it automatically")
atexit.register(stop)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia1243320b6d310c69ef9291cca69a1594b1a8a70
Gerrit-Change-Number: 37887
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Attention is currently required from: osmith.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37884?usp=email )
Change subject: testenv: cmd: pass all env vars without --podman
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37884?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5e710a1ee7185a3f6f4f1e98f201f3f6fda2be55
Gerrit-Change-Number: 37884
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 21 Aug 2024 13:25:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email )
Change subject: testenv: set args.podman = False if action != "run"
......................................................................
testenv: set args.podman = False if action != "run"
Fix "./testenv.py clean":
File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/_testenv/testenv/cmd.py", line 85, in run
if not no_podman and testenv.args.podman:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'podman'
Change-Id: I44d5229aa481bfed13c006368d590e1486536c0e
---
M _testenv/testenv/__init__.py
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, approved
osmith: Verified
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index fe9a612..87485c7 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -145,6 +145,9 @@
if args.binary_repo and args.binary_repo.endswith(":latest"):
logging.debug("Binary repository ends in :latest, using latest configs")
args.latest = True
+ else:
+ # podman is only used in "testenv run"
+ args.podman = False
def verify_args_run():
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I44d5229aa481bfed13c006368d590e1486536c0e
Gerrit-Change-Number: 37885
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email )
Change subject: testenv: set args.podman = False if action != "run"
......................................................................
Patch Set 1: Verified+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I44d5229aa481bfed13c006368d590e1486536c0e
Gerrit-Change-Number: 37885
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 21 Aug 2024 12:19:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email )
Change subject: testenv: set args.podman = False if action != "run"
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1:
I confirm it fixed the problem for me.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I44d5229aa481bfed13c006368d590e1486536c0e
Gerrit-Change-Number: 37885
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 21 Aug 2024 12:18:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email )
Change subject: testenv: set args.podman = False if action != "run"
......................................................................
testenv: set args.podman = False if action != "run"
Fix "./testenv.py clean":
File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/_testenv/testenv/cmd.py", line 85, in run
if not no_podman and testenv.args.podman:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'podman'
Change-Id: I44d5229aa481bfed13c006368d590e1486536c0e
---
M _testenv/testenv/__init__.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/37885/1
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index fe9a612..87485c7 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -145,6 +145,9 @@
if args.binary_repo and args.binary_repo.endswith(":latest"):
logging.debug("Binary repository ends in :latest, using latest configs")
args.latest = True
+ else:
+ # podman is only used in "testenv run"
+ args.podman = False
def verify_args_run():
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37885?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I44d5229aa481bfed13c006368d590e1486536c0e
Gerrit-Change-Number: 37885
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/docker-playground/+/37714?usp=email )
Change subject: Remove ttcn3 testsuites ported to testenv, part 1
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
I have tested a couple different testsuites and it's working fine, so we can get rid of these in docker-playground.git.
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/37714?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I7182c7e8eb00a9323fe1b6d27f630d253b4d34f6
Gerrit-Change-Number: 37714
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 21 Aug 2024 11:08:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes