Commit Graph

2 Commits

Author SHA1 Message Date
Vsevolod Fedorov 6b92807cd7 Tests: Rename yamlparser tests and fixture directories
Rename fixtures directory to job_fixtures to prepare for adding view_fixtures
directory in the following commits.

Change-Id: Ic20997cae020b542ddc22bf444fa6b92fbcae064
2023-01-26 11:06:23 +03:00
Antoine Musso 98b69476ea Apply defaults to job-templates parameters
I had the use case of a lot of projects sharing the same job template
that uses a lot of variables.  That requires each project to define all
the variables even if they are mostly identical.

This patch propose to define varialbes as 'defaults' and have them
applied in the job-template magically (oneline diffs always have that
feeling to me).

So instead of:

- project:
    name: project1
    arch: amd64
    builder: debuild
    lintian: true
    jobs:
     - '{name}-build-{arch}'

And so on ...

I can just:

- defaults:
    name: sanebuild

- project:
    name: project1
    defaults: sanebuild
    jobs:
     - '{name}-build-{arch}'

And override the arch as needed either in the project or by passing it
to the job.

Without this patch, the provided yamlparser fixture
template_honor_defaults.yaml would raise:

    arch parameter missing to format echo Build arch {arch}.
    Given: {'': '', 'jobs': ['build-{arch}'], 'name': 'project-name'}

Change-Id: Ida1e27eb47356d9cae42175743bd2fd52eb9d869
2014-08-22 23:35:54 +02:00