This repository contains the schemas used by buildtest. The development of schema is done independent of the framework.
buildtest schema docs can be found at here.
To configure buildtest use the settings.schema.json
:
A schema defines the structure of how to write and validate a JSON file. Since, python can load YAML and JSON files we write our Buildspecs in YAML and validate them with a schema file that is in json.
We make use of python-jsonschema
run validate
with a Buildspec with one of the schema file.
The following sites (along with the files here) can be useful to help with your development of a schema.
If you have issues with writing json schema please join the JSON-SCHEMA Slack Channel
Buildtest will contain a folder per schema (script
, global
, compiler
, python
, etc…) that
contains one or more versions of the schema. Since each schema type has
different versions we store them in format such as :
script-v1.0.schema.json
The format is <name>-vX.Y.schema.json
These schemas are also stored in buildtest here
The entire root of this folder could be added to the folder shown above,
and the subfolder structure would be added to the module. Importantly,
the lowercase class names should match to a class defined in buildtest/buildsystem/bases.py.
For example, the contents of the script directory here are expected
to be added present at buildtest/schemas/script
to go
along with a class “Script” in the bases file.
Each schema in buildtest for a test configuration is represented here. If you want to make a new schema to add to buildtest:
script-v1.0.schema.json
)tests/valid/script/1.0/
).tests/invalid/script/1.0
Be sure to update properties and take account for:
additionalProperties: false
when defining properties so that additional keys in properties are not passed in.Adding a new version means that you only need to:
script-v2.0.schema.json
).github/tests/invalid/<name>/<version>
In both cases, when the version is finished, a release means adding the file to
buildtest under buildtest/buildsystem/schemas
and implement the changes
required in buildtest to support the schema.