Skip to content

Commit 2bc1630

Browse files
hisarbalika-thaler
authored andcommitted
console app log-ui CI job, initial commit (kyma-project#587)
1 parent 322093c commit 2bc1630

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package console_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/kyma-project/test-infra/development/tools/jobs/tester"
7+
"github.com/stretchr/testify/assert"
8+
"github.com/stretchr/testify/require"
9+
)
10+
11+
func TestLogUIJobPresubmit(t *testing.T) {
12+
// WHEN
13+
jobConfig, err := tester.ReadJobConfig("./../../../../prow/jobs/console/log-ui/log-ui.yaml")
14+
// THEN
15+
require.NoError(t, err)
16+
17+
assert.Len(t, jobConfig.Presubmits, 1)
18+
kymaPresubmits, ex := jobConfig.Presubmits["kyma-project/console"]
19+
assert.True(t, ex)
20+
assert.Len(t, kymaPresubmits, 1)
21+
22+
expName := "pre-master-console-log-ui"
23+
actualPresubmit := tester.FindPresubmitJobByName(kymaPresubmits, expName, "master")
24+
require.NotNil(t, actualPresubmit)
25+
assert.Equal(t, expName, actualPresubmit.Name)
26+
assert.Equal(t, []string{"master"}, actualPresubmit.Branches)
27+
assert.Equal(t, 10, actualPresubmit.MaxConcurrency)
28+
assert.False(t, actualPresubmit.SkipReport)
29+
assert.True(t, actualPresubmit.Decorate)
30+
assert.False(t, actualPresubmit.Optional)
31+
assert.Equal(t, "github.com/kyma-project/console", actualPresubmit.PathAlias)
32+
tester.AssertThatHasExtraRefTestInfra(t, actualPresubmit.JobBase.UtilityConfig, "master")
33+
tester.AssertThatHasPresets(t, actualPresubmit.JobBase, tester.PresetDindEnabled, tester.PresetDockerPushRepo, tester.PresetGcrPush, tester.PresetBuildPr)
34+
assert.Equal(t, "^log-ui/", actualPresubmit.RunIfChanged)
35+
tester.AssertThatJobRunIfChanged(t, *actualPresubmit, "log-ui/some_random_file.js")
36+
assert.Equal(t, tester.ImageNodeBuildpackLatest, actualPresubmit.Spec.Containers[0].Image)
37+
assert.Equal(t, []string{"/home/prow/go/src/github.com/kyma-project/test-infra/prow/scripts/build.sh"}, actualPresubmit.Spec.Containers[0].Command)
38+
assert.Equal(t, []string{"/home/prow/go/src/github.com/kyma-project/console/log-ui"}, actualPresubmit.Spec.Containers[0].Args)
39+
}
40+
41+
func TestLogUIJobPostsubmit(t *testing.T) {
42+
// WHEN
43+
jobConfig, err := tester.ReadJobConfig("./../../../../prow/jobs/console/log-ui/log-ui.yaml")
44+
// THEN
45+
require.NoError(t, err)
46+
47+
assert.Len(t, jobConfig.Postsubmits, 1)
48+
kymaPost, ex := jobConfig.Postsubmits["kyma-project/console"]
49+
assert.True(t, ex)
50+
assert.Len(t, kymaPost, 1)
51+
52+
expName := "post-master-console-log-ui"
53+
actualPost := tester.FindPostsubmitJobByName(kymaPost, expName, "master")
54+
require.NotNil(t, actualPost)
55+
assert.Equal(t, expName, actualPost.Name)
56+
assert.Equal(t, []string{"master"}, actualPost.Branches)
57+
58+
assert.Equal(t, 10, actualPost.MaxConcurrency)
59+
assert.True(t, actualPost.Decorate)
60+
assert.Equal(t, "github.com/kyma-project/console", actualPost.PathAlias)
61+
tester.AssertThatHasExtraRefTestInfra(t, actualPost.JobBase.UtilityConfig, "master")
62+
tester.AssertThatHasPresets(t, actualPost.JobBase, tester.PresetDindEnabled, tester.PresetDockerPushRepo, tester.PresetGcrPush, tester.PresetBuildConsoleMaster)
63+
assert.Equal(t, "^log-ui/", actualPost.RunIfChanged)
64+
assert.Equal(t, tester.ImageNodeBuildpackLatest, actualPost.Spec.Containers[0].Image)
65+
assert.Equal(t, []string{"/home/prow/go/src/github.com/kyma-project/test-infra/prow/scripts/build.sh"}, actualPost.Spec.Containers[0].Command)
66+
assert.Equal(t, []string{"/home/prow/go/src/github.com/kyma-project/console/log-ui"}, actualPost.Spec.Containers[0].Args)
67+
}

prow/jobs/console/log-ui/log-ui.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
job_template: &job_template
2+
skip_report: false
3+
run_if_changed: "^log-ui/"
4+
decorate: true
5+
path_alias: github.com/kyma-project/console
6+
max_concurrency: 10
7+
extra_refs:
8+
- org: kyma-project
9+
repo: test-infra
10+
base_ref: master
11+
path_alias: github.com/kyma-project/test-infra
12+
spec:
13+
containers:
14+
- image: eu.gcr.io/kyma-project/prow/test-infra/buildpack-node:v20181130-b28250b
15+
securityContext:
16+
privileged: true
17+
command:
18+
- "/home/prow/go/src/github.com/kyma-project/test-infra/prow/scripts/build.sh"
19+
args:
20+
- "/home/prow/go/src/github.com/kyma-project/console/log-ui"
21+
resources:
22+
requests:
23+
memory: 1.5Gi
24+
cpu: 0.8
25+
26+
job_labels_template: &job_labels_template
27+
preset-dind-enabled: "true"
28+
preset-sa-gcr-push: "true"
29+
preset-docker-push-repository: "true"
30+
31+
presubmits: # runs on PRs
32+
kyma-project/console:
33+
- name: pre-master-console-log-ui
34+
branches:
35+
- master
36+
labels:
37+
<<: *job_labels_template
38+
preset-build-pr: "true"
39+
<<: *job_template
40+
41+
postsubmits:
42+
kyma-project/console:
43+
- name: post-master-console-log-ui
44+
branches:
45+
- master
46+
<<: *job_template
47+
labels:
48+
<<: *job_labels_template
49+
preset-build-console-master: "true"

0 commit comments

Comments
 (0)