summaryrefslogtreecommitdiff
path: root/tests/integration/workspace.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/workspace.py')
-rw-r--r--tests/integration/workspace.py94
1 files changed, 21 insertions, 73 deletions
diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py
index 127a9358d..a5f9eded5 100644
--- a/tests/integration/workspace.py
+++ b/tests/integration/workspace.py
@@ -17,18 +17,13 @@ DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project")
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
def test_workspace_stages_once(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
element_name = "workspace/workspace-mount.bst"
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
assert cli.get_element_key(project, element_name) != "{:?<64}".format("")
res = cli.run(project=project, args=["build", element_name])
@@ -36,18 +31,13 @@ def test_workspace_stages_once(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
def test_workspace_mount(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
element_name = "workspace/workspace-mount.bst"
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
res = cli.run(project=project, args=["build", element_name])
@@ -66,30 +56,20 @@ def test_workspace_mount_on_read_only_directory(cli, datafiles):
# make directory RO
os.chmod(workspace, 0o555)
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
@pytest.mark.xfail(HAVE_SANDBOX == "buildbox", reason="Not working with BuildBox")
-@pytest.mark.xfail(
- reason="Incremental builds are currently incompatible with workspace source plugin."
-)
+@pytest.mark.xfail(reason="Incremental builds are currently incompatible with workspace source plugin.")
def test_workspace_commanddir(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
element_name = "workspace/workspace-commanddir.bst"
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
res = cli.run(project=project, args=["build", element_name])
@@ -100,9 +80,7 @@ def test_workspace_commanddir(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
def test_workspace_updated_dependency(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
@@ -124,10 +102,7 @@ def test_workspace_updated_dependency(cli, datafiles):
_yaml.roundtrip_dump(dependency, os.path.join(element_path, dep_name))
# First open the workspace
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
# We build the workspaced element, so that we have an artifact
@@ -156,9 +131,7 @@ def test_workspace_updated_dependency(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
def test_workspace_update_dependency_failed(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
@@ -181,10 +154,7 @@ def test_workspace_update_dependency_failed(cli, datafiles):
_yaml.roundtrip_dump(dependency, os.path.join(element_path, dep_name))
# First open the workspace
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
# We build the workspaced element, so that we have an artifact
@@ -233,9 +203,7 @@ def test_workspace_update_dependency_failed(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
def test_updated_dependency_nested(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
@@ -258,10 +226,7 @@ def test_updated_dependency_nested(cli, datafiles):
_yaml.roundtrip_dump(dependency, os.path.join(element_path, dep_name))
# First open the workspace
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
# We build the workspaced element, so that we have an artifact
@@ -288,13 +253,9 @@ def test_updated_dependency_nested(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
@pytest.mark.xfail(HAVE_SANDBOX == "buildbox", reason="Not working with BuildBox")
-@pytest.mark.xfail(
- reason="Incremental builds are currently incompatible with workspace source plugin."
-)
+@pytest.mark.xfail(reason="Incremental builds are currently incompatible with workspace source plugin.")
def test_incremental_configure_commands_run_only_once(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "workspace")
@@ -310,10 +271,7 @@ def test_incremental_configure_commands_run_only_once(cli, datafiles):
_yaml.roundtrip_dump(element, os.path.join(element_path, element_name))
# We open a workspace on the above element
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
res.assert_success()
# Then we build, and check whether the configure step succeeded
@@ -339,9 +297,7 @@ def test_incremental_configure_commands_run_only_once(cli, datafiles):
# part of a cleanup job.
#
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
@pytest.mark.xfail(HAVE_SANDBOX == "buildbox", reason="Not working with BuildBox")
def test_workspace_missing_last_successful(cli, datafiles):
project = str(datafiles)
@@ -349,10 +305,7 @@ def test_workspace_missing_last_successful(cli, datafiles):
element_name = "workspace/workspace-commanddir.bst"
# Open workspace
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
assert res.exit_code == 0
# Build first, this will record the last successful build in local state
@@ -370,19 +323,14 @@ def test_workspace_missing_last_successful(cli, datafiles):
# Check that we can still read failed workspace logs
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.skipif(
- not HAVE_SANDBOX, reason="Only available with a functioning sandbox"
-)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
def test_workspace_failed_logs(cli, datafiles):
project = str(datafiles)
workspace = os.path.join(cli.directory, "failing_amhello")
element_name = "autotools/amhello-failure.bst"
# Open workspace
- res = cli.run(
- project=project,
- args=["workspace", "open", "--directory", workspace, element_name],
- )
+ res = cli.run(project=project, args=["workspace", "open", "--directory", workspace, element_name],)
res.assert_success()
# Try to build and ensure the build fails