Skip to content

Commit

Permalink
SONAR-24169 Splits test on kind into multiple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davividal authored Jan 20, 2025
1 parent 5f2bec0 commit 778abc4
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 36 deletions.
25 changes: 0 additions & 25 deletions .cirrus/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@ chart_fixture_test_task:
- ./.cirrus/generate_helm_fixtures.sh
- git diff --exit-code

chart_testing_on_kind_task:
<<: *ONLY_ON_NON_RELEASE_DRAFT_TEMPLATE
skip: "!changesInclude('charts/**/*', '.cirrus/*')"
timeout_in: 1h
ec2_instance:
<<: *VM_TEMPLATE
<<: *CLONE_SCRIPT_TEMPLATE
setup_script:
- ./.cirrus/setup_kind_vm.sh
- kind create cluster
- kubectl cluster-info --context kind-kind
- kubectl get nodes
- kubectl create namespace test --dry-run=client -o yaml | kubectl apply -f -
- kubectl create secret docker-registry pullsecret --namespace test --docker-username=${DOCKER_USERNAME} --docker-password=${DOCKER_PASSWORD} --dry-run=client -o yaml | kubectl apply -f -
script:
- ct lint --config test.yaml --all
- ct install --namespace test --config test.yaml --all --debug
teardown_script:
- kind delete cluster
artifacthub_lint_script:
- ah lint
depends_on:
- sonarqube_chart_static_compatibility_test
- sonarqube_dce_chart_static_compatibility_test

chart_schema_test_task:
skip: "!changesInclude('charts/**/*', '.cirrus/schema_test.sh', 'tests/unit-test/*', 'tests/unit-test/**/*')"
eks_container:
Expand Down
22 changes: 17 additions & 5 deletions .cirrus/tasks_sonarqube.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
SKIP_IF_NOT_SONARQUBE: &SKIP_IF_NOT_SONARQUBE
skip: "!changesInclude('charts/sonarqube/*', 'charts/sonarqube/**/*', 'tests/unity-compatibility-test/sonarqube/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"

sonarqube_chart_static_compatibility_test_task:
<<: *CHART_STATIC_COMPATIBILITY_TEST_TEMPLATE
skip: "!changesInclude('charts/sonarqube/*', 'charts/sonarqube/**/*', 'tests/unity-compatibility-test/sonarqube/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE
script:
- ./.cirrus/build_chart_dependencies.sh charts/sonarqube
- ./.cirrus/unit_helm_compatibility_test.sh sonarqube

chart_testing_on_openshift_sonarqube_task:
<<: *CHART_TESTING_ON_OPENSHIFT_TEMPLATE
skip: "!changesInclude('charts/sonarqube/*', 'charts/sonarqube/**/*', 'tests/unity-compatibility-test/sonarqube/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE
env:
- VERIFYING_CHART: sonarqube
depends_on:
- sonarqube_chart_static_compatibility_test

chart_testing_on_kind_sonarqube_task:
<<: *CHART_TESTING_ON_KIND_TEMPLATE
<<: *SKIP_IF_NOT_SONARQUBE
script:
- ct lint --config ct-sonarqube-test.yaml --all
- ct install --namespace test --config ct-sonarqube-test.yaml --all --debug
depends_on:
- sonarqube_chart_static_compatibility_test

sonarqube_chart_packaging_task:
<<: *CHART_PACKAGING_TASK_TEMPLATE
skip: "!changesInclude('charts/sonarqube/*', 'charts/sonarqube/**/*', 'tests/unity-compatibility-test/sonarqube/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE
script:
- source cirrus-env BUILD
- ./.cirrus/package.sh sonarqube
- ./.cirrus/sign_chart.sh sonarqube
depends_on:
- chart_testing_on_kind
- chart_testing_on_kind_sonarqube
- chart_testing_on_openshift_sonarqube

sonarqube_push_to_repox_task:
<<: *PUSH_TO_REPOX_TASK_TEMPLATE
skip: "!changesInclude('charts/sonarqube/*', 'charts/sonarqube/**/*', 'tests/unity-compatibility-test/sonarqube/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE
script:
- source cirrus-env ""
- ./.cirrus/upload_chart.sh sonarqube
Expand Down
22 changes: 17 additions & 5 deletions .cirrus/tasks_sonarqube_dce.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
SKIP_IF_NOT_SONARQUBE_DCE: &SKIP_IF_NOT_SONARQUBE_DCE
skip: "!changesInclude('charts/sonarqube-dce/*', 'charts/sonarqube-dce/**/*', 'tests/unity-compatibility-test/sonarqube-dce/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube_dce,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"

