Skip to content

Commit 055819e

Browse files
committed
Prepare Web Image for tiered jobs
1 parent a180d4f commit 055819e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

web-image/ci/ci_common/wi-run-spec.jsonnet

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ local os_arch_jdk_mixin(mapping) = r.task_spec(r.evaluate_late({
2020
// These should always be used to set/add job targets, otherwise the 'target'
2121
// key is not set.
2222
target(t): r.task_spec({ target: t, targets+: [t] }),
23-
gate: self.target('gate'),
23+
tier1: self.target('tier1'),
24+
tier2: self.target('tier2'),
25+
tier3: self.target('tier3'),
26+
tier4: self.target('tier4'),
2427
daily: self.target('daily'),
2528
weekly: self.target('weekly'),
2629
post_merge: self.target('post-merge'),
2730
// opt-post-merge jobs should have an associated tag to group the jobs
2831
opt_post_merge(tag): self.target('opt-post-merge') + r.task_spec({ tags+: { opt_post_merge+: [tag] } }),
2932

33+
capabilities(capabilities): r.task_spec({ capabilities+: capabilities }),
3034

3135
docker_ol8: {
3236
docker: {
@@ -75,6 +79,17 @@ local os_arch_jdk_mixin(mapping) = r.task_spec(r.evaluate_late({
7579
evaluate_late: r.evaluate_late,
7680
exclude: r.exclude,
7781

82+
// Tiered jobs should be treated as gate jobs. Moving a job to the tier system
83+
// or moving it between tiers should not affect anything else about the job
84+
// definition
85+
is_gate_target(target): target == 'gate' || std.startsWith(target, 'tier'),
86+
87+
target_to_prefix(target):
88+
if $.is_gate_target(target) then
89+
'gate'
90+
else
91+
target,
92+
7893
// Base Task specification
7994
job(suite, suite_short=suite, os_arch_mapping=$.default_os_arch): os_arch_jdk_mixin(os_arch_mapping) + r.task_spec(common.catch_test_failures + common.svm {
8095
// These 4 are provided by the run-spec library
@@ -94,7 +109,7 @@ local os_arch_jdk_mixin(mapping) = r.task_spec(r.evaluate_late({
94109
setup+: [
95110
['cd', './' + suite],
96111
],
97-
name: std.join('-', [self.target, self.suite_short, self.task_name] + self.variations + [self.os, self.arch, self.jdk]),
112+
name: std.join('-', [$.target_to_prefix(self.target), self.suite_short, self.task_name] + self.variations + [self.os, self.arch, self.jdk]),
98113
}),
99114

100115
// Get all web image flags in the given job

0 commit comments

Comments
 (0)