summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add tests for specifying targets of junction elementsChandan Singh2019-04-1813-0/+103
|
* plugintestutils: Rename 'plugintestutils' package to 'testing'phil/rename-plugintestutilsPhil Dawson2019-04-16113-151/+145
| | | | | | | | | - Rename plugintestutils to testing. - Don't run the tests from bst-plugins-template. This imports buildstream.plugintestutils so will have to be disabled to get through CI. This can be re nabled once bst-plugins-template has been patched.
* tests/frontend/push.py: Test pushing artifacts in non-strict modeTristan Van Berkom2019-04-151-0/+55
| | | | This is a regression test for issue #990
* Make templated source tests available in buildstream.plugintestutilsPhil Dawson2019-04-1238-1657/+25
|
* plugintestutils._utils: Copy subset of tests.testutils.sitePhil Dawson2019-04-121-1/+1
| | | | | | A subset of the functionality provided by this module is not available from buildstream._site but is necessary for the templated source plugin tests.
* plugintestutils: Add copy of testutils.junction.pyPhil Dawson2019-04-124-4/+4
| | | | | Copy tests.testutils.junction into plugintestutils._utils. This is needed for use by the templated source tests.
* testutils: move repo.py into buildstream.plugintestutilsPhil Dawson2019-04-1236-167/+55
| | | | | | | | This needs to be exposed as part of the plugin author facing API so that plugin authors can define custom repo types which will can be passed to the set of tests which iterate over multiple source types. Part of the work towards #944
* tests/remoteexecution/partial.py: Add test for partial CASJürg Billeter2019-04-122-0/+52
|
* Use platform.uname instead of os.uname for win32Angelos Evripiotis2019-04-114-20/+18
| | | | | | | | | The 'platform' module in the standard library provides a more portable version of uname(), which also works on Windows. In CPython, the platform version is implemented in terms of the os version: https://github.com/python/cpython/blob/60875db2f67815d7d181c552bfac59e8c97619e3/Lib/platform.py#L747
* tests: extract testutils.override_os_unameAngelos Evripiotis2019-04-114-45/+66
| | | | | | | | | | | Combine the very similar override_uname_arch() and override_uname_os() in a new helper function, to reduce duplication. Also use a 'try/finally' block to ensure that the original os.uname() is restored. This will make it simpler to adopt platform.uname() instead in later work.
* tests: Fix all remaining references to bst pushchandan/fix-bst-pull-docsChandan Singh2019-04-104-12/+12
| | | | | As the `bst push` is now called `bst artifact push`, update the remaining comments in testsuite that still refer to it as `bst push`.
* tests: Fix all remaining references to bst pullChandan Singh2019-04-103-11/+11
| | | | | As the `bst pull` is now called `bst artifact pull`, update the remaining comments in testsuite that still refer to it as `bst pull`.
* artifactservice.py: tests for the artifact serviceraoul/965-AaaP-serviceRaoul Hidalgo Charman2019-04-041-0/+109
| | | | Part of #965
* _yaml.py: Remove node_containsDaniel Silverstone2019-04-048-18/+18
| | | | | | | Now that we permit `key in somenode` remove the no longer needed function to check if a node contains a key. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* Plugin: Remove node_has_member()Daniel Silverstone2019-04-041-1/+1
| | | | | | | Now that we permit `key in somenode` again, remove the unnecessary extra API of Plugin.node_has_member() Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* lint: Fix or silence 'cyclic-import' errors and enable pylint for itBenjamin Schubert2019-04-012-2/+3
| | | | | | | | Cyclic imports can be confusing because the order in which we import dependencies can make the import fail or not. We should not rely on ordering of imports for our code. This fixes everywhere possible the imports and silence explicitely some which are not convenient or would require big refactors
* typo: writtent -> writtenBenjamin Schubert2019-03-306-13/+13
|
* plugintestutils/runcli.py: Add TestArtifact() 'abstraction' classTom Pollard2019-03-294-43/+16
| | | | | | | | | This adds the initial Artifact 'abstractions', taking existing test methods into a dedicated Artifact class. The class is accessed via an instance attribute of the generic Cli() fixture. This is in preperation for AaaP, to ensure existing tests pass whilst creating an entry point for further abstractions when necessary.
* _cas/cascache.py: Add opt check_exists arg to _reachable_refs_dir()Tom Pollard2019-03-291-5/+1
| | | | | | | | | | | By default the reachable set() includes all file digests from a given reachable directory/tree digest, however this does not guarantee the file objects are actually reachable. testutils/artifactshare.py has_artifact() ascertained if a given artifact is available by ensuring any 'reachable' digests are actually on the filesystem, this is made redudant with the optional check_exists objpath check during the reachable set creation.
* tests: Add a track test to ensure that we do not needlessly overwrite filesjennis/track_is_overworkingJames Ennis2019-03-281-0/+40
|
* The new YAML World OrderDaniel Silverstone2019-03-2730-219/+470
| | | | | | | | | Replace YAML internals with a new Node type, and refactor everything to use it cleanly. This work was also by James Ennis <james.ennis@codethink.co.uk> Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* YAML Cache: Remove the YAML CacheDaniel Silverstone2019-03-272-174/+8
| | | | | | | The new YAML world order doesn't need the YAML cache, so remove it before we begin the change. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* tests/artifactcache/push.py: Remove push_directory() testJürg Billeter2019-03-271-108/+0
| | | | push_directory() is unused and will be removed.
* testutils/yaml.py: add copyright noticeAngelos Evripiotis2019-03-271-0/+19
|
* tests: Add test_invalid_junctiondep_not_a_junctionAngelos Evripiotis2019-03-262-0/+17
| | | | Test that we error correctly when we junction-depend on a non-junction.
* tests: ensure provenance for _get_loader errorsAngelos Evripiotis2019-03-265-9/+52
| | | | | | | | | | | | Make the tests that currently cover _get_loader ensure that we are getting the expected provenance. Note that for some tests, we must use yaml_file_get_provenance, as the generated yaml is not stable across versions of ruamel. In later work we may replace all instances of provenance string tests with yaml_file_get_provenance, as it will be more robust to future changes.
* test: Add yaml_file_get_provenanceAngelos Evripiotis2019-03-262-0/+29
| | | | | | Add a new helper - testutils.yaml_file_get_provenance, this will let us make less fragile assertions about the presence of provenance in BuildStream output.
* tests: Add basic remote-execution tests (autotools)Martin Blanchard2019-03-256-0/+111
| | | | https://gitlab.com/BuildStream/buildstream/issues/629
* runcli.py: Add a CLI test fixture for remote-executionMartin Blanchard2019-03-251-1/+34
| | | | https://gitlab.com/BuildStream/buildstream/issues/629
* tests: Add a --remote-execution CLI optionsMartin Blanchard2019-03-251-2/+17
| | | | | | | | Unlike the --integration option that activates additional tests marked with 'integration', this new --remote-execution option deactivates all the tests except those marked with 'remoteexecution'. https://gitlab.com/BuildStream/buildstream/issues/629
* tests: check source push for workspaced elementsRaoul Hidalgo Charman2019-03-251-0/+40
| | | | | | | Workspaced elements should not push their sources as consistency is marked as cached even if the sources are not necessarily available. Part of #440
* tests: check sources are pushed even if build failsRaoul Hidalgo Charman2019-03-254-0/+100
| | | | | | | Adds a plugin build element that always fails. The test tries to build an element of this kind. Part of #440
* tests: source and artifact cache testRaoul Hidalgo Charman2019-03-251-0/+91
| | | | | | Ensures that remote source cache and artifact caches work fine together. Part of #440
* tests: Add source cache push failure testRaoul Hidalgo Charman2019-03-251-0/+42
| | | | Part of #440
* tests: Add source cache pull after a push testRaoul Hidalgo Charman2019-03-251-0/+45
| | | | Part of #440
* tests: Add source cache push testRaoul Hidalgo Charman2019-03-251-0/+96
| | | | Part of #440
* sourcepushqueue.py: Add queue for pushing sourcesRaoul Hidalgo Charman2019-03-252-4/+4
| | | | | | | Updates other queues and widget to have consistent naming and display, and tests have been updated to reflect this. Part of #440
* tests: Add source cache fetch failure testRaoul Hidalgo Charman2019-03-251-0/+52
| | | | Part of #440
* tests: Add source cache test for fallbackRaoul Hidalgo Charman2019-03-251-0/+59
| | | | | | | Checks buildstream calls fetch method when remote source cache does not have a source. Part of #440
* tests: Add source cache fetch testRaoul Hidalgo Charman2019-03-251-0/+111
| | | | Part of #440
* _basecache.py: Moves has remote methodsRaoul Hidalgo Charman2019-03-252-3/+3
| | | | | | | Move both `has_push_remotes` and `has_fetch_remotes` from `ArtifactCache`. Part of #440
* cascache.py: Do not silently ignore missing directories in checkout()Jürg Billeter2019-03-251-2/+4
| | | | | | Outside tests, CASCache.checkout() is used only in CasBasedDirectory.export() and we don't want to silently ignore missing directories when exporting files.
* tests/frontend/pull.py: Add test for pull completing partial artifactsJürg Billeter2019-03-251-0/+31
|
* tests: Check get_unique_key isn't used before trackRaoul Hidalgo Charman2019-03-214-0/+110
| | | | Part of a fix for !1124
* element.py: move _generate_key to _source_cachedRaoul Hidalgo Charman2019-03-211-1/+1
| | | | | | This means that keys are only generated after tracking. Part of a fix for !1124
* tests: when comparing lists/dicts, compare all at onceBenjamin Schubert2019-03-216-50/+61
| | | | | This allows pytest to show a better report of the difference between the two lists and not just tell that one entry is wrong.
* _artifactcache: don't define CACHE_SIZE_FILE twiceAngelos Evripiotis2019-03-211-1/+1
| | | | | | | | No need to define CACHE_SIZE_FILE in _artifactcache, it is not used here by the main application, and it is already defined and used in _cas.cascache. Fixup the reference in tests to refer to _cas.cascache instead.
* tests: str(datafiles) instead of a longer thingAngelos Evripiotis2019-03-2172-327/+327
| | | | | | | | | | | | | | | | | | | Replace some popular copypasta. This important-looking invocation: os.path.join(datafiles.dirname, datafiles.basename) is equivalent to this shorter invocation: project = str(datafiles) It seems like it's very popular copypasta, replace it with the shorter one thus: # Use 'gsed' or 'sed' etc. as appropriate for your system. git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f' git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
* tests/frontend/workspace.py: Test that all elements build with workspace in playTristan Van Berkom2019-03-2123-0/+153
| | | | | | | | | | - 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
* tests:lint: disable 'unused-import' checks on pytest fixturesBenjamin Schubert2019-03-2072-72/+72
| | | | | Pylint can't know that pytest's fixtures are used in a file and therefore reports false positives. Silencing all those errors