summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2019-04-26 15:44:50 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2019-06-12 13:54:49 +0100
commit9b6c1628dd14adeadd8e34624f5db74e959c60f4 (patch)
tree3bf7e848dd381412b546beaf2b29d63a9fbc0ba2
parentd608e92a48f21fd4ecacde416f0b8ea3fdd2f562 (diff)
downloadbuildstream-9b6c1628dd14adeadd8e34624f5db74e959c60f4.tar.gz
Update example tests
-rw-r--r--tests/examples/autotools.py6
-rw-r--r--tests/examples/integration-commands.py6
-rw-r--r--tests/examples/junctions.py33
3 files changed, 8 insertions, 37 deletions
diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py
index ca311c4bb..353014129 100644
--- a/tests/examples/autotools.py
+++ b/tests/examples/autotools.py
@@ -6,7 +6,7 @@ import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import assert_contains
-from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
@@ -16,8 +16,6 @@ DATA_DIR = os.path.join(
# Tests a build of the autotools amhello project on a alpine-linux base runtime
-@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
- reason='Examples are written for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_build(cli, datafiles):
@@ -39,8 +37,6 @@ def test_autotools_build(cli, datafiles):
# Test running an executable built with autotools.
-@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
- reason='Examples are written for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_run(cli, datafiles):
diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py
index ad794351f..72ed3b935 100644
--- a/tests/examples/integration-commands.py
+++ b/tests/examples/integration-commands.py
@@ -5,7 +5,7 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
@@ -14,8 +14,6 @@ DATA_DIR = os.path.join(
)
-@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
- reason='Examples are written for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_integration_commands_build(cli, datafiles):
@@ -26,8 +24,6 @@ def test_integration_commands_build(cli, datafiles):
# Test running the executable
-@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
- reason='Examples are written for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_integration_commands_run(cli, datafiles):
diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py
index bb88e5068..2e8638ee5 100644
--- a/tests/examples/junctions.py
+++ b/tests/examples/junctions.py
@@ -5,54 +5,33 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import IS_LINUX, HAVE_BWRAP
pytestmark = pytest.mark.integration
-
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)), '..', '..', 'doc', 'examples', 'junctions'
)
# Test that the project builds successfully
-@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
- reason='Examples are written for x86-64')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_build(cli, datafiles):
project = str(datafiles)
- result = cli.run(project=project, args=['build', 'callHello.bst'])
+ result = cli.run(project=project, args=['build', 'hello.bst'])
result.assert_success()
-# Test the callHello script works as expected.
-@pytest.mark.skipif(MACHINE_ARCH != 'x86-64',
- reason='Examples are written for x86-64')
+# Test running the executable
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_shell_call_hello(cli, datafiles):
project = str(datafiles)
- result = cli.run(project=project, args=['build', 'callHello.bst'])
- result.assert_success()
-
- result = cli.run(project=project, args=['shell', 'callHello.bst', '--', '/bin/sh', 'callHello.sh'])
- result.assert_success()
- assert result.output == 'Calling hello:\nHello World!\nThis is amhello 1.0.\n'
-
-
-# Test opening a cross-junction workspace
-@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
-@pytest.mark.datafiles(DATA_DIR)
-def test_open_cross_junction_workspace(cli, tmpdir, datafiles):
- project = str(datafiles)
- workspace_dir = os.path.join(str(tmpdir), "workspace_hello_junction")
-
- result = cli.run(project=project,
- args=['workspace', 'open', '--directory', workspace_dir, 'hello-junction.bst:hello.bst'])
+ result = cli.run(project=project, args=['build', 'hello.bst'])
result.assert_success()
- result = cli.run(project=project,
- args=['workspace', 'close', '--remove-dir', 'hello-junction.bst:hello.bst'])
+ result = cli.run(project=project, args=['shell', 'hello.bst', '--', 'hello'])
result.assert_success()
+ assert result.output == 'Hello World\n'