Skip to content

Commit 313672c

Browse files
committed
Update Unit Tests for EnableSamplePipeline
1 parent cbf76c8 commit 313672c

File tree

9 files changed

+62
-4
lines changed

9 files changed

+62
-4
lines changed

config/internal/apiserver/deployment.yaml.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,3 @@ spec:
211211
configMap:
212212
name: sample-pipeline-{{.Name}}
213213
{{ end }}
214-

config/internal/apiserver/sample-config.yaml.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ data:
1515
"file": "/samples/iris-pipeline-compiled.yaml"
1616
}
1717
]
18-

controllers/dspipeline_controller_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var cases = map[string]TestCase{
5555
Path: "./testdata/deploy/case_2/cr.yaml",
5656
},
5757
"case_3": {
58-
Description: "custom Artifact configmap is provided, custom images override defaults",
58+
Description: "custom Artifact configmap is provided, custom images override defaults, no sample pipeline",
5959
Path: "./testdata/deploy/case_3/cr.yaml",
6060
AdditionalResources: map[string][]string{
6161
SecretKind: {
@@ -110,7 +110,9 @@ var secretsCreated = CaseComponentResources{
110110

111111
var configMapsNotCreated = CaseComponentResources{
112112
"case_3": {
113-
"apiserver": "./testdata/results/case_3/apiserver/configmap_artifact_script.yaml",
113+
"apiserver": "./testdata/results/case_3/apiserver/configmap_artifact_script.yaml",
114+
"apiserver-sampleconfig": "./testdata/results/case_3/apiserver/sample-config.yaml",
115+
"apiserver-samplepipeline": "./testdata/results/case_3/apiserver/sample-pipeline.yaml",
114116
},
115117
}
116118

controllers/testdata/deploy/case_2/cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
injectDefaultScript: true
1515
stripEOF: true
1616
enableOauth: true
17+
enableSamplePipeline: true
1718
terminateStatus: Cancelled
1819
trackArtifacts: true
1920
dbConfigConMaxLifetimeSec: 125

controllers/testdata/deploy/case_3/cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata:
55
spec:
66
apiServer:
77
enableOauth: true
8+
enableSamplePipeline: false
89
artifactScriptConfigMap:
910
name: doesnotexist
1011
key: "somekey"

controllers/testdata/results/case_0/apiserver/deployment.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,24 @@ spec:
179179
limits:
180180
cpu: 500m
181181
memory: 1Gi
182+
volumeMounts:
183+
- mountPath: /config/sample_config.json
184+
name: sample-config
185+
subPath: sample_config.json
186+
- mountPath: /samples/
187+
name: sample-pipeline
182188
volumes:
183189
- name: proxy-tls
184190
secret:
185191
secretName: ds-pipelines-proxy-tls-testdsp0
186192
defaultMode: 420
193+
- configMap:
194+
defaultMode: 420
195+
name: sample-config-testdsp0
196+
name: sample-config
197+
- configMap:
198+
defaultMode: 420
199+
name: sample-pipeline-testdsp0
200+
name: sample-pipeline
201+
187202
serviceAccountName: ds-pipeline-testdsp0

controllers/testdata/results/case_2/apiserver/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,23 @@ spec:
179179
limits:
180180
cpu: 2522m
181181
memory: 5Gi
182+
volumeMounts:
183+
- mountPath: /config/sample_config.json
184+
name: sample-config
185+
subPath: sample_config.json
186+
- mountPath: /samples/
187+
name: sample-pipeline
182188
volumes:
183189
- name: proxy-tls
184190
secret:
185191
secretName: ds-pipelines-proxy-tls-testdsp2
186192
defaultMode: 420
193+
- configMap:
194+
defaultMode: 420
195+
name: sample-config-testdsp2
196+
name: sample-config
197+
- configMap:
198+
defaultMode: 420
199+
name: sample-pipeline-testdsp2
200+
name: sample-pipeline
187201
serviceAccountName: ds-pipeline-testdsp2
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
data:
3+
sample_config.json: |-
4+
[
5+
{
6+
"name": "[Demo] iris-training",
7+
"description": "[source code](https://github.com/opendatahub-io/data-science-pipelines/tree/master/samples/iris-training) A simple pipeline to demonstrate a basic ML Training workflow",
8+
"file": "/samples/iris-pipeline-compiled.yaml"
9+
"file": "/samples/iris-pipeline-compiled.yaml"
10+
}
11+
]
12+
13+
kind: ConfigMap
14+
metadata:
15+
name: sample-config-testdsp3
16+
namespace: default
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: sample-pipeline-testdsp3
5+
namespace: default
6+
data:
7+
sample-pipeline.yaml: |-
8+
pipeline: placeholder
9+
reason: |-
10+
we're not actually checking the contents here,
11+
just verifying the CM itself doesn't exist in this test

0 commit comments

Comments
 (0)