summaryrefslogtreecommitdiff
path: root/tests/format/include.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-04-10 19:46:47 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-04-17 14:15:25 +0900
commit8af144d30d3a743fa946e8579b85f7789b72e1ba (patch)
treefffd72adb8ea8e6a73d33627a54fa42d76a9796e /tests/format/include.py
parent6f423b69e4b32e3b0443ff38c631df46ea60e7f8 (diff)
downloadbuildstream-tristan/bst2-separation.tar.gz
Implement new required 'version' specification in project.conftristan/bst2-separation
This adds a required field to project.conf to specify the BuildStream version required by the project, and this serves two separate purposes at once: A.) It is a more practical method for users to specify the format-version The "format-version" field requires that users know about which format version each YAML feature was added in, and this version is separate from the BuildStream version. As such, it is more difficult to use - the field is still preserved and supported, but mostly only useful in order to depend on format versions in unstable release periods. B.) It serves to ensure that the wrong major point version of BuildStream is never used with the wrong project. Changes in this commit include: * _versions.py: Added BST_API_VERION_MAJOR and BST_API_VERION_MINOR These include comments about how the fields must be updated when work commences on any major or minor point stable release, usually on the master branch. * _project.py: Support parsing the new "version" * _frontend/app.py: The `bst init` command has been extended to also dump the current API version automatically. This should really be enhanced separately, but since the test cases use `bst init` in some places in order to create projects for test purposes, I've included the minimal change here and will enhance `bst init` separately. * tests: All tests updated to include a "version: 2.0" specification in the project.conf files under test
Diffstat (limited to 'tests/format/include.py')
-rw-r--r--tests/format/include.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/format/include.py b/tests/format/include.py
index 4b1da920b..1143bd4e2 100644
--- a/tests/format/include.py
+++ b/tests/format/include.py
@@ -32,7 +32,7 @@ def test_include_project_file(cli, datafiles):
def test_include_missing_file(cli, tmpdir):
- tmpdir.join('project.conf').write('{"name": "test"}')
+ tmpdir.join('project.conf').write('{"name": "test", "version": "2.0"}')
element = tmpdir.join('include_missing_file.bst')
# Normally we would use dicts and _yaml.dump to write such things, but here
@@ -51,7 +51,7 @@ def test_include_missing_file(cli, tmpdir):
def test_include_dir(cli, tmpdir):
- tmpdir.join('project.conf').write('{"name": "test"}')
+ tmpdir.join('project.conf').write('{"name": "test", "version": "2.0"}')
tmpdir.mkdir('subdir')
element = tmpdir.join('include_dir.bst')