summaryrefslogtreecommitdiff
path: root/tests/integration
Commit message (Collapse)AuthorAgeFilesLines
* tests/integration/shellbuildtrees.py: Use module scope fixtures and parametrizetristan/refactor-shell-builtree-testsTristan van Berkom2020-12-211-195/+263
| | | | | | | | | | | | | | | These tests were quite hard to follow what they were testing, and did not cover the error cases thoroughly either. Instead, use some test parametrization to implement more succinct tests which cover the API surface more thoroughly. Due to parametrization and discrete testing of various use cases, this was going to be very expensive, so this patch introduces some pytest module scope fixtures. This allows multiple discrete tests to be run against a prebuilt ArtifactShare with specific artifacts already built and available in the share, so that this discrete testing is quite optimized.
* _stream.py: Added missing machine readable error codesTristan van Berkom2020-12-212-10/+5
| | | | | | | | | | | | | | | | In errors pertaining to failing to launch a shell with a buildtree. Other related updates: - _frontend/cli.py: Propagate machine readable error codes in `bst shell` This command prefixes a reported error, so it rewraps the error into an AppError, this needs to propagate the originating machine readable error. - tests/integration/shell.py, tests/integration/shellbuildtrees.py: Updated to use new machine readable errors
* plugins/elements/stack.py: Require all dependencies be build & run.Tristan van Berkom2020-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stack elements cannot be build-only dependencies, as this would defeat the purpose of using stack elements in order to directly build-depend on them. Stack element dependencies must all be built in order to build depend on them, and as such we gain no build parallelism by allowing runtime-only dependencies on stack elements. Declaring a runtime-only dependency on a stack element as a whole might still be useful, but still requires the entire stack to be built at the time we need that stack. Instead, it is more useful to ensure that a stack element is a logical group of all dependencies, including runtime dependencies, such that we can guarantee cache key alignment with all stack dependencies. This allows for stronger reliability in commands such as `bst artifact checkout`, which can now reliably download and checkout a fully built stack as a result, without any uncertainty about possible runtime-only dependencies which might exist in the project where that artifact was created. This consequently closes #1075 This also fixes the following tests such that the no longer require build-depends or runtime-depends to work in stack elements: * tests/frontend/default_target.py: Was not necessary to check results of show, these stacks were set to runtime-depends so that they would have the same buildable state as their dependencies when shown. * tests/format/dependencies.py: tests/frontend/pull.py, test/frontend/show.py, tests/integration/compose.py: These tests were using specific build/runtime dependencies in stacks, but for no particular reason.
* tests/integration/artifact.py: Test preservation of environment variablestristan/refactor-artifact-elementsTristan van Berkom2020-12-074-0/+90
| | | | | | This new test tests that environment variables are preserved in generated artifacts, and that artifact data is observed rather than irrelevant local state when integrating an artifact checked out by it's artifact name.
* _frontend/cli.py: Drop support for bst shell --use-buildtree=tryJürg Billeter2020-10-272-80/+16
| | | | | `--use-buildtree` is now a boolean option for `bst shell`. If no buildtree is available, an error is raised.
* _stream.py: Simplify code in shell()Jürg Billeter2020-10-271-15/+7
| | | | | | Use single scheduler run for pulling dependencies and buildtree. Deduplicate cache checks and corresponding warning/error messages with and without pulling enabled.
* Move shell element loading logic from Cli to StreamJürg Billeter2020-10-271-3/+3
|
* _stream.py: Pull missing artifacts in push()juerg/pushJürg Billeter2020-09-291-2/+0
| | | | | | | | | | | As per #819, BuildStream should pull missing artifacts by default. The previous behavior was to only pull missing buildtrees. A top-level `--no-pull` option can easily be supported in the future. This change makes it possible to use a single scheduler session (with concurrent pull and push jobs). This commit also simplifies the code as it removes the `sched_error_action` emulation, using the regular frontend code path instead.
* tests/integration/filter.py: Add test_filter_pass_integration_uncachedJürg Billeter2020-09-241-0/+32
| | | | | This tests that built filter artifacts don't depend on build dependencies for integration.
* tests/integration/manual.py: Test staging files in custom directoriesTristan van Berkom2020-09-183-0/+37
|
* ScriptElement: Porting to new APITristan van Berkom2020-09-186-42/+18
| | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on Element.search(), use Element.configure_dependencies() to configure the layout. Summary of changes: * scriptelement.py: Change ScriptElement.layout_add() API to take an Element instead of an element name, this is now not optional (one cannot specify a `None` element). This is an API breaking change * plugins/elements/script.py: Implement Element.configure_dependencies() in order to call ScriptElement.layout_add(). This is a breaking YAML format change. * tests/integration: Script integration tests updated to use the new YAML format * tests/cachekey: Updated for `script` element changes
* tests/integration/interactive_build.py: make a new test for retrying failed ↵abderrahim/cached-failureAbderrahim Kitouni2020-07-291-1/+16
| | | | | | builds The old one tested that retrying the failed build doesn't actually retry
* Drop sandbox selection and BST_FORCE_SANDBOXJürg Billeter2020-06-031-5/+1
| | | | | | | buildbox-run is the only local sandbox and there are no plans to add other sandboxing backends in the future. New platforms can be supported by new buildbox-run implementations without requiring any changes in BuildStream.
* tests: Drop bwrap-specific testsJürg Billeter2020-06-036-102/+0
|
* tests/integration/cachedfail.py: Do not skip test with buildbox-runJürg Billeter2020-06-031-1/+1
|
* tests/integration/sandbox.py: Test variable expansion in sandbox configjuerg/expandsandboxJürg Billeter2020-05-283-0/+25
|
* buildelement: Ensure command-subdir is part of the cache keyChandan Singh2020-05-123-1/+54
| | | | | | | | | | `command-subdir` was previously missing from the cache key. This patch makes it a part of the cache key _if_ it was specified. It means that the cache key will not change for elements that had not defined a `command-subdir`. However, it will change for every element that did define it. Fixes #1295.
* tests/integration/manual.py: Fix assertion for CLI invocationchandan/fix-manual-testChandan Singh2020-05-111-3/+3
| | | | | | | The result of `bst artifact checkout` invocation was not correctly assigned to the result object in a few places. Hence the assertion on the next line was really testing the same thing as the previous assertion, i.e. the result of `bst build`.
* Update all packages requirementsBenjamin Schubert2020-05-111-1/+1
| | | | Also fix linting errors coming with new version of pylint
* pip.py: Remove the pip element, it is in experimentalBenjamin Schubert2020-05-111-117/+0
| | | | | The pip element was copied already to bst-plugins-experimental. We don't need to have two copies of it.
* _stream.py: Fetch sources while launching build shellschandan/build-shell-fetchChandan Singh2020-04-301-3/+37
| | | | | | | Part of https://gitlab.com/BuildStream/buildstream/-/issues/1068. Make behavior of `shell` command similar to other commands that need sources like `build`, `workspace open`, `source checkout` etc.
* Remove bst shell --sysrootJürg Billeter2020-04-251-42/+0
| | | | This is no longer needed now that we support caching buildtrees in CAS.
* Replace format-version with min-versionTristan Van Berkom2020-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "min-version" is specified as a <major>.<minor> point version and uses the installed BuildStream version instead of having a separate versioning number for the format. * The presence of "format-version" is now used to indicate that we might be loading a BuildStream 1 project. * For now, where parsing the version at startup is concerned, and also where `bst init` is concerned, we artificially bump the detected BuildStream version to 2.0 if we detect a version < 2.0, these exceptions can be removed once 2.0 is tagged and released. Summary of changes: _project.py: Now parse "min-version" and detect "format-version" to warn about loading a BuildStream 1 project _versions.py: Remove obsolete BST_FORMAT_VERSION numbers from here data/projectconfig.yaml: Remove old "format-version" from defaults utils.py: Added new private _parse_version() helper function, and another _get_bst_api_version() to get an adjusted API version. frontend/app.py, frontend/cli.py: Updated `bst init` implementation testing (buildstream.testing): Updated testing utilities to generate and use projects with min-version instead of format-version. tests and examples: Updated to use min-version across the board.
* tests: Stop using tmpdir_factory.mkdtemp("")bschubert/fix-mktemp-usageBenjamin Schubert2020-04-231-1/+1
| | | | | Using "" as a directory is invalid starting from pytest 5.4.0, let's use the __file__ name instead
* tests/integration/script.py: Drop read-only root xfail for buildbox-runJürg Billeter2020-04-041-4/+0
| | | | buildbox-fuse now supports SubtreeReadOnly.
* tests/integration/build-uid.py: Don't skip tests with buildbox-runJürg Billeter2020-04-041-4/+16
| | | | buildbox-run-bubblewrap now supports custom uid/gid.
* tests/integration/autotools.py: Check build logJürg Billeter2020-02-201-0/+8
|
* _project.py: fix the case where a simple string is passed to host-filesabderrahim/simple-host-filesAbderrahim Kitouni2020-02-171-4/+7
| | | | also add a test
* tests/integration/workspace.py: Test incremental build after failureJürg Billeter2020-02-114-0/+74
|
* tests/integration/workspace.py: Add incremental build testJürg Billeter2020-02-113-0/+84
| | | | Verify basic incremental build and proper mtime handling.
* tests/integration/workspace.py: Fix test_incremental_configure...Jürg Billeter2020-02-111-1/+5
| | | | | Add file to workspace directory to ensure second `bst build` is actually building the element.
* tests/integration/workspace.py: Fix test_workspace_commanddirJürg Billeter2020-02-111-3/+10
| | | | Object files are no longer stored in the workspace directory.
* tests: Avoid testing file times along with umaskDarius Makovsky2020-02-051-5/+4
| | | | | | Avoids testing for file times when testing for umask. These tests are known to be flaky and are overly specific in that they implicitly test more than just umask.
* tests/integration/shell.py: xfail updateJürg Billeter2020-02-031-3/+12
|
* tests/integration/interactive_build.py: Relax expect for buildbox-runjuerg/buildbox-run-testJürg Billeter2020-02-031-2/+1
| | | | | When commands are batched, the failure message can't include the command group label with buildbox-run.
* exceptions: Expose ErrorDomain, ErrorLoadReasonThomas Coldrick2020-01-237-7/+7
| | | | | | | Plugin tests are already accessing this API, but using imports from private modules. For motivation for this to be exposed publicly, note that ErrorDomain is an argument for most things in runcli.py, and LoadErrorReason may be another.
* _frontend/cli.py: Make show() --use-buildtree respect pull semanticsTom Pollard2020-01-211-7/+27
| | | | | | | Ensure that if a buildtree isn't cached locally, it's only fetched if --pull and pull-buildtrees config are set. Also, only attempt to fetch if it's plausible that it could be pulled, with appropriate messaging based on local cached state.
* tests/integration/project.conf: Remove unused external pluginschandan/remove-bst-experimental-unusedChandan Singh2020-01-151-6/+0
| | | | | There are no tests that rely on these plugins anymore, so remove the corresponding declarations from project.conf.
* Remove integration tests for moved pluginsThomas Coldrick2020-01-137-150/+0
|
* tests/integration/workspace.py: Relax assert for buildbox-runjuerg/batch-command-loggingJürg Billeter2020-01-131-2/+2
| | | | | When commands are batched, the failure message can't include the command group label with buildbox-run.
* _sandboxreapi.py: Improve batch command loggingJürg Billeter2020-01-132-3/+0
| | | | | | | | This adds a timed activity message to bring batch command logging for REAPI-based sandboxes in line with the default sandbox as far as possible. Thix fixes 3 xfails with buildbox-run.
* tests: Drop chroot xfail/skipifJürg Billeter2019-12-311-1/+0
|
* tests/integration/shell.py: xfail for buildbox-run-userchrootJürg Billeter2019-12-171-1/+5
| | | | buildbox-run-userchroot requires a shell.
* tests/integration/script.py: xfail for buildbox-run-userchrootJürg Billeter2019-12-171-2/+15
| | | | | | | | The root directory is not allowed to be writable by userchroot. + sh -c -e echo 'I can write to root' > /test sh: can't create /test: Permission denied
* tests/integration/filter.py: xfail for buildbox-run-userchrootJürg Billeter2019-12-171-1/+5
| | | | | | | The root directory is not allowed to be writable by userchroot. + sh -e -c touch /foo touch: /foo: Permission denied
* tests/integration/compose.py: xfail for buildbox-run-userchrootJürg Billeter2019-12-171-1/+5
| | | | | | | | The root directory is not allowed to be writable by userchroot. + sh -e -c mkdir -p /tests mkdir: can't create directory '/tests': Permission denied Command 'mkdir -p /tests' failed with exitcode 1
* tests: source_determinism.py: Skip flaky test with buildbox-runJürg Billeter2019-12-171-0/+4
| | | | | The tests are flaky due to non-deterministic timestamps in the output of `ls -l`. See https://gitlab.com/BuildStream/buildstream/issues/1218
* tests: Drop buildbox xfailsJürg Billeter2019-12-108-13/+5
|
* tests/integration/interactive_build.py: Increase timeoutJürg Billeter2019-12-101-1/+1
|
* tests/integration/workspace.py: xfail logging for buildbox-runJürg Billeter2019-12-101-0/+1
| | | | Individual commands are not logged with command batching.