summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* bst-init: Ensure --element-path is respected by the commandchandan/fix-bst-init-element-path288-kill-element-normal_name-variableChandan Singh2018-05-111-0/+3
| | | | | | | | | | | Previously "elements" was hard-coded as the path for the elements directory whereas it was supposed to be configurable via the `element_path` option to `init_project()`. This led to incorrect behavior when `bst init` was run `--element-path` option. Also, extend tests to test the creation of elements directory. Fixes #398.
* _stream.py: Do not force `PipelineSelection.ALL` for build with trackingJürg Billeter2018-05-111-1/+1
| | | | | | With the dynamic plan using `_set_required()` we can avoid pulling/fetching/building unneeded elements even if elements are being tracked.
* tests: Do not rely on 'downloadable' statusJürg Billeter2018-05-114-21/+25
| | | | This is in preparation for moving away from summary files.
* _stream.py, _pipeline.py: Refactoring of the pipeline itselfTristan Van Berkom2018-05-082-66/+36
| | | | | | | | | | | | | | | | | | | Here the pipeline becomes essentially stateless, some dangling state remains to be factored out because of frontend accesses which will be changed in a later commit. Essentially, the Pipeline.load() method no longer has any knowledge of the specific purposes of the loaded targets, and now takes a list of target groups and returns a corresponding list of element groups. The Stream() business logic methods now use other pipeline helper methods to create and filter lists from the loaded target elements. The Stream() also finally absorbs the Scheduler frontend facing APIs. However Queues are still exposed on the Stream object for logging purposes and through callbacks such that the frontend can retry elements.
* _artifactcache: Added ArtifactCache.setup_remotes()Tristan Van Berkom2018-05-081-2/+3
| | | | | | | This removes some additional initialization code from Pipeline(). Some symbols have changed here, the initialization is now called from Stream(), and a test case was also adjusted for this.
* _stream.py, _frontend: Call Stream() APIs with CLI arguments directly.Tristan Van Berkom2018-05-081-1/+1
| | | | | | This shifts the whole responsibility of interpreting command line targets etc to the Stream() object itself. With this commit, the Pipeline() truly becomes slaved to the Stream().
* _stream.py: Add StreamError exceptionTristan Van Berkom2018-05-0812-20/+20
| | | | Use Stream error for Stream errors.
* tests/format/variables.py: Removed testing of stderrTristan Van Berkom2018-05-081-4/+0
| | | | | | We have machine readable errors for this purpose, and the strings happen to change causing tests to break if we test the specific UI (reported error strings are UI).
* tests/format/variables.py: Add a test for undefined variable error messageValentin David2018-05-063-0/+24
|
* tests/testutils/runcli.py: Improve detection of pulled/pushed elementsJürg Billeter2018-04-301-2/+2
|
* _loader.py: Removing special case error for junctions depending on elementsTristan Van Berkom2018-04-261-3/+3
| | | | | | Leave this error to be handled by preflight. Updated test case to expect the new ElementError instead of a LoadError
* Use versioneer instead of setuptools_scmTristan Van Berkom2018-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using setuptools_scm had a couple of bad problems: o Unexpected versioning semantics, setuptools_scm would increment the micro version by itself in the case that we derive a version number from something that is not a tag, making the assumption that we are "leading up to" the next micro version. People mostly dont expect this. o When installing in developer mode, i.e. with `pip3 install --user -e .`, then we were always picking the generated version at install time and never again dynamically resolving it. Many of our users install this way and update through git, so it's important that we report more precise versions all the time. This commit needs to make a series of changes at the same time: o Adds versioneer.py to the toplevel, this is used by setup.py for various activities. This is modified only to inform the linter to skip o Adds buildstream/_version.py, which is generated by versioneer and gives us the machinery to automatically derive the correct version This is modified only to inform the linter to skip o Adds a .gitattributes file which informs git to substitute the buildstream/_version.py file, this is just to ensure that the versioning output would work if ever we used `git archive` to release a tarball. o Modifies setup.py and setup.cfg for versioneer o Modifies utils.py and _frontend/cli.py such as to avoid importing the derived version when running bash completion mode, we dont derive the version at completion time because this can result in running a subprocess (when running in developer install mode) and is an undesirable overhead. o Updates tests/frontend/version.py to expect changed version output
* Load and save junctioned source refs from/to junction.refsTristan Van Berkom2018-04-253-3/+3
| | | | | | | | | | | | o _projectrefs.py: Additional constructor option to choose the base name o _project.py: Load two ProjectRefs objects, one for the junctions o source.py: Load and save junctioned source refs with the appropriate ProjectRefs object o tests: Updated some tests to expect junctions to be stored in junction.refs This fixes issue #361
* tests/testutils/integration.py: Avoid inconsistent symlink handlingSam Thursfield2018-04-231-0/+5
| | | | | | | | The output of walk_dir() seemed to be inconsistent in how it traversed symlinks. Presumably this is to do with differences in how the filesystem return files. If we do an in-place sort of the list of files and directories that we get, os.walk() will honour that order which should make the output stable.
* Add compose-symlinks testcaseSam Thursfield2018-04-236-0/+66
| | | | | This is a regression test for the issue raised here: https://gitlab.com/BuildStream/buildstream/issues/270
* tests/pipeline/preflight-error: Fixing typo in error string formattingTristan Van Berkom2018-04-231-1/+1
|
* tests/frontend/track.py: Added test for `bst track --deps none`Tristan Van Berkom2018-04-191-0/+40
| | | | This guards against regressions of issue #367
* _loader package: Creating a new sub package to hold the loader related things.Tristan Van Berkom2018-04-172-4/+2
|
* _frontend/cli.py: Add option to reset multiple workspacesChandan Singh2018-04-171-0/+52
| | | | | | !357 added support for closing multiple workspaces. Similarly, also allow `bst workspace reset` to work on multiple workspaces, with `--all` as a helper to reset all open workspaces.
* tests/frontend/workspace.py: Added tests for force opening workspacestristan/fix-workspace-force-openTristan Van Berkom2018-04-171-0/+21
| | | | Guard against regressions of issue #364
* tests/frontend/buildcheckout.py: Added regression tests for workspaced junctionsTristan Van Berkom2018-04-161-0/+109
| | | | This guards against regressions of issue #292
* source.py, element.py, _pipeline.py: Streamling preflighting.Tristan Van Berkom2018-04-164-8/+8
| | | | | | | | | | | Instead of having the pipeline preflight all sources separately from elements, have the element preflight it's sources. This is in order to simplify the shared code path for the pipeline and the loader to use for instantiating elements. Also updated tests to expect the new ElementError and SourceError instead of the PipelineError which was raised for preflighting before.
* _frontend/app.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-151-5/+5
| | | | This is a part of issue #285
* plugins/elements/cmake.yaml: allow using ninja instead of make (#279)abderrahim/cmake-ninjaAbderrahim Kitouni2018-04-142-2/+3
| | | | | | | This uses the build tool mode of cmake to have a single command that can call either make or ninja. I've also modified the tests to take the new commands into account
* tests/format/variables.py: Ported from old style testsTristan Van Berkom2018-04-1416-79/+64
|
* tests/frontend/show.py: Removing some unused variablesTristan Van Berkom2018-04-141-2/+0
|
* tests/frontend/workspace.py: Test new workspace format versionTristan Maat2018-04-131-0/+24
|
* tests/frontend/workspace.py: Automatically update versionTristan Maat2018-04-131-5/+6
|
* integration/workspace.py: Test that configure commands run only onceTristan Maat2018-04-132-0/+55
|
* tests: Check that output includes log files of failed buildsRichard Maw2018-04-121-0/+28
|
* _frontend/cli.py, _pipeline.py: Add options for cross junction tracking.Tristan Van Berkom2018-04-122-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes cross junction tracking disabled by default, which was the initial intention when landing project.refs but never got around to doing this (intended to get addressing of junctioned elements via command line sorted first, but didnt happen). This adds the following options to enable cross-junction tracking: o bst build -J / --track-cross-junctions o bst fetch -J / --track-cross-junctions o bst track -J / --cross-junctions This also fixes `bst fetch --track` which had a bug, it was avoiding to track and fetch elements which are in a `cached` consistency state, which is wrong when `--track` is specified. This also updates some test cases which were broken by this change. This fixes issue #354
* buildstream/_versions.py: Increment BST_CORE_ARTIFACT_VERSIONTristan Van Berkom2018-04-1125-25/+25
| | | | | Now that we've restructured the artifact metadata into separate files, we need to rev the artifact version.
* element.py, source.py: Cleanup how Source cache keys are calculated.Tristan Van Berkom2018-04-1125-25/+25
| | | | | | | | Recently after a refactor we kept the Source adding workspace keys to the source keys because, now clean this up to have the workspace key added directly in the Element cache key calculation. This breaks cache keys.
* tests/integration/shell.py: Test that workspaced files are visible in a bst ↵Tristan Van Berkom2018-04-112-0/+91
| | | | | | | | | | shell Test both in regular `bst shell --build`, and on a failed build sysroot with `bst shell --sysroot`, the latter being the semantic used when debugging a failed build. This guards against regressions of issue #346
* tests/frontend/workspace.py: Test that we detect modifications made to a ↵352-race-condition-incorrect-saving-of-running-files-in-workspaces-yml-local-state-file311-opening-a-workspace-with-a-cached-buildTristan Van Berkom2018-04-091-0/+77
| | | | | | | workspace This was previously only working for added or removed files and broken for modified files.
* tests/frontend/workspace.py: Fixed test_build to make the right assertionTristan Van Berkom2018-04-091-1/+1
| | | | | | This was removing a file from the workspace, building, checking out, and then asserting that the file is *still gone* in the workspace, ignoring the same file in the checkout.
* More specific exceptions when a project.conf is missing.Tristan Van Berkom2018-04-081-1/+1
| | | | | Since we want to react and start an interactive session when the project.conf is missing, we need a more specific error to catch.
* tests/frontend/init.py: New test to test edge cases for new `bst init` command.Tristan Van Berkom2018-04-081-0/+97
|
* _frontend/cli.py, _frontend/app.py: Implemented new `bst init` command.Tristan Van Berkom2018-04-081-0/+1
| | | | | | | This comes with an interactive mode unless the project name is specified on the command line. This fixes issue #342
* _frontend/cli.py: Add option to close multiple workspacesChandan Singh2018-04-071-3/+43
| | | | | | | | | | | | | At present, it is only possible to close workspaces for elements one at a time. This can become slightly tedious process when you have multiple workspaces open and you want to close all of them, maybe because you just finished working on a set of related elements. Instead of accepting a single element, accept a list of elements as argument for `bst workspace close`. Additionally, add `-a`/`--all` option to close all workspaces. Fixes #337 - Add option to close all workspaces.
* tests/format/options.py: Added tests for invalid variable names in optionsTristan Van Berkom2018-04-065-0/+31
|
* tests/format/options.py: Added tests for invalid option name symbolsTristan Van Berkom2018-04-069-0/+45
|
* tests/format/project.py: Added tests for loading of invalid project namesTristan Van Berkom2018-04-063-0/+22
|
* tests/project/plugins.py: Removed this old style testTristan Van Berkom2018-04-068-119/+0
| | | | This is sufficiently covered by other tests in tests/format/project.py
* tests/format/project.py: Converted to use CLI test harnessTristan Van Berkom2018-04-0610-89/+51
| | | | | | Moved the old style project format tests into the new CLI based directory in tests/format/ and converted to use the CLI fixture for these tests.
* tests/frontend/buildcheckout.py: Added junction related testsTristan Van Berkom2018-04-051-1/+90
| | | | | | | | | | o Test that we get the expected error if the junction element the pipeline refers to is inconsistent o Test that the junction element is automatically fetched as a part of the build phase Both tests using both ref-storage modes
* tests/frontend/track.py: Added junction related testsTristan Van Berkom2018-04-051-2/+76
| | | | | | | | | | | o Test that we bail out with the expected errors when the junction element in question is Consistency.INCONSISTENT o Test that tracking the junction itself, causes a subsequent show of the pipeline to not bail out anymore (tests that tracking works and persists for a junction element). Again these use both ref-storage modes.
* tests/frontend/fetch.py: Added tests for automatically fetching the junctionsTristan Van Berkom2018-04-051-1/+87
| | | | | | | | | | o This tests that a Consistency.RESOLVED junction will automatically be fetched when `bst fetch` is run on a pipeline which refers to a junction. o Further, it tests that a Consistency.INCONSISTENT junction will bail out with the expected error message Again testing with both ref-storage modes
* tests/frontend/show.py: Test behaviors of showing junctioned elementsTristan Van Berkom2018-04-055-1/+135
| | | | | | | | | | o Test error conditions for showing an unfetched junctioned project o Test error conditions for showing an untracked junctioned project Both tests check both modes of ref-storage. This adds a new shared helper function `generate_junction`
* tests/frontend: Share the configure_project() functionTristan Van Berkom2018-04-053-12/+13
| | | | Make buildtrack.py and track.py share the same configure_project() helper.