Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create lint and test CI for helm charts #357

Merged
merged 23 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4b8752e
Create CI for charts package
RafalKorepta Dec 12, 2024
a91fdd1
Add genpartial to go work
RafalKorepta Dec 12, 2024
8961b27
Add type.Alias to genpartial
RafalKorepta Dec 12, 2024
d051200
Add gotohelm to go workspace
RafalKorepta Dec 12, 2024
1ceb025
Add genschema to go workspace
RafalKorepta Dec 12, 2024
96feee8
Re-run charts generators
RafalKorepta Dec 12, 2024
d205ec3
Re-run task charts:lint
RafalKorepta Dec 12, 2024
3c7c830
Use gotestsum for CI
RafalKorepta Dec 13, 2024
69a763d
Split charts test using buildkite matrix
RafalKorepta Dec 13, 2024
9dfbf30
Handle types.Array in genpartial
RafalKorepta Dec 13, 2024
ce74123
Remove from generated golden file license header
RafalKorepta Dec 13, 2024
ed7a4ac
Remove GOFLAGS and GOPRIVATE from taskfile definition
RafalKorepta Dec 13, 2024
526091a
Move operator lint to pkg/lint package
RafalKorepta Dec 13, 2024
4c63145
Fix all golangci-lint errors
RafalKorepta Dec 13, 2024
e50f594
Remove unused pipeline step
RafalKorepta Dec 13, 2024
a8bb910
Split operator unit tests and kuttle e2e tests
RafalKorepta Dec 13, 2024
43a5676
Re-arrange buildkite pipeline
RafalKorepta Dec 16, 2024
7279107
Increase timeout for k3d cluster creation
RafalKorepta Dec 16, 2024
918aa44
Bump rpadmin library
RafalKorepta Dec 16, 2024
94cb53d
Bump spdy depedency
RafalKorepta Dec 16, 2024
3853882
Move 3 integration tests to specific go build tags and change test na…
RafalKorepta Dec 16, 2024
7b49eb0
Change gotestsum to normal go test
RafalKorepta Dec 16, 2024
aa93ca4
Re-add operator v2 e2e test stub to pass Github required check
RafalKorepta Dec 17, 2024
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
44 changes: 44 additions & 0 deletions .buildkite/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
steps:
- group: integration-tests
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
steps:
- key: integration-tests
label: Integration tests
timeout_in_minutes: 180
notify:
- github_commit_status:
context: integration-tests
commands:
- |
./ci/scripts/run-in-nix-docker.sh task ci:integration-test
agents:
queue: v6-amd64-builders-m6id
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/github_api_token
- secret-id: sdlc/prod/buildkite/redpanda_sample_license
- secret-id: sdlc/prod/buildkite/redpanda_second_sample_license
- secret-id: sdlc/prod/buildkite/slack_vbot_token
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: integration tests Jobs failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
- key: annotate-operator-tests
label: "Parse integration tests"
plugins:
- junit-annotate#v2.4.1:
artifacts: "work/integration-tests.xml"
report-slowest: 20
timeout_in_minutes: 0
agents:
queue: pipeline-uploader
depends_on: integration-tests
allow_dependency_failure: true
45 changes: 45 additions & 0 deletions .buildkite/operator-e2e-tests-with-flags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
steps:
- key: k8s-operator-tests-with-flags
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
label: K8s Operator tests with flags
timeout_in_minutes: 180
notify:
- github_commit_status:
context: k8s-operator-tests-with-flags
commands:
- |
TAG_NAME=$(ci/scripts/tag-check.sh) ./ci/scripts/run-in-nix-docker.sh task ci:run-k8s-tests-with-flags
agents:
queue: v6-amd64-builders-m6id
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/active_directory
- secret-id: sdlc/prod/buildkite/buildkite_analytics_token
- secret-id: sdlc/prod/buildkite/buildkite_api_token
- secret-id: sdlc/prod/buildkite/cdt_gcp
- secret-id: sdlc/prod/buildkite/cdt_runner_aws
- secret-id: sdlc/prod/buildkite/ci_db
- secret-id: sdlc/prod/buildkite/cloudsmith
- secret-id: sdlc/prod/buildkite/dockerhub
- secret-id: sdlc/prod/buildkite/gh_token
- secret-id: sdlc/prod/buildkite/github_api_token
- secret-id: sdlc/prod/buildkite/grafana_token
- secret-id: sdlc/prod/buildkite/redpanda_sample_license
- secret-id: sdlc/prod/buildkite/redpanda_second_sample_license
- secret-id: sdlc/prod/buildkite/rpk_test_client
- secret-id: sdlc/prod/buildkite/seceng_audit_aws
- secret-id: sdlc/prod/buildkite/slack_vbot_token
- secret-id: sdlc/prod/buildkite/teleport_bot_token
- secret-id: sdlc/prod/buildkite/test_result_dsn
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: K8s Operator tests with flags Job failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
58 changes: 58 additions & 0 deletions .buildkite/operator-v2-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
steps:
- group: K8s Operator v2 Jobs
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
steps:
- key: k8s-operator-v2
label: Operator v2 e2e tests
timeout: 100
notify:
- github_commit_status:
context: k8s-operator-v2
commands:
- ./ci/scripts/run-in-nix-docker.sh task ci:k8s-v2
agents:
queue: v6-amd64-builders-m6id
plugins:
- seek-oss/aws-sm#v2.3.2: &aws-sm-plugin
json-to-env:
- secret-id: sdlc/prod/buildkite/active_directory
- secret-id: sdlc/prod/buildkite/buildkite_analytics_token
- secret-id: sdlc/prod/buildkite/buildkite_api_token
- secret-id: sdlc/prod/buildkite/cdt_gcp
- secret-id: sdlc/prod/buildkite/cdt_runner_aws
- secret-id: sdlc/prod/buildkite/ci_db
- secret-id: sdlc/prod/buildkite/cloudsmith
- secret-id: sdlc/prod/buildkite/dockerhub
- secret-id: sdlc/prod/buildkite/gh_token
- secret-id: sdlc/prod/buildkite/github_api_token
- secret-id: sdlc/prod/buildkite/grafana_token
- secret-id: sdlc/prod/buildkite/redpanda_sample_license
- secret-id: sdlc/prod/buildkite/redpanda_second_sample_license
- secret-id: sdlc/prod/buildkite/rpk_test_client
- secret-id: sdlc/prod/buildkite/seceng_audit_aws
- secret-id: sdlc/prod/buildkite/slack_vbot_token
- secret-id: sdlc/prod/buildkite/teleport_bot_token
- secret-id: sdlc/prod/buildkite/test_result_dsn
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: K8s Operator v2 Jobs failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
- key: annotate-v2-testresults
label: Parse Operator v2 e2e Test Results
plugins:
- seek-oss/aws-sm#v2.3.2: *aws-sm-plugin
- junit-annotate#v2.4.1:
artifacts: work/operator/tests/_e2e_artifacts_v2/kuttl-report.xml
report-slowest: 5
timeout_in_minutes: 0
agents:
queue: pipeline-uploader
depends_on: k8s-operator-v2
allow_dependency_failure: true
157 changes: 36 additions & 121 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
label: ":gandalf: Nightly Operator release"
timeout_in_minutes: 10
agents:
queue: v6-amd64-builders
queue: k8s-builders
commands:
- |
TAG_NAME=$(ci/scripts/tag-check.sh) ./ci/scripts/run-in-nix-docker.sh task ci:publish-k8s-nightly-artifacts
Expand All @@ -38,64 +38,53 @@ steps:
branches:
- main

