summaryrefslogtreecommitdiff
path: root/tests/format/variables.py
Commit message (Collapse)AuthorAgeFilesLines
* exceptions: Expose ErrorDomain, ErrorLoadReasonThomas Coldrick2020-01-231-1/+1
| | | | | | | Plugin tests are already accessing this API, but using imports from private modules. For motivation for this to be exposed publicly, note that ErrorDomain is an argument for most things in runcli.py, and LoadErrorReason may be another.
* Tests: Remove bst-plugins-experimental dependencyThomas Coldrick2020-01-131-38/+2
| | | | This stops the tests from being interlinked for BuildStream itself.
* Reformat code using BlackChandan Singh2019-11-141-109/+80
| | | | | | | As discussed over the mailing list, reformat code using Black. This is a one-off change to reformat all our codebase. Moving forward, we shouldn't expect such blanket reformats. Rather, we expect each change to already comply with the Black formatting style.
* _variables: Fix reporting of missing variableBenjamin Schubert2019-07-171-2/+3
| | | | | | | When the missing variable was not defined, we would get an exception as a string doesn't contain provenance information. - Add a test to prevent regression
* tests: Change all calls to _yaml.dump to _yaml.rountrip_dumpBenjamin Schubert2019-07-151-5/+5
| | | | | Now that both are equivalent, we can skip the sanitization part before the yaml call.
* _yaml: Add 'as_str()' on ScalarNode and 'get_scalar()' on MappingNodeBenjamin Schubert2019-07-151-2/+2
| | | | | | | | | | - '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.
* plugintestutils: Rename 'plugintestutils' package to 'testing'phil/rename-plugintestutilsPhil Dawson2019-04-161-1/+1
| | | | | | | | | - 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.
* The new YAML World OrderDaniel Silverstone2019-03-271-4/+4
| | | | | | | | | 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: str(datafiles) instead of a longer thingAngelos Evripiotis2019-03-211-4/+4
| | | | | | | | | | | | | | | | | | | 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-201-1/+1
| | | | | 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-201-0/+3
| | | | | Pylint doesn't play well with pytest fixtures, we therefore need to silence this error.
* tests:lint: reorder imports for consistencyBenjamin Schubert2019-03-201-1/+3
| | | | | - Remove all wrong-import-order from pylint - Order some subgroups of imports
* tests: Remove unused parameters in functionsBenjamin Schubert2019-03-011-6/+6
| | | | | For parameters that are required as part of an API, prefix them by "_" to make it clear they are unused
* Expose basic api for testing external plugins.phil/plugin-testing-apiPhil Dawson2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | We want external plugins to be able to make use of the core testing utils. This commit exposes the basic utilities which are currently in use in bst-external plugins. If necessary, more utilities could be exposed in the future. Moves the following files from tests/testutils/ to buildstream/plugintestingutils/: o runcli.py o integration.py As part of this, this commit makes the following changes to runcli.py and integration.py: o runcli.py: Fix linting errors o runcli.py: Add user facing documentation o Integration.py: Add user facing documentation
* tests: Migrate protected variable handling tests to tests/format/variables.pyTristan Van Berkom2019-01-161-3/+89
|
* plugins/elements/cmake.yaml: always specify variable typesAbderrahim Kitouni2018-11-191-2/+2
| | | | | | | cmake sometimes misinterprets relative paths as relative to the current directory if this is not specified. See freedesktop-sdk/freedesktop-sdk#431 adjust tests/format/variables.py accordingly.
* Add conf-root variable to buildsWilliam Salmon2018-10-161-4/+4
| | | | | | | Adding the conf-root variable makes creating out of source builds slightly easier. For issue #512 in Gitlab.
* Add tests for cyclic variables checkJosh Smith2018-08-291-0/+18
| | | | | Note: This modifies the docker containers used for testing to supply the pytest-timeout package.
* tests/format/variables.py: Removed testing of stderrTristan Van Berkom2018-05-081-4/+0
| | | | | | We have machine readable errors for this purpose, and the strings happen to change causing tests to break if we test the specific UI (reported error strings are UI).
* tests/format/variables.py: Add a test for undefined variable error messageValentin David2018-05-061-0/+14
|
* plugins/elements/cmake.yaml: allow using ninja instead of make (#279)abderrahim/cmake-ninjaAbderrahim Kitouni2018-04-141-2/+2
| | | | | | | This uses the build tool mode of cmake to have a single command that can call either make or ninja. I've also modified the tests to take the new commands into account
* tests/format/variables.py: Ported from old style testsTristan Van Berkom2018-04-141-0/+64