Skip to content

Commit 78e8aaf

Browse files
committed
test: adjust version test
1 parent b041218 commit 78e8aaf

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/test_opts.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import re
23
import platform
34
import subprocess
45

@@ -148,14 +149,9 @@ def test_bib_version(tmp_path, container_storage, build_fake_container, version_
148149
build_fake_container,
149150
version_argument,
150151
], check=True, capture_output=True, text=True)
151-
152-
expected_rev = "unknown"
153-
git_res = subprocess.run(
154-
["git", "describe", "--always"],
155-
capture_output=True, text=True, check=False)
156-
if git_res.returncode == 0:
157-
expected_rev = git_res.stdout.strip()
158-
assert f"build_revision: {expected_rev}" in res.stdout
152+
# we get the build revision from "image-builer-cli" git tree now, so we just check that
153+
# it looks plausible
154+
assert re.search(r"(?m)^build_revision: [0-9a-f]+$", res.stdout)
159155
assert "build_time: " in res.stdout
160156
assert "build_tainted: " in res.stdout
161157
# we have a final newline

0 commit comments

Comments
 (0)