summaryrefslogtreecommitdiff
path: root/tests/sources
Commit message (Collapse)AuthorAgeFilesLines
* tests/tar: Add test for unreadable and unwritable content tar sourceShahwat Dalal2019-09-052-3/+5
| | | | | This test was added to consider the edge case when a unreadable file is being added to CAS.
* _yaml: Split Node-related parts into 'node.pyx'Benjamin Schubert2019-07-151-2/+2
| | | | | This makes the 'Node' API public, and available for use directly for plugins.
* _yaml: Remove 'node_validate' and replace by 'MappingNode.validate_keys'Benjamin Schubert2019-07-151-1/+1
| | | | - adapt all call sites to use the new API
* _yaml: Add a 'from_dict' on Node to create new nodes from dictsBenjamin Schubert2019-07-151-1/+1
| | | | | | | This new methods is here to replace the previous 'new_node_from_dict' that will be moved to a private method. Adapt all call sites to use the new 'from_dict' method.
* tests: Change all calls to _yaml.dump to _yaml.rountrip_dumpBenjamin Schubert2019-07-1510-46/+46
| | | | | Now that both are equivalent, we can skip the sanitization part before the yaml call.
* _yaml: Remove 'node_set'. Now use __setitem__Benjamin Schubert2019-07-152-9/+9
| | | | | | - Implement __setitem__ on 'MappingNode' - Implement __setitem__ on 'SequenceNode' - Adapt all call sites to use the new calling way.
* _yaml: Remove 'node_get' and migrate all remaining calls to new APIBenjamin Schubert2019-07-151-6/+6
|
* _yaml: Add 'as_bool()' and 'is_none()' to ScalarNodeBenjamin Schubert2019-07-151-2/+2
| | | | | | | | | | | - 'as_bool()' casts a ScalarNode into a boolean, understanding both 'True' and 'False' as truthy-falsy values, as per node_get(type=bool) behavior - 'is_none()' allwos checking whether the scalar node contains a 'None' value. Since 'None' cannot be used when working with booleans, we need to have a way of checking for 'None' when we actually need the information of whether the value is unset. - Adapt all call places to use the new API
* _yaml: Add 'as_str()' on ScalarNode and 'get_scalar()' on MappingNodeBenjamin Schubert2019-07-152-6/+6
| | | | | | | | | | - 'get_scalar()' allows retrieving a scalar node from a mapping. - 'as_str()' casts a ScalarNode into a string (thus removing the node information). Both together, those replace 'node_get(mapping, key, type=str)' but also allow retrieving the 'Node' itself, which will allow in the future lazier provenance computation.
* _yaml: add 'get_mapping()' to MappingNodeBenjamin Schubert2019-07-151-1/+1
| | | | | | | | This allows to get a mapping node from another 'MappingNode', replacing 'node_get(my_mapping, key, type=dict)' Also changes all places where 'node_get' was called like that by the new API.
* utils.py: Add write permission to root path in _force_rmtreeshashwatdalal/tar-file-extractionShahwat Dalal2019-07-042-4/+21
| | | | | This is needed in the case where the temp directory permissions are changed between creation and deletion.
* tar.py: Make link target renaming work between base-dirsTristan Maat2019-07-026-0/+96
| | | | Fixes #1052
* _yaml: Remove useless calls to '_yaml.node_sanitize'Benjamin Schubert2019-06-251-6/+6
| | | | | | Calling '_yaml.dump' will itself call '_yaml.node_sanitize', therefore we can remove all calls to it in places where we directly after call dump.
* testing/_utils: match git methods to base classAngelos Evripiotis2019-06-181-5/+5
| | | | | | | | | | | | Update 'source_config' of Git and _SimpleGit to match the Repo base class. This ensures that they are fully substitutable Repos. Introduce 'source_config_extra' to allow explicit usage of extended functionality, which wouldn't necessarily be supported by a different subclass. By making the signatures deliberately match, we can use PyLint to ensure the signatures don't accidentally differ.
* test:utils/site: Consolidate HAVE_SANDBOX in a single site fileBenjamin Schubert2019-06-061-1/+1
| | | | | | | | We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Remove HAVE_SANDBOX from tests/testutils/site.py and change all imports to point to the other one
* test:utils/site: Consolidate arpy environment variables in a single placeBenjamin Schubert2019-06-061-1/+1
| | | | | | | We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving all the arpy related ones in a single place.
* test:utils/site: Consolidate Lzip environment variables in a single placeBenjamin Schubert2019-06-061-1/+1
| | | | | | | We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving all the lzip related ones in a single place.
* test:utils/site: Consolidate Git environment variables in a single placeBenjamin Schubert2019-06-062-3/+2
| | | | | | | We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving all the git related ones in a single place.
* test:utils/site: Consolidate Bzr environment variables in a single placeBenjamin Schubert2019-06-061-1/+1
| | | | | | | We have two different 'site' files that are redundant and both define some variables in BuildStream environment. This is a first step in consolidating them in a single file
* Remove OSTree plugin; It lives now in the bst-plugins-experimental repoJavier Jardón2019-05-141-60/+0
|
* Add BST_REQUIRES_PREVIOUS_SOURCE_STAGE optionRaoul Hidalgo Charman2019-05-142-1/+2
| | | | | | | This is an element option that allows sources to be staged more seperately where possible rather than on a per element option. Part of #982
* source.py: ensure previous track refs are updatedraoul/1010-multiple-track-fixRaoul Hidalgo Charman2019-05-103-2/+13
| | | | | | | | | | | | Updates the refs in the job process (but doesn't write), to ensure following sources can see consistency of previous sourcse has been updated. `_save_ref` is renamed `_set_ref` with writing to file now optional. This also changes the previous_source_access test to use a remote, so that it actually tests this cornercase. Fixes #1010
* testing._sourcetests: Don't special case 'local' in parameter listPhil Dawson2019-04-303-0/+82
| | | | | | | | | | | | The 'local' kind is hard coded in the parameter list of on test in testing._sourcetests as so will always run regardless of what plugins have been registered. Remove this special casing by duplicating the test in the local source specific test. Ideally, the local source should have a Repo implementation and be registered with the templated tests.
* plugintestutils: Rename 'plugintestutils' package to 'testing'phil/rename-plugintestutilsPhil Dawson2019-04-1613-17/+17
| | | | | | | | | - 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.
* Make templated source tests available in buildstream.plugintestutilsPhil Dawson2019-04-1237-1657/+0
|
* 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-1212-14/+28
| | | | | | | | 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
* _yaml.py: Remove node_containsDaniel Silverstone2019-04-043-11/+11
| | | | | | | 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>
* The new YAML World OrderDaniel Silverstone2019-03-273-34/+48
| | | | | | | | | 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>
* tests: Check get_unique_key isn't used before trackRaoul Hidalgo Charman2019-03-214-0/+110
| | | | Part of a fix for !1124
* tests: str(datafiles) instead of a longer thingAngelos Evripiotis2019-03-2116-85/+85
| | | | | | | | | | | | | | | | | | | 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:lint: disable 'unused-import' checks on pytest fixturesBenjamin Schubert2019-03-2019-19/+19
| | | | | Pylint can't know that pytest's fixtures are used in a file and therefore reports false positives. Silencing all those errors
* tests:lint: silence redefined-outer-name in files using fixturesBenjamin Schubert2019-03-2019-0/+57
| | | | | Pylint doesn't play well with pytest fixtures, we therefore need to silence this error.
* tests:lint: Remove unused variablesBenjamin Schubert2019-03-201-2/+0
|
* tests:lint: rename variables shadowing othersBenjamin Schubert2019-03-202-4/+4
|
* tests:lint: use set comprehensions instead of set([])Benjamin Schubert2019-03-201-3/+3
|
* tests:lint: don't use mutable default variablesBenjamin Schubert2019-03-201-1/+4
|
* tests:lint: remove all unneccessary-parens errors from pylintBenjamin Schubert2019-03-206-34/+34
|
* tests:lint: be explicit when not using a variableBenjamin Schubert2019-03-202-4/+4
| | | | Fix all pylint unused-variable issues
* tests:lint: reorder imports for consistencyBenjamin Schubert2019-03-204-6/+10
| | | | | - Remove all wrong-import-order from pylint - Order some subgroups of imports
* tests: move templated tests from workspace.py into separate filephil/consolidate-repo-testsPhil Dawson2019-03-145-0/+203
| | | | | | | Move the templated tests in tests/frontend/workspace.py into sources/generic/workspace.py This is part of the preparation work for #944
* tests: move templated tests from source-determinism.py into separate filePhil Dawson2019-03-142-1/+136
| | | | | | | Move the templated tests in tests/frontend/source-determinism.py into sources/source_determinism.py This is part of the preparation work for #944
* tests: move templated source tests from track.py into separate filePhil Dawson2019-03-141-0/+412
| | | | | Move the templated tests in tests/frontend/track.py into sources/generic/track.py
* tests: move templated tests from track_cross_junction.py into separate filePhil Dawson2019-03-141-0/+180
| | | | | | | Move the templated tests in tests/frontend/track_cross_junction.py into sources/generic/track_cross_junction.py This is part of the preparation work for #944
* tests: move templated tests from buildcheckout.py into basic_functionality.pyPhil Dawson2019-03-141-0/+81
| | | | | | | Move the templated tests in tests/frontend/buildcheckout.py into sources/generic/buildcheckout.py This is part of the preparation work for #944
* tests: move templated source tests from mirror.py into separate filePhil Dawson2019-03-141-0/+426
| | | | | | | Move the templated tests in tests/frontend/mirror.py into sources/generic/mirror.py This is part of the preparation work for #944
* tests: move templated source tests from fetch.py into separate filePhil Dawson2019-03-1428-0/+198
| | | | | | | | Create tests/sources/basic_functionality.py for templated source tests and move the templated tests in tests/frontend/fetch.py into sources/generic/fetch.py This is part of the preparation work for #944
* Let subprocess decode stdout based on localebschubert/no-subprocess-decodeBenjamin Schubert2019-03-011-8/+12
| | | | | | | | | Subprocesses can return decoded strings if we give them a "universal_newlines=True" argument. We can therefore offload that to them, and not explicitly decode output ourselves. This also fixes multiple bugs where we would not be respecting the locale used by the user, and in some cases force it to "ascii".
* tests: Remove unused importsremove-dead-codeBenjamin Schubert2019-03-013-6/+0
|