summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests/artifactcache/expiry.py: Test that expiry happens firsttristan/cache-managementTristan Van Berkom2019-01-241-0/+64
|
* _frontend/widget.py: Render core messages more like other messagesTristan Van Berkom2019-01-241-2/+2
| | | | | | | | | | | | | | In order to test when core activities occur by parsing the stderr in tests, we should make the messages conform more. At the same time, this restores alignment of columns in core messages with the element processing related messages. Also, _scheduler/scheduler.py is updated to make it's activity names conform to the (current) 5 character limit for the sake of alignment. The tests/frontend/logging.py test gets it's regexes updated for the log lines it checks for in stderr.
* tests/frontend/buildcheckout.py: Add default target test with junctionJürg Billeter2019-01-244-0/+56
| | | | | Test that `bst build` does not fail in a project where the list of default targets includes a junction (junctions cannot be built).
* tests/frontend/pull.py: Add default target test for bst push/pullJürg Billeter2019-01-241-0/+50
|
* tests/frontend/fetch.py: Add default target test for bst source fetchJürg Billeter2019-01-241-0/+35
|
* tests/frontend: Add default target tests for bst show and buildPhillip Smyth2019-01-2419-0/+179
|
* tests: Test that fetching an open workspace will fetch its dependenciesJonathan Maw2019-01-241-21/+34
| | | | | Previously, there was no way of detecting whether fetching happened, as an element with an open workspace will not be fetched.
* Test that tracking in workspaces actually worksJonathan Maw2019-01-241-4/+12
| | | | | Previously, it merely tested that buildstream did not fall other, rather than whether it did anything useful.
* tests/frontend/track.py: test_track_error_cannot_write_file() fixupTristan Van Berkom2019-01-241-4/+3
| | | | | | | | | This tests how BuildStream reacts when it fails to write the tracking results to the element files or project.refs file, which is an operation that plugins do not play a part in. As such, removing the per repo kind parameterization from this test as multiple runs are redundant here.
* tests/frontend/workspace.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-12/+16
|
* tests/frontend/track.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-8/+12
|
* tests/frontend/push.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-6/+9
|
* tests/frontend/pull.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-4/+4
|
* tests/sources/remote.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-6/+13
|
* tests/elements/filter.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-4/+6
|
* tests/artifactcache/expiry.py: Refactored to use get_element_states()Tristan Van Berkom2019-01-241-23/+30
|
* tests/testutils/runcli.py: Make get_element_states() take a list of targetsTristan Van Berkom2019-01-242-5/+4
| | | | | Instead of a single target, we can always provide a single target in a list.
* _artifactcache.py: Raise ArtifactError() when quota size exceeds disk space.tristan/insufficient-storage-errorTristan Van Berkom2019-01-232-16/+24
| | | | | | | | | | | | | | | | | | | | | | This is not an error related to loading data, like a parse error in the quota specification is, but a problem raised by the artifact cache - this allows us to assert more specific machine readable errors in test cases (instead of checking the string in stderr, which this patch also fixes). This also removes a typo from the error message in the said error. * tests/artifactcache/cache_size.py Updated test case to expect the artifact error, which consequently changes the test case to properly assert a machine readable error instead of asserting text in the stderr (which is the real, secret motivation behind this patch). * tests/artifactcache/expiry.py: Reworked test_invalid_cache_quota() Now expect the artifact error for the tests which check configurations which create caches too large to fit on the disk.
* tests: Migrated cache quota test into artifactcache/cache_size.pyTristan Van Berkom2019-01-232-34/+28
| | | | Instead of sitting mysteriously alone in internals/utils.py
* tests/integration/pullbuildtrees.py: Fix the non-integration case.Tristan Van Berkom2019-01-221-42/+42
| | | | | | | | | | This test has one test case which is marked as an integration test, and the other is not an integration test, but was using the integration cli. The integration cli does not work correctly if not run in integration mode. This was causing an error locally in conftest.py when trying to create a tmpdir inside a nonexisting integration cache directory.
* Mark 'old' checkout command as obsoleteJames Ennis2019-01-2236-120/+128
| | | | | | | | | | | This commit marks 'bst checkout' as a 'hidden' command. If used, the user will be prompted to use the new 'bst artifact checkout' command. All tests which used 'bst checkout' have been modified to use the new artifact sub-command. This partially solves #822.
* Move push and pull to the new artifact subcommand groupJames Ennis2019-01-2210-48/+50
| | | | | This commit also ensures that if we try to use the 'old' commands, BuildStream will fail and instruct the user to use the new command.
* tests/sources/git.py: Skip tests that assume too new a gitRichard Maw2019-01-212-1/+8
| | | | | | | | | | | | | | | | | test_track_invalid_submodule depends on being able to remove a submodule by `git rm $submoduledir`, but old versions of git don't update .gitmodules so BuildStream still thinks there's a submodule present. For expediency the test is skipped rather than changed to manually remove the entry from .gitmodules if git hasn't done it, since in the common case git is new enough to do that itself. test_git_describe expects --first-parent to find another tag, but `bst track` will gracefully degrade if the option doesn't work so a different history will be retained with old versions of git. It's of marginal benefit to add additional cruft to test for different output on old versions of git that won't persist forever.
* tests/frontend/workspace.py: Skip test_open_multi_unwritable when rootRichard Maw2019-01-211-0/+1
| | | | | | The test assumes that a directory with write permission removed isn't writable, this isn't the case if the process running the tests has CAP_DAC_OVERRIDE which is common when running as root.
* widget.py: Avoid "showing 0 lines" messages when there are no linesTristan Maat2019-01-181-0/+110
| | | | | | | | This happened when bst is invoked with --message-lines 0 or --error-lines 0, and was arguably a little too verbose (the user explicitly asked us not to show them any lines, after all). Fixes #779
* testutils/runcli.py: Allow removing artifacts from arbitrary dirsTristan Maat2019-01-181-1/+7
| | | | | `remove_artifact_from_cache` used a hard-coded path to remove artifacts, which wasn't sufficient for integration tests.
* tests/testutils/python_repo.py: Use subprocess to run sdistTristan Van Berkom2019-01-181-2/+4
| | | | | | | | | | | | | The current approach using setuptools.sandbox.run_setup() was causing a spurious (but highly frequent) failure where setuptools gets mixed up with it's manipulation of sys.modules and hits a RuntimeError as a dictionary changes size while being iterated over. For instance: https://gitlab.com/BuildStream/buildstream/-/jobs/147967307 Since this already happens in an isolated virtual environment created by tox, we should not need additional sandboxing here from setuptools, and launching this as a subprocess will be safer.
* tests/artifactcache/expiry.py: Test refs directory cleanupTristan Van Berkom2019-01-181-0/+14
| | | | | | Enhance the test which checks removal of the extract directories with an additional check that the ref directories are cleaned up when removing artifacts.
* tests/frontend/track.py: Use test_track_recurse() to stress test SourcesTristan Van Berkom2019-01-181-13/+47
| | | | | | | | This causes multiple source instances to interact with the same backing data store at the same time, increasing the likelyhood of triggering issues around concurrent access. This more reliably triggers issue #868
* testutils/runcli.py: Added cli.get_element_states()Tristan Van Berkom2019-01-181-0/+22
| | | | | | | | | With get_element_state(), you need to invoke BuildStream once for every element state you want to observe in a pipeline. The new get_element_states() reports a dictionary with the element state hashed by element name and is better to use if you have more than one element to observe the state of.
* sandbox/sandbox.py: Display failed commands in the detail stringtristan/error-message-regressionTristan Van Berkom2019-01-161-1/+1
| | | | | | | | | | | We should only display commands in detail strings, not in the message texts. This also updates tests/integration/sandbox-bwrap.py to expect the new message string which only contains the command exit status and not the whole command itself, this does not alter the validity of the text case which is checking that we can obtain the expected return value.
* tests: Migrate junctions test to tests/format/junctions.pyTristan Van Berkom2019-01-1664-0/+0
| | | | This is the directory for all things related to loading.
* tests: Migrate protected variable handling tests to tests/format/variables.pyTristan Van Berkom2019-01-164-102/+89
|
* tests: Removing tests/pipeline/load.pyTristan Van Berkom2019-01-163-26/+0
| | | | | | The remaining test simply loads a project with one element and asserts a value on it. This is already sufficiently tested in tests/format/project.py.
* tests: Renaming some tests in tests/format/project.pyTristan Van Berkom2019-01-161-5/+5
| | | | Remove some redundancy from the test lines.
* tests: Migrate preflight error handling check to tests/format/project.pyTristan Van Berkom2019-01-166-19/+7
| | | | | | This is where other load time related plugin error handling is checked, and is the last thing to remove in the `tests/pipeline` directory.
* tests: Migrate test for load_ref() unsupporting plugins into format/project.pyTristan Van Berkom2019-01-165-32/+32
| | | | | | | The tests/format/project.py test already has some tests about how we error gracefully for bad plugins and bad plugin configurations, lets put it there rather than tests/pipeline/load.py which we will remove.
* tests: Migrate dependency order/iteration testing to the format testsTristan Van Berkom2019-01-1630-107/+108
| | | | | | Created new `tests/format/iteration.py` which tests the order in which elements are iterated over in various scopes in a loaded data model.
* tests: Migrate dependencies test to tests/formatTristan Van Berkom2019-01-1625-292/+168
| | | | This used to be an internal test, converted this to use the `cli` fixture.
* tests: Migrate internal Loader basic test to internals directoryTristan Van Berkom2019-01-167-2/+15
|
* tests: Rename `plugins` directory to `elements` directoryTristan Van Berkom2019-01-1618-0/+0
| | | | | | Now that the remaining test "filter.py" in the plugins directory tests a specific element, it makes sense to create a place for testing elements, just like we do for sources.
* tests: Removing tests/plugins/third_party.pyTristan Van Berkom2019-01-165-79/+0
| | | | | | This tests exactly the same thing that is tested in tests/internals/pluginfactory.py (the new location of tests/plugins/basics.py).
* tests: Migrate plugin loading test to internals directoryTristan Van Berkom2019-01-1617-1/+1
|
* tests: Migrate plugin factory test to internals directoryTristan Van Berkom2019-01-1621-1/+1
|
* tests: Migrate context test into the internals directoryTristan Van Berkom2019-01-165-1/+1
|
* tests: Migrate utils tests into internals directoryTristan Van Berkom2019-01-164-0/+0
|
* tests: Migrate yaml test to the internals directoryTristan Van Berkom2019-01-1614-1/+1
|
* tests: Migrate storage test to the internals directoryTristan Van Berkom2019-01-164-1/+1
|
* tests: Migrate virtual directory storage test to internals directoryTristan Van Berkom2019-01-161-0/+0
| | | | Grouping bits of internal testing together here
* tests: Migrate `--except` testing to tests/frontend/show.pyTristan Van Berkom2019-01-1615-88/+86
| | | | | | | | | The tests/pipeline directory will be removed, and this test is the better of the two but also redundant with the one in tests/frontend/show. Renamed existing test in show.py to `test_show_except_simple` and added the better test as `test_show_except` below it.