Skip to content

Commit

Permalink
Refactor backup tests (kyma-project#1926)
Browse files Browse the repository at this point in the history
  • Loading branch information
Suleyman Akbas authored Jan 15, 2020
1 parent 4e70f6a commit 3315d6c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 53 deletions.
2 changes: 1 addition & 1 deletion development/tools/jobs/kyma/kyma_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestKymaBackupTestJobPresubmit(t *testing.T) {
// then
assert.True(t, actualJob.Decorate)
assert.False(t, actualJob.Optional)
assert.Equal(t, "^((resources/backup\\S+|tests/end-to-end/backup-restore-test/deploy/chart/backup-test/\\S+)(\\.[^.][^.][^.]+$|\\.[^.][^dD]$|\\.[^mM][^.]$|\\.[^.]$|/[^.]+$))", actualJob.RunIfChanged)
assert.Equal(t, "^((resources/backup\\S+|tests/end-to-end/backup/chart/backup-test/\\S+)(\\.[^.][^.][^.]+$|\\.[^.][^dD]$|\\.[^mM][^.]$|\\.[^.]$|/[^.]+$))", actualJob.RunIfChanged)
tester.AssertThatHasPresets(t, actualJob.JobBase, preset.KymaBackupRestoreBucket, preset.KymaBackupCredentials, preset.GCProjectEnv, preset.BuildPr,
preset.SaGKEKymaIntegration, "preset-weekly-github-integration")
tester.AssertThatHasExtraRefTestInfra(t, actualJob.JobBase.UtilityConfig, "master")
Expand Down
9 changes: 3 additions & 6 deletions development/tools/jobs/kyma/tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ var tests = []struct {
jobsuite.RunIfChanged("components/console-backend-service/main.go", "scripts/go-dep.mk"),
},
},
{path: "end-to-end/backup-restore-test", image: tester.ImageGolangBuildpack1_11,
additionalOptions: []jobsuite.Option{
jobsuite.Until(releases.Release18),
}},
{path: "end-to-end/external-solution-integration", image: tester.ImageGolangBuildpack1_11},
{path: "end-to-end/upgrade", image: tester.ImageBootstrap20181204, suite: tester.NewGenericComponentSuite, additionalOptions: []jobsuite.Option{
jobsuite.RunIfChanged("^tests/end-to-end/upgrade/[^chart]", "tests/end-to-end/upgrade/fix"),
Expand Down Expand Up @@ -173,10 +169,11 @@ var tests = []struct {
jobsuite.Since(releases.Release19),
},
},
{path: "end-to-end/backup-restore-test", image: tester.ImageBootstrap20181204, suite: tester.NewGenericComponentSuite,
{path: "end-to-end/backup", image: tester.ImageBootstrap20181204, suite: tester.NewGenericComponentSuite,
additionalOptions: []jobsuite.Option{
jobsuite.JobFileSuffix("generic"),
jobsuite.Since(releases.Release19),
jobsuite.Since(releases.Release110),
jobsuite.Optional(),
},
},
{path: "knative-build", image: tester.ImageGolangBuildpack1_11,
Expand Down
2 changes: 1 addition & 1 deletion prow/jobs/kyma/kyma-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ presubmits: # runs on PRs
- ^master$
<<: *gke_backup_job_template
# following regexp won't start build if only Markdown files were changed
run_if_changed: "^((resources/backup\\S+|tests/end-to-end/backup-restore-test/deploy/chart/backup-test/\\S+)(\\.[^.][^.][^.]+$|\\.[^.][^dD]$|\\.[^mM][^.]$|\\.[^.]$|/[^.]+$))"
run_if_changed: "^((resources/backup\\S+|tests/end-to-end/backup/chart/backup-test/\\S+)(\\.[^.][^.][^.]+$|\\.[^.][^dD]$|\\.[^mM][^.]$|\\.[^.]$|/[^.]+$))"
labels:
preset-build-pr: "true"
<<: *gke_backup_job_labels_template
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ job_template: &job_template
preset-dind-enabled: "true"
preset-sa-gcr-push: "true"
preset-docker-push-repository-kyma: "true"
prow.kyma-project.io/slack.skipReport: "true"
extra_refs:
- <<: *test_infra_ref
base_ref: master
branches:
- ^master$
- ^release-(1\.9)-backup-restore-test$
run_if_changed: "^tests/end-to-end/backup-restore-test/|^common/makefiles/"
run_if_changed: "^tests/end-to-end/backup/|^common/makefiles/"
spec:
containers:
- image: eu.gcr.io/kyma-project/prow/test-infra/bootstrap:v20181204-a6e79be
Expand All @@ -29,20 +29,20 @@ job_template: &job_template
command:
- "/home/prow/go/src/github.com/kyma-project/test-infra/prow/scripts/build-generic.sh"
args:
- "/home/prow/go/src/github.com/kyma-project/kyma/tests/end-to-end/backup-restore-test"
- "/home/prow/go/src/github.com/kyma-project/kyma/tests/end-to-end/backup"
resources:
requests:
memory: 1.5Gi
cpu: 0.8

presubmits: # runs on PRs
kyma-project/kyma:
- name: pre-kyma-tests-end-to-end-backup-restore-test
- name: pre-kyma-tests-end-to-end-backup
skip_report: false
optional: false
optional: true
<<: *job_template

postsubmits:
kyma-project/kyma:
- name: post-kyma-tests-end-to-end-backup-restore-test
- name: post-kyma-tests-end-to-end-backup
<<: *job_template
12 changes: 4 additions & 8 deletions templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,12 @@ templates:
<<: *kyma_generic_component
path: tests/knative-serving
since: "1.9"
- to: ../prow/jobs/kyma/tests/end-to-end/backup-restore-test/backup-restore-test-generic.yaml
- to: ../prow/jobs/kyma/tests/end-to-end/backup/backup-generic.yaml
values:
<<: *kyma_generic_component
path: tests/end-to-end/backup-restore-test
since: "1.9"
path: tests/end-to-end/backup
since: "1.10"
optional: true
- to: ../prow/jobs/kyma/tests/rafter/rafter-tests-generic.yaml
values:
<<: *kyma_generic_component
Expand Down Expand Up @@ -743,11 +744,6 @@ templates:
values:
<<: *go_kyma_component_1_11
path: tests/end-to-end/external-solution-integration
- to: ../prow/jobs/kyma/tests/end-to-end/backup-restore-test/backup-restore-test.yaml
values:
<<: *go_kyma_component_1_11
path: tests/end-to-end/backup-restore-test
until: "1.8"
- to: ../prow/jobs/kyma/tests/integration/dex/dex-tests.yaml
values:
<<: *go_kyma_component_1_12
Expand Down
2 changes: 1 addition & 1 deletion templates/templates/kyma-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ presubmits: # runs on PRs
- ^master$
<<: *gke_backup_job_template
# following regexp won't start build if only Markdown files were changed
run_if_changed: "^((resources/backup\\S+|tests/end-to-end/backup-restore-test/deploy/chart/backup-test/\\S+)(\\.[^.][^.][^.]+$|\\.[^.][^dD]$|\\.[^mM][^.]$|\\.[^.]$|/[^.]+$))"
run_if_changed: "^((resources/backup\\S+|tests/end-to-end/backup/chart/backup-test/\\S+)(\\.[^.][^.][^.]+$|\\.[^.][^dD]$|\\.[^mM][^.]$|\\.[^.]$|/[^.]+$))"
labels:
preset-build-pr: "true"
<<: *gke_backup_job_labels_template
Expand Down

0 comments on commit 3315d6c

Please sign in to comment.