sonarqube_dce_chart_static_compatibility_test_task:
<<: *CHART_STATIC_COMPATIBILITY_TEST_TEMPLATE
skip: "!changesInclude('charts/sonarqube-dce/*', 'charts/sonarqube-dce/**/*', 'tests/unity-compatibility-test/sonarqube-dce/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube_dce,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE_DCE
script:
- ./.cirrus/build_chart_dependencies.sh charts/sonarqube-dce
- ./.cirrus/unit_helm_compatibility_test.sh sonarqube-dce

chart_testing_on_openshift_sonarqube_dce_task:
<<: *CHART_TESTING_ON_OPENSHIFT_TEMPLATE
skip: "!changesInclude('charts/sonarqube-dce/*', 'charts/sonarqube-dce/**/*', 'tests/unity-compatibility-test/sonarqube-dce/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube_dce,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE_DCE
env:
- VERIFYING_CHART: sonarqube-dce
depends_on:
- sonarqube_dce_chart_static_compatibility_test

chart_testing_on_kind_sonarqube_dce_task:
<<: *CHART_TESTING_ON_KIND_TEMPLATE
<<: *SKIP_IF_NOT_SONARQUBE_DCE
script:
- ct lint --config ct-sonarqube-dce-test.yaml --all
- ct install --namespace test --config ct-sonarqube-dce-test.yaml --all --debug
depends_on:
- sonarqube_dce_chart_static_compatibility_test

sonarqube_dce_chart_packaging_task:
<<: *CHART_PACKAGING_TASK_TEMPLATE
skip: "!changesInclude('charts/sonarqube-dce/*', 'charts/sonarqube-dce/**/*', 'tests/unity-compatibility-test/sonarqube-dce/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube_dce,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE_DCE
script:
- source cirrus-env BUILD
- ./.cirrus/package.sh sonarqube-dce
- ./.cirrus/sign_chart.sh sonarqube-dce
depends_on:
- chart_testing_on_kind
- chart_testing_on_kind_sonarqube_dce
- chart_testing_on_openshift_sonarqube_dce

sonarqube_dce_push_to_repox_task:
<<: *PUSH_TO_REPOX_TASK_TEMPLATE
skip: "!changesInclude('charts/sonarqube-dce/*', 'charts/sonarqube-dce/**/*', 'tests/unity-compatibility-test/sonarqube-dce/*', '.cirrus/*.sh', '.cirrus/tasks{_sonarqube_dce,_templates,}.yml', '.cirrus/tasks.star', '.cirrus.star')"
<<: *SKIP_IF_NOT_SONARQUBE_DCE
script:
- source cirrus-env ""
- ./.cirrus/upload_chart.sh sonarqube-dce
Expand Down
17 changes: 17 additions & 0 deletions .cirrus/tasks_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ chart_testing_on_openshif: &CHART_TESTING_ON_OPENSHIFT_TEMPLATE
cleanup_script:
- oc delete project "${VERIFYING_CHART}"

chart_testing_on_kind: &CHART_TESTING_ON_KIND_TEMPLATE
<<: *ONLY_ON_NON_RELEASE_DRAFT_TEMPLATE
skip: "!changesInclude('charts/**/*', '.cirrus/*')"
timeout_in: 1h
ec2_instance:
<<: *VM_TEMPLATE
<<: *CLONE_SCRIPT_TEMPLATE
setup_script:
- ./.cirrus/setup_kind_vm.sh
- kind create cluster
- kubectl cluster-info --context kind-kind
- kubectl get nodes
- kubectl create namespace test --dry-run=client -o yaml | kubectl apply -f -
- kubectl create secret docker-registry pullsecret --namespace test --docker-username=${DOCKER_USERNAME} --docker-password=${DOCKER_PASSWORD} --dry-run=client -o yaml | kubectl apply -f -
artifacthub_lint_script:
- ah lint

chart_packaging: &CHART_PACKAGING_TASK_TEMPLATE
<<: *ONLY_ON_NON_RELEASE_DRAFT_TEMPLATE
timeout_in: 15m
Expand Down
9 changes: 9 additions & 0 deletions ct-sonarqube-dce-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
chart-dirs:
- charts/
chart: sonarqube-dce
chart-repos:
- bitnami-pre2022=https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
- ingress-nginx=https://kubernetes.github.io/ingress-nginx
helm-extra-args: --timeout 600s --debug
3 changes: 2 additions & 1 deletion test.yaml → ct-sonarqube-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
chart-dirs:
- charts
- charts/
chart: sonarqube
chart-repos:
- bitnami-pre2022=https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
- ingress-nginx=https://kubernetes.github.io/ingress-nginx
Expand Down

0 comments on commit 778abc4

Please sign in to comment.