Allow testsuite: null in Jobtemplate YAML
|Target version:||Current Sprint|
It should be allowed to use
scenarios: x86_64: opensuse-Tumbleweed-DVD-x86_64: - testname: testsuite: null ...
to specify that there is no Testsuite from the database involved.
Adapting the schema and the code was easy, however the unique constraint in job_templates needs to be different.
CONSTRAINT scenario UNIQUE (product_id, machine_id, name, test_suite_id)
we would need something like that:
CREATE UNIQUE INDEX scenario1 ON job_templates (product_id, machine_id, name, test_suite_id) WHERE test_suite_id IS NOT NULL; CREATE UNIQUE INDEX scenario2 ON job_templates (product_id, machine_id, name) WHERE test_suite_id IS NULL;
But this is only possible by manually adding the SQL to the deployment. Still trying to find out how.
Supporting this kind of manual constraint will be a bit of work - finding out how to do it, and maintaining it in the future.
Using a "really" empty testsuite entry in the database (but still using
null in the YAML) might be the easier solution.
If the empty testsuite does not yet exist, it will be created if a Jobtemplate is using it.