- key: k8s-operator
label: K8s Operator
timeout_in_minutes: 180
if: build.env("NIGHTLY_RELEASE") != "true"
- key: operator-lint
label: Lint operator repo
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
timeout_in_minutes: 30
notify:
- github_commit_status:
context: k8s-operator
context: charts-lint
commands:
- |
TAG_NAME=$(ci/scripts/tag-check.sh) ./ci/scripts/run-in-nix-docker.sh task ci:k8s
TAG_NAME=$(ci/scripts/tag-check.sh) ./ci/scripts/run-in-nix-docker.sh task ci:lint
- echo '~~~ pipeline upload unit tests' && buildkite-agent pipeline upload .buildkite/unit-tests.yml
- echo '~~~ pipeline upload operator e2e tests with flags' && buildkite-agent pipeline upload .buildkite/operator-e2e-tests-with-flags.yml
- echo '~~~ pipeline upload operator integration tests' && buildkite-agent pipeline upload .buildkite/integration-test.yml
- echo '~~~ pipeline upload operator v2 e2e tests' && buildkite-agent pipeline upload .buildkite/operator-v2-tests.yml
agents:
queue: v6-amd64-builders
queue: v6-amd64-builders-m6id
plugins:
- seek-oss/aws-sm#v2.3.2: &aws-sm-plugin
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/active_directory
- secret-id: sdlc/prod/buildkite/buildkite_analytics_token
- secret-id: sdlc/prod/buildkite/buildkite_api_token
- secret-id: sdlc/prod/buildkite/cdt_gcp
- secret-id: sdlc/prod/buildkite/cdt_runner_aws
- secret-id: sdlc/prod/buildkite/ci_db
- secret-id: sdlc/prod/buildkite/cloudsmith
- secret-id: sdlc/prod/buildkite/dockerhub
- secret-id: sdlc/prod/buildkite/gh_token
- secret-id: sdlc/prod/buildkite/github_api_token
- secret-id: sdlc/prod/buildkite/grafana_token
- secret-id: sdlc/prod/buildkite/redpanda_sample_license
- secret-id: sdlc/prod/buildkite/redpanda_second_sample_license
- secret-id: sdlc/prod/buildkite/rpk_test_client
- secret-id: sdlc/prod/buildkite/seceng_audit_aws
- secret-id: sdlc/prod/buildkite/slack_vbot_token
- secret-id: sdlc/prod/buildkite/teleport_bot_token
- secret-id: sdlc/prod/buildkite/test_result_dsn
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: K8s Operator v1 Jobs failed"
message: ":cloud: K8S operator lint Jobs failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
- key: k8s-operator-tests-with-flags
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
label: K8s Operator tests with flags

