This is an automated email from the ASF dual-hosted git repository. root pushed a commit to branch tlater/freedocstop-sdk in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 9b6c1628dd14adeadd8e34624f5db74e959c60f4 Author: Tristan Maat <[email protected]> AuthorDate: Fri Apr 26 15:44:50 2019 +0100 Update example tests --- tests/examples/autotools.py | 6 +----- tests/examples/integration-commands.py | 6 +----- tests/examples/junctions.py | 33 ++++++--------------------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py index ca311c4..3530141 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 [email protected](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. [email protected](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 ad79435..72ed3b9 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( ) [email protected](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 [email protected](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 bb88e50..2e8638e 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 [email protected](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. [email protected](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 [email protected](not IS_LINUX, reason='Only available on linux') [email protected](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'
