summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests/format/variables.py: Increase timeoutTristan van Berkom2020-08-031-1/+1
| | | | | | | With sometimes very slow runners, this test has been found to timeout more often after the recent refactoring. Double the timeout to avoid erronously failing CI.
* 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
* tests/format/include.py: Test preservation of conditionals at include timetristan/options-orderTristan van Berkom2020-07-2926-0/+179
| | | | | | Added tests to ensure that conditional statements don't get overwritten when performing composition of one dictionary on top of another due to include processing.
* tests/format/variables.py: Adding new test for lazy variable resolutiontristan/partial-variablesTristan van Berkom2020-07-226-0/+30
| | | | | | Check that lazy variable resolution allows using variables in junction definitions which would not successfully resolve if we needed to resolve synchronously.
* tests/frontend/overlaps.py: Test undefined variablesTristan van Berkom2020-07-222-1/+27
| | | | | Ensure that we get the expected provenance when expanding a variable included in an overlap whitelist entry.
* tests/format/variables.py: Added some new testsTristan van Berkom2020-07-225-12/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Test scenarios where a junction needs to resolve variables in order to configure a subproject, but where some other variables may be derived from the same subproject. In this scenario we allow partial resolution of variables for junction elements. * Enhanced the undefined variables and circular reference tests to also check for the expected provenances. * Test for deep variable resolution Test variable indirection with 50, 500 and 5000 variables: * 50 - tests generally large indirections in the recursive algorithm, which is limited to 200 recursions * 500 - tests that the non-recursive algorithm works for successful outcomes and not only for error resolution * 5000 - tests that the iterative algorithm works and ensures it is not discarded, as a recursive algorithm cannot be implemented to support this depth with python (which limits itself to merely 1000 stack frames).
* _variables.pyx: Rewrite Variables code.Tristan van Berkom2020-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main enhancements here include: * Support for deeply nested variable declarations, removing the limitations of the recursive variable resolution algorithm. We were unable to achieve equal performance with the iterative resolution algorithm, so we now have the recursive approach as the fast path and only support 200 recursions with this approach before falling back on the iterative code path, which will support deep variable resolution and take care of error reporting. * Better error reporting for undefined variables. Variables.subst() now requires a ScalarNode and not a simple `str`, making it more difficult for the core to substitute an undefined variable without providing the provenance of where that value expression was declared. Code changes: * _variables.pyx: Complete rewrite * exceptions.py: Added new LoadErrorReason.CIRCULAR_REFERENCE_VARIABLE * element.py: Pass ScalarNode to Variable.subst() when substituting overlap whitelists.
* loader.py: use the full name of the element when looking up a workspaceAbderrahim Kitouni2020-07-161-2/+5
| | | | | This fixes a bug where buildstream would ignore the opened workspace on a cross-junction element.
* tests/format/link.py: Added test for including files across linked junction ↵tristan/fix-juncle-include-linkTristan van Berkom2020-07-1515-0/+62
| | | | boundaries
* tests/frontend/remote-caches.py: Split test_source_artifact_cachesjuerg/source-pushJürg Billeter2020-07-061-4/+26
| | | | | Use `bst source push` in a new test instead of manually deleting parts of a remote cache.
* tests/sourcecache/fetch.py: Use `bst source push` to replace hackJürg Billeter2020-07-061-12/+20
|
* Add `bst source push` commandJürg Billeter2020-07-061-0/+1
|
* tests/testutils/artifactshare.py: Fix sourcedirJürg Billeter2020-07-061-1/+1
|
* 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
|