summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* setup.cfg: Use isort to sort our importsbschubert/isortBenjamin Schubert2020-07-03140-230/+278
|
* tests/frontend/push.py: Add test_push_update_after_rebuildJürg Billeter2020-06-301-0/+40
| | | | | This is a regression test to skip push only if server has identical artifact.
* tests/format/junctions.py: Adding tests for internal junctionsTristan van Berkom2020-06-2482-0/+356
|
* tests/format/junctions.py: Adding tests for duplicate junctionsTristan van Berkom2020-06-24180-7/+761
|
* tests/format/junctions.py: Adding tests for the overrides featureTristan van Berkom2020-06-2399-6/+565
| | | | | | | | | | | | | * Test various scenarios of overriding junctions, including deep paths as junctions to override, and as junctions to use to override. * Test conflicting junction configurations, ensuring that we report both provenances of where the junctions were declared. * Test circular references in element paths while declaring overrides, for instance when trying to override a subproject using a deeper definition of the same subproject.
* tests/frontend: Renaming some projects to avoid new conflictsTristan van Berkom2020-06-192-2/+2
|
* tests/format/junctions.py: Major refactorTristan van Berkom2020-06-1995-454/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors the junctions test to use more parameterization and to remove copy_subproject(), using statically committed data as much as possible. This is because copy_subproject() causes data to be shared among tests in such a way that when such data get's modified, it easily causes unintended side effects on adjacent test cases, better to keep this data separate. Overview of changes: * Remove copy_subproject() * Split up test data into case specific directories, sometimes reusing a directory among various related tests * Use @pytest.mark.parameterize() as much as possible for better coverage and more clearly expressed test cases * Adds update_project() to modify a project.conf inline, as is done in some other tests like tests/plugins/loading.py * Removes tests related to junction name coalescing, this feature will be removed later in this branch and other tests related to junction overrides will replace these. * Removes some redundant tests * Removes a comment about how junction name coalescing can cause errors when trying to open a junction but the project.conf is missing. We continue to test missing project.conf files in a variety of scenarios, but the comment will be rendered irrelevant with the removal of junction name coalescing. * Change the git related tests to use tar instead, this serves the same purpose, but tar will remain a core plugin in BuildStream 2.
* conftest.py: Ensure the `basetemp` is a resolved pathbschubert/cleanupsBenjamin Schubert2020-06-171-1/+1
| | | | | Otherwise some of BuildStream's config will fail and it is therefore impossible to just run `pytest tests/`
* _loader: Adding LoadContexttristan/load-contextTristan van Berkom2020-06-161-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing around many details though calling signatures throughout the loader code, create a single LoadContext object which holds any overall loading state along with any values which are constant to a full load process. Overall this patch does: * _frontend/app.py: No need to pass Stream.fetch_subprojects() along anymore * _loader/loadelement.pyx: collect_element_no_deps() no longer takes a task argument * _loader/loader.py: Now the Loader has a `load_context` member, and no more `_fetch_subprojects` member or `_context` members Further, `rewritable` and `ticker` is no longer passed along through all of the recursing calling signatures, and `ticker` itself is finally removed because this has been replaced a long time ago with `Task` API from `State`. * _pipeline.py: The load() function no longer has a `rewritable` parameter * _project.py: The Project() is responsible for creating the toplevel LoadContext() if one doesn't exist yet, and this is passed through to the Loader() (and also passed to the Project() constructor by the Loader() when instantiating subprojects). * _stream.py: The `Stream._fetch_subprojects()` is now private and set on the project when giving the Project to the Stream in `Stream.set_project()`, also the Stream() sets the `rewritable` state on the `LoadContext` at the earliest opportunity, as the `Stream()` is the one who decides this detail. Further, some double underscore private functions are now regular single underscores, there was no reason for this inconsistency. * tests/internals/loader.py: Updated for API change
* Completely abolish job pickling.tristan/nuke-pickle-jobberTristan van Berkom2020-06-151-14/+0
|
* tests/frontend/workspace.py: Removing testsTristan van Berkom2020-06-111-30/+0
| | | | | | Remove tests which check for a user message to be issued upon closing a workspace who's metadata was used to launch BuildStream and find the BuildStream project directory.
* cascache.py: Fix file modes in checkout()Jürg Billeter2020-06-102-8/+15
| | | | | Do not copy file mode from casd object file. Do not change non-executable mode bits if file is executable.
* _includes.py: Propagate provenance through Loader.get_loader()Tristan van Berkom2020-06-101-2/+2
| | | | | | | | | | | Instead of raising a customized error message which adds little value to the provenance, just pass the provenance along. This is important so that the Loader is aware of the provenance of loaded junctions, so that it can more precisely report errors about conflicting junctions when includes cause conflicts. This commit also adjusts tests/format/includes.py
* tests/format/include.py: Test including of files using full pathsTristan van Berkom2020-06-0811-0/+54
|
* tests/format/link.py: Testing full path link targetsTristan van Berkom2020-06-085-1/+23
| | | | | | | | * Test that we succeed to load links with full path targets * Test that we get correct provenance information in errors when linking to non-existing elements in existing subprojects, using full paths.
* tests/plugins/loading.py: Testing junction plugins with full pathsTristan van Berkom2020-06-081-1/+109
| | | | | | | | | | Added tests to cover: * Successfully loading plugins with full paths in junction origins * Failing to load missing plugins in sub-junctions which are successfully loaded * Failing to load missing plugins in sub-junctions which are invalid and couldnt load
* tests/format/junctions.py: Test loading dependencies and targets with full pathsTristan van Berkom2020-06-085-0/+66
|
* Drop sandbox selection and BST_FORCE_SANDBOXJürg Billeter2020-06-033-37/+3
| | | | | | | 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
|
* Optimize variable flatteningValentin David2020-06-032-0/+14
| | | | | | | | | | | | | | | | | Verifying for variables (all used variables defined and no cycle) is much faster than flattening them. It also uses much less memory. Only `bst show -f "%{vars}"` requires to flatten all variables. For other cases we can improve performance by only checking rather than flattening. Also flattening very nested variables could lead to very long lists of empty strings. The memory usage for flattening could be a lot bigger than the resulting value. Force flattening and caching every variable definitions can improve intermediate memory consumption and only consume memory of the size of the result. Finally, an optimization allowed inifinite cycles leading to segmentation fault. This was solved by simplifying the code.
* junctions: Remove all traces of the `target` optionTristan van Berkom2020-06-0113-106/+0
| | | | | | | | | | | | | | | This removes: * The `target` feature from the junction plugin * Special case code in the loader for the `target` feature * The `target` related cases in tests/format/junctions.py This also adjusts the `target` related documentation in the `junction` element to suggest using a `link` element for the purpose of using a subproject junction configuration to access a common sub-subproject.
* tests/format/link.py: Adding tests for the link elementTristan van Berkom2020-06-0160-0/+407
|
* loader: removing the NO_PROGRESS objecttristan/remove-loader-no-progress-objectTristan van Berkom2020-05-301-8/+7
| | | | | | | | | | | While adding a mock task object to track progress in some loader tests in commit 17144d84c2b63daf6e3aa9b42c6c773f134e8660, a new `_NO_PROGRESS` object was added as an explicit marker to denote that progress information should not be reported. This complicates the code, None should be a sufficient value for not reporting progress, while still permitting mock task objects to capture progress if desired.
* tests/internals/context.py: Test correct config file is chosen.Tristan van Berkom2020-05-291-0/+28
|
* element.py: Always expand public data's variablesBenjamin Schubert2020-05-294-0/+46
| | | | | | | | | | | | | | | | | This fixes a bug introduced by d7d18c1a2e454c507afd9e1d3f1358639dd43871, where public data integration commands and others would never get their data expanded and would thus fail to run. The previous however revelead a previous bug, where variables values in public data of elements would not be part of the cache key of an element or it's reverse dependencies, and thus, on variable change, rebuilds would not happen when they would have been needed. This ensures that all the public data is always resolved and part of the element's cache key. This however will bring a rebuild of an element whenever its integration commands variables change, which is simpler to handle than to try to push that responsibility on reverse dependencies, since public data can contain plugin-defined values.
* tests/integration/sandbox.py: Test variable expansion in sandbox configjuerg/expandsandboxJürg Billeter2020-05-283-0/+25
|
* tests/plugins/loading.py: Adding tests for junction plugin originTristan van Berkom2020-05-285-0/+193
|
* tests/frontend/pull.py: Add test for dynamic build planJürg Billeter2020-05-271-0/+47
| | | | Make sure build-only dependencies are pulled only when necessary.
* Update node property support to match proto changesJürg Billeter2020-05-272-4/+4
|
* node.pyx: Deep clone ScalarNode toobschubert/ensure-composite-works-with-variablesBenjamin Schubert2020-05-195-0/+38
| | | | | This ensures that when resolving variables, we do not overwrite the values for a different element in the case we were using composition.
* _frontend/profile: Use non-greedy search to substitute variablesChandan Singh2020-05-181-0/+20
| | | | | | | | Use non-greedy search to ensure that we stop at the next closing brace. Otherwise, for a string like `%{variable} {variable}`, the second variable will also get substituted. Fixes #1307.
* Ensure there are no duplicates in Elements.dependencies()Chandan Singh2020-05-182-4/+21
| | | | | | | | | | | | | | When we are not recursing, `Element.dependencies()` uses a much more light weight codepath since it just needs to print the direct dependencies. However, this simple codepath was not accounting for duplicates, in case something is both a build time and run time dependency. One way this manifested itself was in `bst show --format %{deps}`, but it would also affect anything that was using this method to iterate on the dependencies. Fixes #1308.
* _frontend/cli: Support "build" and "run" values for `artifact push --deps`Chandan Singh2020-05-131-12/+23
|
* _frontend/cli: Support "build" and "run" values for `artifact pull --deps`Chandan Singh2020-05-131-8/+20
|
* _frontend/cli: Support "build" and "run" values for `source fetch --deps`Chandan Singh2020-05-137-0/+68
|
* _frontend/cli: Support "build" value for `bst build --deps`Chandan Singh2020-05-131-0/+16
| | | | | | This can be quite handy when one is preparing to open a build shell. This originally came up in https://gitlab.com/BuildStream/buildstream/-/issues/685#note_105460896.
* tests/plugins/loading.py: Added tests for various malformed BST_MIN_VERSIONTristan Van Berkom2020-05-139-3/+70
|
* source.py: Allow access to element's variableBenjamin Schubert2020-05-125-0/+54
| | | | | This automatically expands the variables from the element into the sources config
* 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.
* testing.py: Add a new `check_cache_key_stability` helperbschubert/cache-key-helperBenjamin Schubert2020-05-122-178/+5
| | | | | This allows plugin authors to implement cache keys tests more easily
* 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-114-6/+4
| | | | Also fix linting errors coming with new version of pylint
* lint: Stop using mutable objects for default argumentsBenjamin Schubert2020-05-111-1/+1
|
* 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.
* tests/plugins/loading.py: Test failure modes when loading pip pluginsTristan Van Berkom2020-05-041-0/+79
|
* tests/plugins/loading.py: Added test for loading pip pluingsTristan Van Berkom2020-05-041-0/+46
| | | | | | | This test is automatically skipped when the required package is not installed, which can happen when running pytest directly, which is supported in order to help distribution maintainers test whether BuildStream works properly on their distribution.
* tests/plugins/pip-samples/sample-plugins: Adding a sample pip plugins packageTristan Van Berkom2020-05-047-0/+92
| | | | | | | | | | This commit: * Adds a bare bones BuildStream pip plugin package structure at tests/plugins/pip-samples/sample-plugins * setup.cfg: Adds tests/plugins/pip-samples to the norecursedirs so that we don't consider the dummy plugins as test code
* plugin.py: Rework how deprecation warnings are configured.Tristan Van Berkom2020-05-048-88/+128
| | | | | | | | | | | | | | | | | This is mostly a semantic change which defines how deprecation warnings are suppressed in a more consistent fashion, by declaring such suppressions in the plugin origin declarations rather than on the generic element/source configuration overrides section. Other side effects of this commit are that the warnings have been enhanced to include the provenance of whence the deprecated plugins have been used in the project, and that the custom deprecation message is optional and will appear in the message detail string rather than in the primary warning text, which now simply indicates that the plugin being used is deprecated. Documentation and test cases are updated. This fixes #1291
* tests/plugins/loading.py: Migrate tests for found/not found pluginsTristan Van Berkom2020-05-0313-51/+67
| | | | This new test replaces the test in tests/format/project.py.