-
Notifications
You must be signed in to change notification settings - Fork 807
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pipeline_templates): notification inheritance (#1576)
- Loading branch information
1 parent
6413bdf
commit 6500bcf
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,36 @@ class V1SchemaExecutionGeneratorSpec extends Specification { | |
"124" | [application: 'orca'] || "124" | ||
} | ||
|
||
@Unroll | ||
def "should set notifications in execution json"() { | ||
given: | ||
PipelineTemplate template = getPipelineTemplate() | ||
TemplateConfiguration configuration = new TemplateConfiguration( | ||
pipeline: new PipelineDefinition([application: 'orca', pipelineConfigId: 'pipelineConfigId']), | ||
configuration: new TemplateConfiguration.PipelineConfiguration( | ||
inherit: inherit, | ||
notifications: [ | ||
new NamedHashMap().with { | ||
put('name', 'configuration-notification') | ||
put('address', '[email protected]') | ||
it | ||
} | ||
] | ||
) | ||
) | ||
|
||
when: | ||
def result = subject.generate(template, configuration, "pipelineConfigId") | ||
|
||
then: | ||
result.notifications*.address == addresses | ||
|
||
where: | ||
inherit || addresses | ||
['notifications'] || ['[email protected]', '[email protected]'] | ||
[] || ['[email protected]'] | ||
} | ||
|
||
private PipelineTemplate getPipelineTemplate() { | ||
new PipelineTemplate( | ||
id: 'simpleTemplate', | ||
|
@@ -99,6 +129,13 @@ class V1SchemaExecutionGeneratorSpec extends Specification { | |
put('enabled', true) | ||
it | ||
} | ||
], | ||
notifications: [ | ||
new NamedHashMap().with { | ||
put('name', 'template-notification') | ||
put('address', '[email protected]') | ||
it | ||
} | ||
] | ||
), | ||
stages: [ | ||
|