summaryrefslogtreecommitdiff
path: root/tests/format
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-1617-19/+19
| | | | | | | | | - 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.
* testutils: move repo.py into buildstream.plugintestutilsPhil Dawson2019-04-122-3/+3
| | | | | | | | 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
* Use platform.uname instead of os.uname for win32Angelos Evripiotis2019-04-112-8/+8
| | | | | | | | | 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-112-45/+14
| | | | | | | | | | | 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.
* _yaml.py: Remove node_containsDaniel Silverstone2019-04-041-1/+1
| | | | | | | 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-2714-58/+57
| | | | | | | | | 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: 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-261-0/+14
| | | | | | | | | | | | 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.
* tests: when comparing lists/dicts, compare all at onceBenjamin Schubert2019-03-211-33/+26
| | | | | This allows pytest to show a better report of the difference between the two lists and not just tell that one entry is wrong.
* tests: str(datafiles) instead of a longer thingAngelos Evripiotis2019-03-213-10/+10
| | | | | | | | | | | | | | | | | | | 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-2017-17/+17
| | | | | 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-2017-0/+50
| | | | | Pylint doesn't play well with pytest fixtures, we therefore need to silence this error.
* tests:lint: fix all blacklisted-name errorsBenjamin Schubert2019-03-201-10/+10
|
* tests:lint: remove all unneccessary-parens errors from pylintBenjamin Schubert2019-03-203-49/+49
|
* tests:lint: reorder imports for consistencyBenjamin Schubert2019-03-204-4/+10
| | | | | - Remove all wrong-import-order from pylint - Order some subgroups of imports
* tests: rename tests shadowing another one and fix failuresBenjamin Schubert2019-03-202-2/+2
|
* tests: remove duplicated testsBenjamin Schubert2019-03-201-13/+0
| | | | The removed tests duplicate tests in the same file with the same name.
* _project: don't _find_project_dir if a junctionAngelos Evripiotis2019-03-151-0/+77
| | | | | | | | | | | | | | | If we're creating a project for a junction, then don't go looking for the project directory - the path has already been given to us. This means that we can now detect when junctions are missing a 'project.conf', and importantly we don't accidentally start resolving elements in the enclosing project. Add tests to cover workspaced, local, and git repo cases. Note that this is also the first test coverage for the INVALID_JUNCTION path. In later work we might extract the _find_project_dir magic out of the Project class, so that there are no surprises when instantiating it.
* tests: Add tests to ensure that overwriting on later compositions worksJames Ennis2019-03-126-0/+63
|
* tests/format/junctions.py: Added tests for missing files across junction ↵Tristan Van Berkom2019-03-1211-0/+66
| | | | | | | 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: Remove unused importsremove-dead-codeBenjamin Schubert2019-03-011-1/+1
|
* tests: Remove unused parameters in functionsBenjamin Schubert2019-03-013-9/+9
| | | | | For parameters that are required as part of an API, prefix them by "_" to make it clear they are unused
* tests: Remove unused variablesBenjamin Schubert2019-03-012-3/+2
|
* tests/format/include: remove unused tmpdir'saevri/include-errorAngelos Evripiotis2019-02-111-6/+6
| | | | | Don't create and remove temp dirs unnecessarily when they are not used, looks like these were just copy-pastes without intended side-effects.
* _includes: better error on including directoryAngelos Evripiotis2019-02-111-0/+21
| | | | | | | | | | | | | Previously, include a directory result in an error like this: mydir is a directory. bst command expects a .bst file. Note that the file containing the include was not mentioned. Now we get an error like this instead: element.bst [line 12 column 0]: Include block references a directory instead of a file: 'mydir'.
* _includes: better error on missing includeAngelos Evripiotis2019-02-111-0/+20
| | | | | | | | | | | | | Previously, a missing include would result in an error like this: Could not find file at not-a-file.include Note that the file containing the include was not mentioned. Now we get an error like this instead: element.bst [line 7 column 5]: Include block references a file that could not be found: 'not-a-file.include'.
* _includes: better provenance on recursive includeAngelos Evripiotis2019-02-111-1/+2
| | | | Use the provenance of the include block, instead of the whole node.
* Expose basic api for testing external plugins.phil/plugin-testing-apiPhil Dawson2019-02-0817-17/+22
| | | | | | | | | | | | | | | | | | 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
* Mark 'old' checkout command as obsoleteJames Ennis2019-01-221-8/+8
| | | | | | | | | | | This commit marks 'bst checkout' as a 'hidden' command. If used, the user will be prompted to use the new 'bst artifact checkout' command. All tests which used 'bst checkout' have been modified to use the new artifact sub-command. This partially solves #822.
* tests: Migrate junctions test to tests/format/junctions.pyTristan Van Berkom2019-01-1664-0/+551
| | | | This is the directory for all things related to loading.
* tests: Migrate protected variable handling tests to tests/format/variables.pyTristan Van Berkom2019-01-163-3/+91
|
* tests: Renaming some tests in tests/format/project.pyTristan Van Berkom2019-01-161-5/+5
| | | | Remove some redundancy from the test lines.
* tests: Migrate preflight error handling check to tests/format/project.pyTristan Van Berkom2019-01-165-0/+57
| | | | | | This is where other load time related plugin error handling is checked, and is the last thing to remove in the `tests/pipeline` directory.
* tests: Migrate test for load_ref() unsupporting plugins into format/project.pyTristan Van Berkom2019-01-164-0/+81
| | | | | | | The tests/format/project.py test already has some tests about how we error gracefully for bad plugins and bad plugin configurations, lets put it there rather than tests/pipeline/load.py which we will remove.
* tests: Migrate dependency order/iteration testing to the format testsTristan Van Berkom2019-01-1629-17/+162
| | | | | | Created new `tests/format/iteration.py` which tests the order in which elements are iterated over in various scopes in a loaded data model.
* tests: Migrate dependencies test to tests/formatTristan Van Berkom2019-01-1621-0/+218
| | | | This used to be an internal test, converted this to use the `cli` fixture.
* tests/format/optionarch.py: Add tests for architecture aliasesJürg Billeter2019-01-105-0/+81
|
* tests/format/project.py: Added new regression test for empty dependency ↵Tristan Van Berkom2018-12-073-0/+11
| | | | | | dictionaries This adds a regression test for issue #803
* optionos.py: Add tests for OptionOSRaoul Hidalgo Charman2018-12-053-0/+99
| | | | Same format as OptionArch tests, but with OS's.
* optionarch.py: update to use same arch names as SandboxConfigRaoul Hidalgo Charman2018-12-054-5/+5
| | | | Also update tests to be consistent with this
* 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 support for aarch64 in a testValentin David2018-11-141-1/+1
|
* 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.
* Fix outside-of-project check when project path is not canonical.Valentin David2018-09-271-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
* Adding test for Invalid Yamlissue-642-Invalid_project.conf_seen_as_missingknownexus2018-09-183-0/+16
|
* 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 cyclic variables checkJosh Smith2018-08-293-0/+24
| | | | | Note: This modifies the docker containers used for testing to supply the pytest-timeout package.
* Add support for include '(@)' in project.conf and .bst filesValentin David2018-08-0247-0/+583
| | | | Fixes #331.