- key: k8s-operator
label: Operator v1 E2E tests or release
timeout_in_minutes: 180
if: build.env("NIGHTLY_RELEASE") != "true"
notify:
- github_commit_status:
context: k8s-operator-tests-with-flags
context: k8s-operator-e2e-tests
commands:
- |
TAG_NAME=$(ci/scripts/tag-check.sh) ./ci/scripts/run-in-nix-docker.sh task ci:run-k8s-tests-with-flags
TAG_NAME=$(ci/scripts/tag-check.sh) ./ci/scripts/run-in-nix-docker.sh task ci:k8s
agents:
queue: v6-amd64-builders
queue: v6-amd64-builders-m6id
plugins:
- seek-oss/aws-sm#v2.3.2: &aws-sm-plugin
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/active_directory
- secret-id: sdlc/prod/buildkite/buildkite_analytics_token
Expand All @@ -116,95 +105,21 @@ steps:
- secret-id: sdlc/prod/buildkite/teleport_bot_token
- secret-id: sdlc/prod/buildkite/test_result_dsn
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: K8s Operator v1 Jobs failed"
message: ":cloud: K8s Operator v1 e2e tests Jobs failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
- group: K8s Operator v2 Jobs
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
steps:
- key: k8s-operator-v2
label: K8s Operator v2
timeout: 100
notify:
- github_commit_status:
context: k8s-operator-v2
commands:
- ./ci/scripts/run-in-nix-docker.sh task ci:k8s-v2
agents:
queue: v6-amd64-builders
plugins:
- seek-oss/aws-sm#v2.3.2: *aws-sm-plugin
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: K8s Operator v2 Jobs failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
- key: annotate-v2-testresults
label: Parse Operator v2 Test Results
plugins:
- seek-oss/aws-sm#v2.3.2: *aws-sm-plugin
- junit-annotate#v2.4.1:
artifacts: work/operator/tests/_e2e_artifacts_v2/kuttl-report.xml
report-slowest: 5
timeout_in_minutes: 0
agents:
queue: v6-k8s-builders
depends_on: k8s-operator-v2
allow_dependency_failure: true
- group: K8s Operator v2 Helm Jobs
if: |
build.env("NIGHTLY_RELEASE") != "true" &&
build.tag == null ||
build.env("K8S_NIGHTLY") == "1"
steps:
- key: k8s-operator-v2-helm
label: K8s Operator v2 Helm
timeout_in_minutes: 50
notify:
- github_commit_status:
context: k8s-operator-v2-helm
commands:
# - ./ci/scripts/run-in-nix-docker.sh task ci:k8s-v2-helm
- mkdir -p operator/tests/_e2e_helm_artifacts_v2
# The tests that are generated from `ci` folder of the Redpanda helm chart
# generated too many test cases after introduction files with the `-novalues.yaml`
# suffix. Those would not be taken by chart testing (`ct`) program, but
# `hack/v2-helm-setup.sh` takes all files currently and disables only handful of them.

- touch operator/tests/_e2e_helm_artifacts_v2/kuttl-report.xml
- buildkite-agent artifact upload operator/tests/_e2e_helm_artifacts_v2/kuttl-report.xml
- echo Noop
agents:
queue: v6-amd64-builders
plugins:
- seek-oss/aws-sm#v2.3.2: *aws-sm-plugin
- https://[email protected]/redpanda-data/step-slack-notify-buildkite-plugin.git#main:
message: ":cloud: K8s Operator v2 Helm Jobs failed"
channel_name: "kubernetes-tests"
slack_token_env_var_name: "SLACK_VBOT_TOKEN"
conditions:
failed: true
branches:
- main
- key: annotate-v2-helm-testresults
label: Parse Operator v2 Helm Test Results
plugins:
- seek-oss/aws-sm#v2.3.2: *aws-sm-plugin
- junit-annotate#v2.0.2:
artifacts: operator/tests/_e2e_helm_artifacts_v2/kuttl-report.xml
report-slowest: 5
timeout_in_minutes: 0
agents:
queue: v6-k8s-builders
depends_on: k8s-operator-v2-helm
allow_dependency_failure: true
- key: k8s-operator-v2-helm
label: K8s Operator v2 Helm
if: build.env("NIGHTLY_RELEASE") != "true"
notify:
- github_commit_status:
context: k8s-operator-v2-helm
commands:
- echo Tests where failing and K8S disabled this test suite. K8S team want to sunset kuttle base tests to new testing framework. If any of those test would be beneficial then they will be backported
agents:
queue: pipeline-uploader
Loading