summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix test failures caused by unix sockets' path length limitjonathan/wsl-testsJonathan Maw2019-02-061-1/+8
| | | | | | The unix specification for unix sockets only allocates ~100 characters for the length of the path. This may be longer than the path for a CI runner, or the path to a user's buildstream directory.
* tests: Skip tests that use sandboxes on WSLJonathan Maw2019-02-0620-85/+96
|
* Add --remote, -r option to bst build, inline with pull & pushTom Pollard2019-02-053-1/+85
| | | | | | Providing a remote will limit build's pull/push remote actions to the given remote specifically, ignoring those defined via user or project configuration.
* filter.py: Fail if declared domains do not exist in the parent elementjennis/warn_for_nonexistent_domainsJames Ennis2019-02-043-1/+20
| | | | | | | | | This patch also uncovered the fact that our test_filter_deps_ok() test has been inaccurate. Thus the element built in this test (deps-permitted.bst) has been modified so that it build depends on the input.bst element, as it should. tests/filter.py: Ensure deps_ok test passes
* tests/cachekey: Test cache keys are independent of target elementsphil/cache-key-stability-testPhil Dawson2019-02-016-0/+66
|
* testutils/site.py: Support parsing more exotic git versionsChandan Singh2019-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | We use output of `git --version` to determine if we can run some tests that rely on features from newer git versions. Usually, we expect the output to be like: git version 2.17.2 On some platforms, like MacOS, there could be a suffix after the version string, so that it looks something like: git version 2.17.2 (Apple Git-113) This causes things to fail like so: ValueError: invalid literal for int() with base 10: '2 (Apple Git-113)\n' Fix logic around `HAVE_OLD_GIT` such that we split the output of `git --version` without limit on how many times we split. Previously we used to split only twice so the suffixes like `(Apple Git-113)` are not part of the parsed version.
* filter.py: don't recurse when staging dependenciesDor Askayo2019-01-303-0/+39
| | | | | | | Also bump the element's version so cached artifacts would be invalidated. Fixes #883
* Download buildtrees on demand for bst shell --use-buildtreetpollard/829Tom Pollard2019-01-281-11/+37
| | | | | | | | | | | | | | | | | Provide bst shell --use-buildtree the ability to attempt to acquire missing buildtrees, given respective option, user pull-buildtree context and remote availability. _frontend/cli.py: Refactor logic for determining --use-buildtree option with given opportunity to attempt pulling a non-local buildtree. Element loaded with artifact_config to allow remote querying. _stream.py: With given user option and element state, construct PullQueue to fetch remote buildtree. Continue or Error without buildtree if cannot be attained. tests/integration/build-tree.py: Update to support new usecases
* Fixup refs to 'bst track'Angelos Evripiotis2019-01-281-1/+1
| | | | | Now that 'bst track' is obsolete, change guidance to refer to the replacement 'bst source track' instead.
* _artifactcache.py: Don't require the quota to be available on disk.tristan/cache-quota-max-onlyTristan Van Berkom2019-01-251-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead only rely on the headroom to be enough to protect against out of space conditions. The headroom can become configurable as a separate step is required. The changes to achieve this are: * Rename ArtifactCache.has_quota_exceeded() to ArtifactCache.full(). * ArtifactCache.full() now also reports True if the available space on the artifact cache volume is smaller than the headroom. This ensures jobs get triggered to cleanup the cache when reaching the end of the disk. * When loading the artifact quota, it is now only an error if the quota exceeds the overall disk space, not if it does not fit in the available space. It is still a warning if the quota does not fit in the available space on the artifact cache volume. * Updated scheduler.py and buildqueue.py for the API rename * tests: Updated the artifactcache/expiry.py test for its expectations in this regard. Added a new test to test an error when quota was specified to exceed total disk space, and adjusted the existing tests to expect a warning when the quota does not fit in the available space. This fixes issue #733 and #869.
* _artifactcache.py: Refactored to use utils._get_volume_size()Tristan Van Berkom2019-01-242-3/+3
| | | | | | | | | | | | | | | | | | | | | This will benefit from a better UtilError being raised, and and turns the artifact cache's local function into a one liner. The loop which finds the first existing directory in the given path has been removed, being meaningless due to the call to os.makedirs() in ArtifactCache.__init__(). The local function was renamed to _get_cache_volume_size() and no longer takes any arguments, which is more suitable for the function as it serves as a testing override surface for unittest.mock(). The following test cases which use the function to override the ArtifactCache behavior have been updated to use the new overridable function name: tests/artifactcache/cache_size.py tests/artifactcache/expiry.py
* 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.