summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Blacken codebaseChandan Singh2019-11-05162-9037/+10729
|
* tests/artifactshare: safer cleanup_on_sigterm useaevri/testutils_artifactshareAngelos Evripiotis2019-11-051-2/+2
| | | | | | | | | | | | Use the documented path [1] to `pytest_cov.embed.cleanup_on_sigterm()`, to avoid crashing on some versions. It turns out that pytest_cov v2.6.1 on my machine doesn't like the way that we were accessing cleanup_on_sigterm(). Access it in such a way that we will either get the function or an ImportError, as per the documentation. [1]: https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html
* testutils/artifactshare: don't hang on errorAngelos Evripiotis2019-11-051-28/+33
| | | | | | | | Remove a couple of cases where it's possible to make the main test process hang, waiting for something to appear on a queue. Raise a friendlier exception, earlier, if there was a problem starting the server process.
* Replace BST_NO_PRESTAGE_KEY with BST_KEY_REQUIRES_STAGEDarius Makovsky2019-11-041-1/+1
| | | | Correct version number for BST_KEY_REQUIRES_STAGE
* frontend: Remove tracking options from `bst build`Chandan Singh2019-11-047-579/+62
| | | | | | | | | | | | | BREAKING CHANGE: Remove all tracking related options and flags from `bst build` command, as discussed on mailing list previously. See https://mail.gnome.org/archives/buildstream-list/2019-October/msg00009.html for the original proposal, and https://mail.gnome.org/archives/buildstream-list/2019-October/msg00024.html for a summary. At the same time, remove use of the removed options from our test suite.
* tests/.../missing_dependencies: include gitAngelos Evripiotis2019-10-311-10/+16
| | | | | | | | | | | | Symlink `git` into the separate tools bin directory. BuildStream needs `git` in order to be able to determine its version. This missing dependency is revealed when you run these tests in `spawn` mode, as it will re-run the base __init__.__version__ logic in a new process. Also take the opportunity to extract _symlink_host_tools_to_dir(), to re-use some code.
* local.py: use extended API, set BST_NO_PRESTAGE_KEYDarius Makovsky2019-10-3018-25/+80
| | | | | | | tests: * local sources are cached * use git sources instead of local when removing objects * update expected cache keys
* tests: check that workspaces only call _stage onceDarius Makovsky2019-10-301-0/+14
|
* testing, messenger: make dummy_context picklableAngelos Evripiotis2019-10-291-3/+28
| | | | | | | | | | | Note that unittest.MagicMock is unfortunately not pickable, so if one tries to cross over to a ChildJob then we're in trouble. Sacrifice some convenience and a bit of safety by implementing our own _DummyTask instead of using MagicMock. Don't try to pickle the 'simple_task' context manager, if it's been overridden when creating a test context.
* conftest: more useful multiprocessing printAngelos Evripiotis2019-10-291-4/+4
| | | | | | Print what we set to, not what was set before us. This enables us to test that `spawn` mode is really enabled by looking at output from the tests.
* tests/sources/keytest: Ensure element state is updated as expectedChandan Singh2019-10-222-9/+12
| | | | | | | | | | | | | | This contains two changes: * tests/sources/keytest.py: Ensure that the element state before/after BuildStream operations is updated as expected. Previously we were just checking that the command succeeded. * tests/sources/project_key_test/plugins/sources/key-test.py: Update the dummy plugin that's used for tests, such that it conforms to the expectations of a BuildStream source class. Fixes #1179.
* tests: remove mark.in_subprocessAngelos Evripiotis2019-10-226-40/+0
| | | | | It seems we don't need this anymore, thanks to cleaning up gRPC background threads.
* cascache.py: instantiate usage monitor earlyDarius Makovsky2019-10-221-0/+2
| | | | | | tests: manually close channels when interacting with the cache cascache.py: disable the usage monitor if start method is spawn
* tests/conftest: implement BST_FORCE_START_METHODAngelos Evripiotis2019-10-181-0/+15
|
* tests: add test for soft workspace resettraveltissues/1140-softresetDarius Makovsky2019-10-161-0/+52
|
* node.pyx: Make 'strip_node_info' publicBenjamin Schubert2019-10-162-4/+4
| | | | | 'strip_node_info' would be useful for multiple plugins. We should therefore allow users to use it.
* Improve progress testsTristan Maat2019-10-106-44/+149
|
* testutils/context.py: Mock tasks instead of accepting NonesTristan Maat2019-10-102-7/+17
| | | | | | | | | | | | To ensure that we only disable element loading task progress reporting for very specific code paths, we need to teach the test suite to be a bit smarter. For this reason we now mock a _Task object and return it in our mock context's relevant method invocations. Other code paths that deliberately invoke the loader without task reporting now mark their loads with NO_PROGRESS.
* loader.py: Avoid loading deps of junction metaelementsTristan Maat2019-10-101-1/+1
| | | | | | | | | | | | | By avoiding this, loading metaelements of junctions becomes cheap even for junctions with erroneous dependencies, and we can ignore their task reporting. Task reporting for junction metaelement loading is confusing, since the junction element itself will never be part of the pipeline, so we'd rather not have this show up as an actual loaded element. Elements loaded from the junction are loaded separately, therefore this does not affect their progress display.
* _sourcecache: Fallback to fetch source when remote has missing blobsBenjamin Schubert2019-10-101-0/+47
| | | | | | If a remote has some missing blobs for a source, we should not fail abruptly but instead continue to the next remote, and, in the worst case, fetch the source again.
* tests/sourcecache/fetch.py: Extract configuration of bstBenjamin Schubert2019-10-101-48/+26
| | | | | | | | Extract the configuration of the BuildStream cli as it is every time the same into a separate function. This helps seeing what is setup of the tests and what is the actual test itself.
* tests/sourcecache/fetch.py: Extract element's creation to a functionBenjamin Schubert2019-10-101-30/+17
| | | | | | All tests in this file use the same method for creating an element. It is easier to write new tests to have this factored out.
* tests/sourcecache/fetch.py: Don't hardcode the element nameBenjamin Schubert2019-10-101-7/+7
| | | | | This removes the need of having a hardcoded element name, by simply reusing the 'element_name' variable.
* tests/sourcecache/fetch.py: Extract logic to move local cas to remoteBenjamin Schubert2019-10-101-10/+9
| | | | This method can be reused and shared, and makes the tests more readable.
* setup.cfg: make xfail marks strict by defaulttraveltissues/strictxfailDarius Makovsky2019-10-098-16/+16
| | | | tests: remove strict kwargs from xfail marks
* tests: unmark tests passing with buildboxDarius Makovsky2019-10-092-2/+2
|
* _artifactcache.py: Don't push artifact blobs when no files are presentBenjamin Schubert2019-10-081-0/+43
| | | | | | | | | | Previously, if an artifact proto had no files at all in it, we would fail at pushing it, making BuildStream crash. When no files are part of an artifact proto, we can short-circuit the call and avoid pushing them unecessarily. - Add a test to ensure this doesn't come back.
* tests/frontend/buildcheckout.py: Create required symlinks on the flybschubert/fix-windows-symlinkBenjamin Schubert2019-10-082-1/+16
| | | | | | | | | Windows checks out symlinks as a file with content is the path of the symlink. This makes it impossible to mount the buildstream folder in a docker container and run the tests. This removes the symlink, and creates it on the fly for tests that use it, which fixes the problem.
* Defer committing workspace files to cachetraveltissues/1159Darius Makovsky2019-10-081-1/+0
| | | | | | | | | Remove XFAIL mark from test_workspace_visible and remove the explicit SourceCache.commit() in the workspace source plugin. Allow buildstream to handle the commit logic. Add handling for non-cached workspace sources in `source.Source._generate_keys()`.
* setup.cfg: Fix xdg env vars to not affect the hostbschubert/fix-xdg-temppathsBenjamin Schubert2019-10-081-0/+18
| | | | | | | | | | | | | | | | A fix was made in https://gitlab.com/BuildStream/buildstream/merge_requests/1244 in order to set xdg_* env variables inside of the test's directory to avoid importing data from the host. There was however still two problems: - When a variable was not set, it was set with a relative path, which would create a configuration for BuildStream that is invalid. - When a variable was set and running with pytest directly, we would still use the variable's value, which would be the host one. This ensure this can never happen, by not relying on the same variable's name and always overriding them.
* element.py: remove call to _source_cached()traveltissues/benchmarkDarius Makovsky2019-10-0529-28/+29
| | | | | | | Remove call to Element._source_cached() in _calculate_cache_key and do not recalculate workspace keys. tests: shell browsing of workspaces is currently broken
* element.py: remove concept of key instabilityDarius Makovsky2019-10-051-10/+35
| | | | | | | Workspace keys are determined by contained files at time of opening and are not forcibly reset tests: workspaces have keys when they're opened and are not recalculated
* cascache.py: Save casd logs in a file for retrievalBenjamin Schubert2019-10-041-0/+39
| | | | | Save all casd logs in a log file under its cas/ directory, and keep only the last 10 of them.
* cascache.py: Send message in case of unclean termination of buildbox-casdBenjamin Schubert2019-10-021-0/+63
| | | | | | | This adds messages in the various mis-termination of Buildbox-casd, to notify users that something might have gone wrong there. It also adds a few tests to validate the various behaviors.
* tests: Remove xfails from buildbox integration testsDarius Makovsky2019-09-242-6/+0
| | | | Workspace changes are now detectable when using BuildBox as the sandbox
* tests: Remove xfails from buildbox integration testsDarius Makovsky2019-09-242-2/+0
| | | | | Opening and building workspaces when buildbox is the sandbox is now supported.
* Remove workspace mounting for sandboxesDarius Makovsky2019-09-241-0/+2
| | | | | | | | Workspaces will be handled via the workspace source plugin methods. This does not currently support reflecting build artifacts in the open workspace. tests: Mark incremental workspace builds as xfail (strict)
* element.py: always check sources for cachingDarius Makovsky2019-09-2429-31/+48
| | | | | | | | | | | | | | | | | | | | | | Check that sources are cached even if they are workspaced and do not reset workspace cache data partially reverts !1470 closes #1088 element.py: remove workspaces in cache key calc Using the workspace source plugin, workspaces should now be handled like sources for the purpose of calculating element cache keys. partially reverts !1470 works towards #1073 Since the source keys are now calculated using the unique keys of the workspace source, this change will break external tracking for open workspaces. In future attempting to track an open workspace might raise a SourceError. The test is rewritten to close the workspace before tracking.
* tests: Add some missing integration markscoldtom/mark-filter-test-integrationThomas Coldrick2019-09-232-0/+6
|
* tests/testutils/artifactshare.py: Add SIGTERM handler to subprocessjuerg/artifactshareJürg Billeter2019-09-161-0/+6
| | | | | | | | pytest-cov 2.7 calls os._exit() in its SIGTERM handler, skipping cleanup, unless another SIGTERM handler was already registered. Add our own SIGTERM handler to the subprocess to ensure proper cleanup such as terminating buildbox-casd.
* tests/integration: Add test for filter elementcoldtom/filter-element-improvementsThomas Coldrick2019-09-164-4/+73
| | | | | Adds an integration test to check the `pass-integration` option for filter elements works.
* element.py: Abstract not producing artifactsThomas Coldrick2019-09-161-1/+1
| | | | | | | | Currently the stack element does not produce an artifact, and sometimes has to be treated differently because of this. It is conceivable that someone will write a plugin that must be treated similarly and doesn't produce an artifact. As a result this commit abstracts this "not producing an artifact" feature of elements.
* filter.py: Fail if parent element is a stackThomas Coldrick2019-09-163-0/+15
| | | | | | | | | | | As stack elements do not provide any artifacts, it is misleading to allow them as dependencies for filter elements. This commit makes a dependency on a stack element a failure with a descriptive error message. Additionally adds a test to make sure this works. Addresses #1104
* filter.py: Allow passing integration commandsThomas Coldrick2019-09-164-0/+44
| | | | | | | | | | | | | It is tedious to manually copy the integration commands of the parent element into a filter element, so this allows it to be done automatically. Here we modify FilterElement.integrate() to allow us to pass through the parent's integration commands, iff an option is set. Also adds a test for the new feature, but this is not as comprehensive as would be idea, as getting to the integration commands which are run is a little more difficult. Addresses #1107
* cli.py: Allow checkout to handle --deps allJames Ennis2019-09-131-3/+3
| | | | | | | | source checkout supports --deps all, so we should be consistent. Additionally, a user may want to have build deps in a potential chroot so you could rebuild any component.
* source_checkout.py: Add --compression tests for source checkoutJames Ennis2019-09-121-0/+34
|
* source_checkout.py: Add test for --tar/--directory conflictJames Ennis2019-09-121-0/+17
|
* cli.py: Make source checkout more consistent with artifact checkoutJames Ennis2019-09-122-16/+27
| | | | | | | | | | | | This MR changes the behaviour of source checkout so that it is more like artifact checkout. That is, a --directory option can be provided, rather than a mandatory LOCATION. In addition to this, the --tar option is no longer a boolean flag, rather it expects a tarfile name (just like artifact checkout) The appropriate tests have also been altered so that they support the new API
* source_checkout.py: Remove commented out touch() and add commentJames Ennis2019-09-121-1/+1
| | | | | | In "test_source_checkout_force()" we had a commented out line of code. This has been removed and a more useful comment has been added.
* Use distutils plugin from bst-plugins-experimentalJavier Jardón2019-09-122-0/+2
|