summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests/frontend/show.py: Test behavior of unfetched/inconsistent workspaced ↵tristan/fix-workspaced-junctions-1.2Tristan Van Berkom2019-05-241-6/+37
| | | | | | | | | junctions We already test the behavior without workspaces, lets just augment these tests to also run with a workspaced junction and check the results. This guards against regressions of #1030.
* Adding test for Invalid Yamlknownexus2019-05-103-0/+16
|
* tests/frontend/buildtrack.py: Test that tracking builds in non-strict mode ↵tristan/fix-build-track-all-no-strict-1.2Tristan Van Berkom2019-05-091-1/+77
| | | | | | actually build This is a regression test for issue #1014
* tests/frontend/buildtrack.py: Extending tests to ensure we build after trackingTristan Van Berkom2019-05-091-2/+15
| | | | | This adds a check to test_build_track() to ensure that the target is cached as a result of building with tracking of selected elements.
* tests/integration/workspace.py: Test that we don't crash when workspace ↵Tristan Van Berkom2019-05-061-0/+33
| | | | | | artifacts are deleted This is a regression test for #1017
* tests/testutils/runcli.py: Fix remove_artifact_from_cache() to work with ↵Tristan Van Berkom2019-05-061-2/+2
| | | | | | | | | subdirs. The artifact directories are based on the element normal_name, which substitutes any path separators with dashes. Fix the helper function to use the correct path.
* tests/frontend/push.py: Test pushing artifacts in non-strict modetristan/fix-non-strict-push-1.2Tristan Van Berkom2019-04-151-0/+46
| | | | This is a regression test for issue #990
* tests/testutils/artifactshare.py: Add message handlertristan/platform-cache-quota-1.2Tristan Van Berkom2019-04-141-0/+9
| | | | | | | | | | | | This needs to be added along with the status messages added to the artifact cache, and this detail diverges from master. This is because we have not bothered to backport !1071 which refactors the CASCache to be a delegate object of the ArtifactCache istead of a derived class - backporting !1071 would allow us to remove these message handlers because the CAS server and test fixture only use the CASCache object directly, not the business logic in the ArtifactCache.
* _artifactcache.py: Raise ArtifactError() when quota size exceeds disk space.Tristan Van Berkom2019-04-142-11/+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.
* _artifactcache.py: Refactored to use utils._get_volume_size()Tristan Van Berkom2019-04-142-2/+56
| | | | | | | | | | | | | | | | | | | | | 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/testutils: Use Context for artifact cache creationJürg Billeter2019-04-141-2/+1
|
* tests/frontend/track.py: Use test_track_recurse() to stress test SourcesTristan Van Berkom2019-04-141-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-04-141-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.
* tests/frontend/workspace.py: Test that all elements build with workspace in playtristan/backport-update-state-changes-1.2Tristan Van Berkom2019-03-2423-0/+157
| | | | | | | | | | | | | | | | | - Tests that the target is still built even when a workspace is open on a runtime dependency of a build-only dependency. - Tests that the target is still built even when a workspace is open on a runtime dependency of a runtime dependency of a build-only dependency This adds the regression test provided by Matthew Yates for issue #919 This test differs from the one committed in master as: - We have an orthogonal bug in 1.2.x where buildable elements show up in a waiting state instead of a buildable state - Some new APIs were used in the test case added in master, adjusted to use only 1.2 APIs for the test case.
* tests/format/junctions.py: Added tests for missing files across junction ↵Tristan Van Berkom2019-03-1211-1/+67
| | | | | | | boundaries These include assertions for the expected provenance in the errors, protecting against regressions of #947
* tests/format/project.py: Added tests for missing files and missing junctionsTristan Van Berkom2019-03-125-0/+31
| | | | | These also assert that the provenance of the references to missing files are reported, guarding for regressions of issue #947
* tests/testutils/artifactshare.py: Support optional coverageTristan Van Berkom2019-03-051-2/+7
| | | | | | | This scaffolding needs to manually tell coverage to cleanup when sigterm happens in the process in order to collect the coverage report, but we need to do this conditionally in case we are running tests without coverage support.
* tests/frontend/overlaps.py: Added regression test for cross project overlapsTristan Van Berkom2019-02-227-8/+61
| | | | | | | | | This test ensures the overlap failure vs warning policy in one project only ever affects the artifacts created for the project which declares it and does not force it's policy onto another consuming project. A regression test against issue #926
* buildstream/_artifactcache/cascache.py: Set 0644 rights to pulled filesvalentindavid/pull-chmod-bug-1.2Valentin David2019-02-131-0/+68
| | | | This was broken by 9252a18180ce79d70c193768293baa0f0eff9981.
* filter.py: don't recurse when staging dependenciesdoraskayo/filter-indirect-deps-fix-1.2Dor Askayo2019-02-053-0/+39
| | | | | | | | | Also bump the element's version so cached artifacts would be invalidated. Fixes #883 (cherry picked from commit 03111d39e093b11ffc6589071f2f5040d5f61ab4)
* Force updating tags when fetching git repositoryValentin David2018-12-112-1/+112
| | | | | | | | | When using aliases there are multiple remotes used in the cache repository. When fetching, tags are not updated if the were previously fetched from a different remote. Commits that not in a branch and only tagged do not get fetched if the tag is not fetched. Fixes #812
* Cleanup cache in cas server more agressivelyValentin David2018-11-292-4/+21
| | | | | When there is less than 2GB left, it cleans up have 10GB available. These values are configurable.
* Update mtimes of objects for requested references.Valentin David2018-11-291-0/+9
| | | | | This also remove references when some objects are missing. This is in preparation for the move from reference to object garbage collection.
* Fix cache corruption by scripts when layout and integration commands are usedvalentindavid/script-artifact-corruption-1.2Valentin David2018-11-089-0/+145
| | | | | | | | Root directory was marked as a non-artifact mount, so not using SafeHardLink. However integration commands executed with write access to the root directory. Fixes #749
* Ensure `--deps=none` option works for `bst checkout`Chandan Singh2018-10-293-12/+19
| | | | | | | | | | | This is a backport of !819. --- Currently, `bst checkout --deps none` command always produces empty output. Fix this issue and add regression test for the same. Fixes #670.
* Change URL to the Alpine tarballValentin David2018-10-171-1/+1
|
* Fix outside-of-project check when project path is not canonical.valentindavid/silverblue-path-1.2Valentin David2018-09-281-0/+12
| | | | | | | | | The issue happens on Silverblue where /home is a symlink to /var/home. With this element-path is something like /var/home/user/project/elements, when the project path is /home/usr/project. Comparing canonical paths solves the issue. Fixes #673
* cascache.py: Move push/pull messaging to cascacheJosh Smith2018-09-201-1/+1
| | | | | | | | Pulled/Pushed messages will no longer be produced from within element.py, instead they will be produced during CasCache push() and pull() appropriately. Message consistency has also been improved.
* tests.py: Test skip on pushJosh Smith2018-09-191-0/+23
| | | | | Adds a test to ensure that BuildStream alerts the user of a skipped push when the remote already has the artifact cached.
* Rework Skipped usageJosh Smith2018-09-191-1/+2
| | | | | | | | | | The SKIPPED message type is now used to indicate the end of a task which was successful without having to perform the given task. This overhauls the use of `Queue.done()` and therefore queues do not need to provide a processed/skipped return value from `done()`. Instead this is replaced with the action of raising a `SkipJob` exception from within `Queue.process()`.
* tests/artifactcache/config.py: Added test for invalid push remote configurationTristan Van Berkom2018-09-184-0/+35
| | | | | Test that we get the expected error when configuring a client-cert without client-key, or the inverse.
* tests/format/optionoverrides.py: Added test for options in element overridesTristan Van Berkom2018-09-183-0/+49
| | | | This is a regression test for issue #658
* Add tests for validating configuration variablesTiago Gomes2018-09-143-0/+101
|
* tests: avoid setting max-jobsTiago Gomes2018-09-141-11/+5
| | | | Setting "max-jobs" won't be allowed anymore in a following commit.
* tests/artifactcache/expiry.py: Added test_never_delete_required_track()Tristan Van Berkom2018-09-141-1/+57
| | | | | | Same test as test_never_delete_required(), except that this test ensures that we never delete required artifacts when their cache keys are discovered dynamically during the build.
* testutils/element_generators.py: Changing sized element functionsTristan Van Berkom2018-09-142-18/+77
| | | | | | | | | | | | | * create_element_size() Now uses a git Repo object instead of a local source, and returns the repo. * update_element_size() Added this function which can now resize the expected output of an element generated with create_element_size(), useful to allow testing sized elements with the tracking feature.
* testutils/repo/git.py: Added modify_file() methodTristan Van Berkom2018-09-141-0/+7
| | | | | This allows one to modify a file in an existing git repo, as opposed to adding a new one.
* tests/artifactcache/expiry.py: Assert the expected errorsTristan Van Berkom2018-09-141-0/+2
| | | | | | | These tests were not checking that we fail for the expected reasons. Added `res.assert_task_error(ErrorDomain.ARTIFACT, 'cache-too-full')` where we expect to fail because the cache is too full.
* tests/artifactcache/expiry.py: Cleanup of test for required artifactsTristan Van Berkom2018-09-141-39/+23
| | | | | | | This commit renames test_never_delete_dependencies() to test_never_delete_required(), renders the test more readable by renaming some elements and reordering some statements and makes the comments more straight forward and accurate.
* tests/artifactcache/expiry.py: Fix test case expectations.Tristan Van Berkom2018-09-101-0/+19
|
* source.py: Added `primary` argument to URL marking APIsTristan Van Berkom2018-09-031-3/+15
| | | | | | | | | | | | | The Source must now mention whether the marked or translated URL is "primary" or not. Even when a Source may have multiple URLs, the auxilliary URLs are derived from the primary one, not only is this true for git, but it is mandated by our tracking API which assumes there is a primary URL. This adjusts the `git` source and the test `fetch_source.py` source to behave properly and advertize it's primary URL properly. This is a part of #620
* tests: Modify tests to ensure retry FAILUREQinusty/retries-should-fail-backportJosh Smith2018-08-313-3/+3
|
* Report processing errors from trackingValentin David2018-08-301-0/+34
| | | | | | Failures to write files when tracking were not reported. Fixes #533.
* Add tests for cyclic variables checkJosh Smith2018-08-304-2/+40
| | | | | Note: This modifies the docker containers used for testing to supply the pytest-timeout package.
* tests/frontend/mirror.py: Reenable test_mirror_fetch_upstream_absent[ostree]tristan/538-reenable-ostree-test-1.2Tristan Van Berkom2018-08-301-4/+0
| | | | | This test was skipped because of issue #538, but #538 was fixed and the test was still not reenabled.
* tests/plugins/filter.py: Don't run redundant testsTristan Van Berkom2018-08-301-15/+10
| | | | | | | | | There is no reason that the filter element codepaths can behave differently depending on the Source implementation used in the test, as the Source implementation does not have any filter specific virtual methods. Removing the redundant tests and just performing these tests with the git source.
* Add tests that not-found objects in cache are shown as SKIPPEDBenjamin Schubert2018-08-291-0/+19
|
* tests/frontend/workspaces.py: Removing some redundant testsjuerg/workspaced-dependencies-1.2Tristan Van Berkom2018-08-281-4/+4
| | | | | Removed redundant tests from recently merged !740, this new test does not need to run for every different source kind.
* tests/frontend/workspace.py: Add test for workspaced dependenciesValentin David2018-08-281-0/+70
| | | | This adds a regression test for #461.
* tests/integration/project: Use the same alias for the alpine tarballTristan Van Berkom2018-08-242-2/+2
| | | | | | | | This makes the integration tests use the same 'alpine' alias for the tests as we use in the examples, this avoids a redundant download of an extra alpine tarball in integration tests. This is a part of #603