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-04 10:51:44 +0100
commitb57dbff91f46f925d5d3a4c48cc679c54121cb03 (patch)
treeb647c046e5927ed21fd3e58a371a69cb38af8780
parent632d906a42b8ca633871b154936dcbb13f6d6af7 (diff)
downloadbuildstream-traveltissues/1216.tar.gz
tests: avoid testing utimes along with umasktraveltissues/1216
Avoids testing for utimes 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.py9
-rw-r--r--tests/integration/source-determinism.py9
2 files changed, 8 insertions, 10 deletions
diff --git a/src/buildstream/testing/_sourcetests/source_determinism.py b/src/buildstream/testing/_sourcetests/source_determinism.py
index ed00c71ea..c44f0fa14 100644
--- a/src/buildstream/testing/_sourcetests/source_determinism.py
+++ b/src/buildstream/testing/_sourcetests/source_determinism.py
@@ -50,10 +50,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_umask(cli, tmpdir, datafiles, kind):
project = str(datafiles)
element_name = "list.bst"
@@ -92,6 +88,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 +96,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)