Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions cmd/ci-operator-prowgen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,73 @@ tests:
requests:
cpu: 10m
serviceAccountName: ci-operator
`),
}, {
id: "Custom test timeout",
org: "super",
component: "duper",
branch: "branch",
configYAML: []byte(`base_images:
base:
name: origin-v3.11
namespace: openshift
tag: base
images:
- from: base
to: service-serving-cert-signer
resources:
'*':
limits:
cpu: 500Mi
requests:
cpu: 10Mi
tag_specification:
name: origin-v3.11
namespace: openshift
tag: ''
promotion:
name: test
namespace: ci
build_root:
image_stream_tag:
namespace: openshift
name: release
tag: golang-1.10
tests:
- as: unit
timeout: 8h
steps:
test:
- as: test
commands: make unit
from: src
resources:
requests:
cpu: 100m
workflow: ipi-aws
`),
prowOldPresubmitYAML: []byte(""),
prowOldPostsubmitYAML: []byte(`postsubmits:
super/duper:
- agent: kubernetes
decorate: true
decoration_config:
skip_cloning: true
name: branch-ci-super-duper-branch-do-not-overwrite
spec:
containers:
- args:
- --give-pr-author-access-to-namespace=true
- --target=unit
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
serviceAccountName: ci-operator
`),
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
postsubmits:
super/duper:
- agent: kubernetes
decorate: true
decoration_config:
skip_cloning: true
name: branch-ci-super-duper-branch-do-not-overwrite
spec:
containers:
- args:
- --give-pr-author-access-to-namespace=true
- --target=unit
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
serviceAccountName: ci-operator
- agent: kubernetes
branches:
- ^branch$
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/is-promotion: "true"
ci-operator.openshift.io/prowgen-controlled: "true"
max_concurrency: 1
name: branch-ci-super-duper-branch-images
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --image-mirror-push-secret=/etc/push-secret/.dockerconfigjson
- --promote
- --report-credentials-file=/etc/report/credentials
- --target=[images]
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/push-secret
name: push-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: push-secret
secret:
secretName: registry-push-credentials-ci-central
- name: result-aggregator
secret:
secretName: result-aggregator
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
presubmits:
super/duper:
- agent: kubernetes
always_run: true
branches:
- ^branch$
- ^branch-
context: ci/prow/images
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/prowgen-controlled: "true"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-super-duper-branch-images
rerun_command: /test images
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --report-credentials-file=/etc/report/credentials
- --target=[images]
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )images,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
- ^branch$
- ^branch-
context: ci/prow/unit
decorate: true
decoration_config:
skip_cloning: true
timeout: 8h0m0s
labels:
ci-operator.openshift.io/prowgen-controlled: "true"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-super-duper-branch-unit
rerun_command: /test unit
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --report-credentials-file=/etc/report/credentials
- --target=unit
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )unit,?($|\s.*)
6 changes: 6 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ type TestStepConfiguration struct {
// SkipIfOnlyChanged is a regex that will result in the test being skipped if all changed files match that regex.
SkipIfOnlyChanged string `json:"skip_if_only_changed,omitempty"`

// Timeout overrides maximum prowjob duration
Timeout *prowv1.Duration `json:"timeout,omitempty"`

// Only one of the following can be not-null.
ContainerTestConfiguration *ContainerTestConfiguration `json:"container,omitempty"`
MultiStageTestConfiguration *MultiStageTestConfiguration `json:"steps,omitempty"`
Expand Down Expand Up @@ -1016,6 +1019,9 @@ type MultiStageTestConfigurationLiteral struct {
// DependencyOverrides allows a step to override a dependency with a fully-qualified pullspec. This will probably only ever
// be used with rehearsals. Otherwise, the overrides should be passed in as parameters to ci-operator.
DependencyOverrides DependencyOverrides `json:"dependency_overrides,omitempty"`

// Override job timeout
Timeout *prowv1.Duration `json:"timeout,omitempty"`
}

// TestEnvironment has the values of parameters for multi-stage tests.
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading