Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (9)
Showing
with 143 additions and 82 deletions
......@@ -10,6 +10,11 @@ stages:
- test
- post
variables:
PYTEST_ADDOPTS: "--color=yes"
INTEGRATION_CACHE: "${CI_PROJECT_DIR}/cache/integration-cache"
TEST_COMMAND: 'python3 setup.py test --index-url invalid://uri --addopts --integration'
#####################################################
# Prepare stage #
#####################################################
......@@ -52,66 +57,65 @@ source_dist:
# Run premerge commits
#
.linux-tests-template: &linux-tests
.linux-tests-template: &tests
stage: test
variables:
PYTEST_ADDOPTS: "--color=yes"
script:
COVERAGE_DIR: coverage-linux
before_script:
# Diagnostics
- mount
- df -h
- useradd -Um buildstream
- chown -R buildstream:buildstream .
- export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
# Unpack and get into dist/buildstream
# Unpack
- cd dist && ./unpack.sh
- chown -R buildstream:buildstream buildstream
- cd buildstream
script:
- useradd -Um buildstream
- chown -R buildstream:buildstream .
# Run the tests from the source distribution, We run as a simple
# user to test for permission issues
- su buildstream -c 'python3 setup.py test --index-url invalid://uri --addopts --integration'
- su buildstream -c "${TEST_COMMAND}"
# Go back to the toplevel and collect our reports
- cd ../..
- mkdir -p coverage-linux/
- cp dist/buildstream/.coverage coverage-linux/coverage."${CI_JOB_NAME}"
after_script:
# Collect our reports
- mkdir -p ${COVERAGE_DIR}
- cp dist/buildstream/.coverage ${COVERAGE_DIR}/coverage."${CI_JOB_NAME}"
except:
- schedules
artifacts:
paths:
- coverage-linux/
- ${COVERAGE_DIR}
tests-debian-9:
image: buildstream/testsuite-debian:9-master-119-552f5fc6
<<: *linux-tests
<<: *tests
tests-fedora-27:
image: buildstream/testsuite-fedora:27-master-119-552f5fc6
<<: *linux-tests
<<: *tests
tests-fedora-28:
image: buildstream/testsuite-fedora:28-master-119-552f5fc6
<<: *linux-tests
<<: *tests
tests-ubuntu-18.04:
image: buildstream/testsuite-ubuntu:18.04-master-119-552f5fc6
<<: *linux-tests
<<: *tests
tests-unix:
# Use fedora here, to a) run a test on fedora and b) ensure that we
# can get rid of ostree - this is not possible with debian-8
image: buildstream/testsuite-fedora:27-master-119-552f5fc6
stage: test
<<: *tests
variables:
BST_FORCE_BACKEND: "unix"
PYTEST_ADDOPTS: "--color=yes"
script:
COVERAGE_DIR: coverage-unix
- export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
script:
# We remove the Bubblewrap and OSTree packages here so that we catch any
# codepaths that try to use them. Removing OSTree causes fuse-libs to
......@@ -119,22 +123,26 @@ tests-unix:
- dnf mark install fuse-libs
- dnf erase -y bubblewrap ostree
# Unpack and get into dist/buildstream
- cd dist && ./unpack.sh && cd buildstream
# Since the unix platform is required to run as root, no user change required
- python3 setup.py test --index-url invalid://uri --addopts --integration
- ${TEST_COMMAND}
# Go back to the toplevel and collect our reports
- cd ../..
- mkdir -p coverage-unix/
- cp dist/buildstream/.coverage coverage-unix/coverage.unix
except:
- schedules
artifacts:
paths:
- coverage-unix/
- logs-unix/
tests-fedora-missing-deps:
# Ensure that tests behave nicely while missing bwrap and ostree
image: buildstream/testsuite-fedora:28-master-119-552f5fc6
<<: *tests
script:
# We remove the Bubblewrap and OSTree packages here so that we catch any
# codepaths that try to use them. Removing OSTree causes fuse-libs to
# disappear unless we mark it as user-installed.
- dnf mark install fuse-libs
- dnf erase -y bubblewrap ostree
- useradd -Um buildstream
- chown -R buildstream:buildstream .
- ${TEST_COMMAND}
# Automatically build documentation for every commit, we want to know
......@@ -259,7 +267,7 @@ coverage:
- pip3 install --no-index .
- mkdir report
- cd report
- cp ../../../coverage-unix/coverage.unix .
- cp ../../../coverage-unix/coverage.* .
- cp ../../../coverage-linux/coverage.* .
- ls coverage.*
- coverage combine --rcfile=../.coveragerc -a coverage.*
......
......@@ -973,32 +973,34 @@ class Source(Plugin):
# the items of source_fetchers, if it happens to be a generator.
#
source_fetchers = iter(source_fetchers)
try:
while True:
while True:
with context.silence():
with context.silence():
try:
fetcher = next(source_fetchers)
alias = fetcher._get_alias()
for uri in project.get_alias_uris(alias, first_pass=self.__first_pass):
try:
fetcher.fetch(uri)
# FIXME: Need to consider temporary vs. permanent failures,
# and how this works with retries.
except BstError as e:
last_error = e
continue
# No error, we're done with this fetcher
except StopIteration:
# as per PEP479, we are not allowed to let StopIteration
# thrown from a context manager.
# Catching it here and breaking instead.
break
else:
# No break occurred, raise the last detected error
raise last_error
alias = fetcher._get_alias()
for uri in project.get_alias_uris(alias, first_pass=self.__first_pass):
try:
fetcher.fetch(uri)
# FIXME: Need to consider temporary vs. permanent failures,
# and how this works with retries.
except BstError as e:
last_error = e
continue
except StopIteration:
pass
# No error, we're done with this fetcher
break
else:
# No break occurred, raise the last detected error
raise last_error
# Default codepath is to reinstantiate the Source
#
......
......@@ -3,7 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -13,7 +13,7 @@ DATA_DIR = os.path.join(
# Tests a build of the autotools amhello project on a alpine-linux base runtime
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -36,7 +36,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
# Test running an executable built with autotools.
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -4,7 +4,7 @@ import pytest
import tests.testutils.patch as patch
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -14,7 +14,7 @@ DATA_DIR = os.path.join(
# Test that the project builds successfully
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -35,7 +35,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
# Test the unmodified hello command works as expected.
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_run_unmodified_hello(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -66,7 +66,7 @@ def test_open_workspace(cli, tmpdir, datafiles):
# Test making a change using the workspace
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_make_change_in_workspace(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -3,7 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import HAVE_OSTREE, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -32,7 +32,7 @@ def workaround_setuptools_bug(project):
# Test that a build upon flatpak runtime 'works' - we use the autotools sample
# amhello project for this.
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_OSTREE, reason='Only available on linux with ostree')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -55,7 +55,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
# Test running an executable built with autotools
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_OSTREE, reason='Only available on linux with ostree')
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -3,7 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -12,7 +12,7 @@ DATA_DIR = os.path.join(
)
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -23,7 +23,7 @@ def test_integration_commands_build(cli, tmpdir, datafiles):
# Test running the executable
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -3,7 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import IS_LINUX, HAVE_BWRAP
pytestmark = pytest.mark.integration
......@@ -13,7 +13,7 @@ DATA_DIR = os.path.join(
# Test that the project builds successfully
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -23,7 +23,7 @@ def test_build(cli, tmpdir, datafiles):
# Test the callHello script works as expected.
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -3,7 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import IS_LINUX, HAVE_BWRAP
pytestmark = pytest.mark.integration
......@@ -12,7 +12,7 @@ DATA_DIR = os.path.join(
)
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_running_commands_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -23,7 +23,7 @@ def test_running_commands_build(cli, tmpdir, datafiles):
# Test running the executable
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap')
@pytest.mark.datafiles(DATA_DIR)
def test_running_commands_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -3,6 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -18,6 +19,7 @@ DATA_DIR = os.path.join(
# amhello project for this.
@pytest.mark.integration
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_autotools_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -42,6 +44,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
# amhello project for this.
@pytest.mark.integration
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_autotools_confroot_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -64,6 +67,7 @@ def test_autotools_confroot_build(cli, tmpdir, datafiles):
# Test running an executable built with autotools
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_autotools_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_name = 'autotools/amhello.bst'
......
......@@ -3,6 +3,7 @@ import pytest
import shutil
from tests.testutils import cli, cli_integration, create_artifact_share
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
from buildstream._exceptions import ErrorDomain
......@@ -16,6 +17,7 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_buildtree_staged(cli_integration, tmpdir, datafiles):
# i.e. tests that cached build trees are staged by `bst shell --build`
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -31,6 +33,7 @@ def test_buildtree_staged(cli_integration, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_buildtree_from_failure(cli_integration, tmpdir, datafiles):
# i.e. test that on a build failure, we can still shell into it
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -50,6 +53,7 @@ def test_buildtree_from_failure(cli_integration, tmpdir, datafiles):
# Check that build shells work when pulled from a remote cache
# This is to roughly simulate remote execution
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_buildtree_pulled(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_name = 'build-shell/buildtree.bst'
......
......@@ -5,7 +5,7 @@ from buildstream import _yaml
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import IS_LINUX
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -16,7 +16,7 @@ DATA_DIR = os.path.join(
)
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@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_uid_overridden(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -35,7 +35,7 @@ def test_build_uid_overridden(cli, tmpdir, datafiles):
assert result.exit_code == 0
@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubbelwrap')
@pytest.mark.datafiles(DATA_DIR)
def test_build_uid_in_project(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -55,6 +55,7 @@ def test_build_uid_in_project(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_build_uid_default(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......
......@@ -5,7 +5,7 @@ from buildstream import _yaml
from buildstream._exceptions import ErrorDomain
from tests.testutils import cli_integration as cli, create_artifact_share
from tests.testutils.site import IS_LINUX
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -18,6 +18,7 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_build_checkout_cached_fail(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_path = os.path.join(project, 'elements', 'element.bst')
......
......@@ -3,6 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -15,6 +16,7 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_cmake_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -33,6 +35,7 @@ def test_cmake_build(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_cmake_confroot_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -51,6 +54,7 @@ def test_cmake_confroot_build(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_cmake_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_name = 'cmake/cmakehello.bst'
......
......@@ -7,6 +7,7 @@ from buildstream import _yaml
from tests.testutils import cli_integration as cli
from tests.testutils.integration import walk_dir
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -82,6 +83,7 @@ def create_compose_element(name, path, config={}):
'/usr/share/doc', '/usr/share/doc/amhello',
'/usr/share/doc/amhello/README'])
])
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_compose_include(cli, tmpdir, datafiles, include_domains,
exclude_domains, expected):
project = os.path.join(datafiles.dirname, datafiles.basename)
......
......@@ -3,6 +3,7 @@ import pytest
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -18,6 +19,7 @@ DATA_DIR = os.path.join(
# makehello project for this.
@pytest.mark.integration
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_make_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -35,6 +37,7 @@ def test_make_build(cli, tmpdir, datafiles):
# Test running an executable built with make
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_make_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_name = 'make/makehello.bst'
......
......@@ -4,6 +4,7 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -31,6 +32,7 @@ def create_manual_element(name, path, config, variables, environment):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_manual_element(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -64,6 +66,7 @@ strip
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_manual_element_environment(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -93,6 +96,7 @@ def test_manual_element_environment(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_manual_element_noparallel(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......
......@@ -6,6 +6,7 @@ from buildstream import _yaml
from tests.testutils import cli_integration as cli
from tests.testutils.integration import assert_contains
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -18,6 +19,7 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_pip_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -54,6 +56,7 @@ def test_pip_build(cli, tmpdir, datafiles):
# Test running an executable built with pip
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_pip_run(cli, tmpdir, datafiles):
# Create and build our test element
test_pip_build(cli, tmpdir, datafiles)
......
......@@ -6,6 +6,7 @@ from buildstream import _yaml
from tests.testutils import cli_integration as cli
from tests.testutils.python_repo import setup_pypi_repo
from tests.testutils.integration import assert_contains
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -72,6 +73,7 @@ def test_pip_source_import(cli, tmpdir, datafiles, setup_pypi_repo):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_pip_source_build(cli, tmpdir, datafiles, setup_pypi_repo):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_path = os.path.join(project, 'elements')
......
......@@ -4,6 +4,7 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -30,6 +31,7 @@ def create_script_element(name, path, config={}, variables={}):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_script(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -57,6 +59,7 @@ def test_script(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_script_root(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -88,6 +91,7 @@ def test_script_root(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_script_no_root(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_path = os.path.join(project, 'elements')
......@@ -110,6 +114,7 @@ def test_script_no_root(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_script_cwd(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -140,6 +145,7 @@ def test_script_cwd(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_script_layout(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
......@@ -158,6 +164,7 @@ def test_script_layout(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_regression_cache_corruption(cli, tmpdir, datafiles):
project = str(datafiles)
checkout_original = os.path.join(cli.directory, 'checkout-original')
......@@ -187,6 +194,7 @@ def test_regression_cache_corruption(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_regression_tmpdir(cli, tmpdir, datafiles):
project = str(datafiles)
element_name = 'script/tmpdir.bst'
......@@ -196,6 +204,7 @@ def test_regression_tmpdir(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_regression_cache_corruption_2(cli, tmpdir, datafiles):
project = str(datafiles)
checkout_original = os.path.join(cli.directory, 'checkout-original')
......
......@@ -5,6 +5,7 @@ from buildstream import _yaml
from buildstream._exceptions import ErrorDomain
from tests.testutils import cli_integration as cli
from tests.testutils.site import HAVE_BWRAP, IS_LINUX
pytestmark = pytest.mark.integration
......@@ -48,6 +49,7 @@ def execute_shell(cli, project, command, *, config=None, mount=None, element='ba
# Test running something through a shell, allowing it to find the
# executable
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_shell(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -58,6 +60,7 @@ def test_shell(cli, tmpdir, datafiles):
# Test running an executable directly
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_executable(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
......@@ -69,6 +72,7 @@ def test_executable(cli, tmpdir, datafiles):
# Test shell environment variable explicit assignments
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_env_assign(cli, tmpdir, datafiles, animal):
project = os.path.join(datafiles.dirname, datafiles.basename)
expected = animal + '\n'
......@@ -88,6 +92,7 @@ def test_env_assign(cli, tmpdir, datafiles, animal):
# Test shell environment variable explicit assignments with host env var expansion
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal):
project = os.path.join(datafiles.dirname, datafiles.basename)
expected = 'The animal is: {}\n'.format(animal)
......@@ -110,6 +115,7 @@ def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal):
# when running an isolated shell
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_env_assign_isolated(cli, tmpdir, datafiles, animal):
project = os.path.join(datafiles.dirname, datafiles.basename)
result = execute_shell(cli, project, ['/bin/sh', '-c', 'echo ${ANIMAL}'], isolate=True, config={
......@@ -127,6 +133,7 @@ def test_env_assign_isolated(cli, tmpdir, datafiles, animal):
# Test running an executable in a runtime with no shell (i.e., no
# /bin/sh)
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_no_shell(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_path = os.path.join(project, 'elements')
......@@ -159,6 +166,7 @@ def test_no_shell(cli, tmpdir, datafiles):
# Test that bind mounts defined in project.conf work
@pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_host_files(cli, tmpdir, datafiles, path):
project = os.path.join(datafiles.dirname, datafiles.basename)
ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt')
......@@ -179,6 +187,7 @@ def test_host_files(cli, tmpdir, datafiles, path):
# Test that bind mounts defined in project.conf work
@pytest.mark.parametrize("path", [("/etc"), ("/usr/share/pony")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_host_files_expand_environ(cli, tmpdir, datafiles, path):
project = os.path.join(datafiles.dirname, datafiles.basename)
hostpath = os.path.join(project, 'files', 'shell-mount')
......@@ -224,6 +233,7 @@ def test_isolated_no_mount(cli, tmpdir, datafiles, path):
# declared as optional, and that there is no warning if it is optional
@pytest.mark.parametrize("optional", [("mandatory"), ("optional")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_host_files_missing(cli, tmpdir, datafiles, optional):
project = os.path.join(datafiles.dirname, datafiles.basename)
ponyfile = os.path.join(project, 'files', 'shell-mount', 'horsy.txt')
......@@ -259,6 +269,7 @@ def test_host_files_missing(cli, tmpdir, datafiles, optional):
# Test that bind mounts defined in project.conf work
@pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")])
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_cli_mount(cli, tmpdir, datafiles, path):
project = os.path.join(datafiles.dirname, datafiles.basename)
ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt')
......@@ -271,6 +282,7 @@ def test_cli_mount(cli, tmpdir, datafiles, path):
# Test that we can see the workspace files in a shell
@pytest.mark.integration
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_workspace_visible(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
workspace = os.path.join(cli.directory, 'workspace')
......@@ -304,6 +316,7 @@ def test_workspace_visible(cli, tmpdir, datafiles):
# Test that '--sysroot' works
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_sysroot(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
base_element = "base/base-alpine.bst"
......@@ -333,6 +346,7 @@ def test_sysroot(cli, tmpdir, datafiles):
# Test system integration commands can access devices in /dev
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_integration_devices(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
element_name = 'integration.bst'
......