summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-12-30 08:47:19 +0000
committerJürg Billeter <j@bitron.ch>2020-02-05 16:11:32 +0100
commit8bb98fde8d4862b2d450f76cecb16db5e1868650 (patch)
treecb10f742298dea3249070a5637fac6006ca74d7c
parent546b3c1a46b6850ad182ebefcae9e70237a1186b (diff)
downloadbuildstream-8bb98fde8d4862b2d450f76cecb16db5e1868650.tar.gz
tests: Avoid testing file times along with umask
Avoids testing for file times when testing for umask. These tests are known to be flaky and are overly specific in that they implicitly test more than just umask.
-rw-r--r--src/buildstream/testing/_sourcetests/source_determinism.py12
-rw-r--r--tests/integration/source-determinism.py9
2 files changed, 11 insertions, 10 deletions
diff --git a/src/buildstream/testing/_sourcetests/source_determinism.py b/src/buildstream/testing/_sourcetests/source_determinism.py
index ed00c71ea..b834f3223 100644
--- a/src/buildstream/testing/_sourcetests/source_determinism.py
+++ b/src/buildstream/testing/_sourcetests/source_determinism.py
@@ -50,11 +50,10 @@ def create_test_directory(*path, mode=0o644):
@pytest.mark.integration
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
-@pytest.mark.skipif(
- HAVE_SANDBOX == "buildbox-run" and CASD_SEPARATE_USER,
- reason="Flaky due to timestamps: https://gitlab.com/BuildStream/buildstream/issues/1218",
-)
def test_deterministic_source_umask(cli, tmpdir, datafiles, kind):
+ if CASD_SEPARATE_USER and kind == "ostree":
+ pytest.xfail("The ostree plugin ignores the umask")
+
project = str(datafiles)
element_name = "list.bst"
element_path = os.path.join(project, "elements", element_name)
@@ -92,6 +91,7 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind):
old_umask = os.umask(umask)
try:
+ test_values = []
result = cli.run(project=project, args=["build", element_name])
result.assert_success()
@@ -99,7 +99,9 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind):
result.assert_success()
with open(os.path.join(checkoutdir, "ls-l"), "r") as f:
- return f.read()
+ for line in f.readlines():
+ test_values.append(line.split()[0] + " " + line.split()[-1])
+ return test_values
finally:
os.umask(old_umask)
cli.remove_artifact_from_cache(project, element_name)
diff --git a/tests/integration/source-determinism.py b/tests/integration/source-determinism.py
index 355588133..a69e55a23 100644
--- a/tests/integration/source-determinism.py
+++ b/tests/integration/source-determinism.py
@@ -29,10 +29,6 @@ def create_test_directory(*path, mode=0o644):
@pytest.mark.integration
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
-@pytest.mark.skipif(
- HAVE_SANDBOX == "buildbox-run" and CASD_SEPARATE_USER,
- reason="Flaky due to timestamps: https://gitlab.com/BuildStream/buildstream/issues/1218",
-)
def test_deterministic_source_local(cli, tmpdir, datafiles):
"""Only user rights should be considered for local source.
"""
@@ -62,6 +58,7 @@ def test_deterministic_source_local(cli, tmpdir, datafiles):
create_test_directory(sourcedir, "dir-c", mode=0o2755 & mask)
create_test_directory(sourcedir, "dir-d", mode=0o1755 & mask)
try:
+ test_values = []
result = cli.run(project=project, args=["build", element_name])
result.assert_success()
@@ -69,7 +66,9 @@ def test_deterministic_source_local(cli, tmpdir, datafiles):
result.assert_success()
with open(os.path.join(checkoutdir, "ls-l"), "r") as f:
- return f.read()
+ for line in f.readlines():
+ test_values.append(line.split()[0] + " " + line.split()[-1])
+ return test_values
finally:
cli.remove_artifact_from_cache(project, element_name)