forked from kyma-project/telemetry-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add github actions for integration tests (kyma-project#496)
- Loading branch information
Showing
13 changed files
with
374 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Finalize tests | ||
description: Finalizes integration test execution with cleanup and collecting dumps fors the error scenario | ||
|
||
inputs: | ||
failure: | ||
description: Are we in failure mode? | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
|
||
- name: Print operator logs | ||
shell: bash | ||
if: ${{ inputs.failure }} | ||
run: | | ||
kubectl -n kyma-system logs -l "app.kubernetes.io/instance=telemetry, app.kubernetes.io/name=operator" | ||
- name: List Namespaces | ||
shell: bash | ||
if: ${{ inputs.failure }} | ||
run: | | ||
kubectl get namespaces | ||
- name: List Pods | ||
shell: bash | ||
if: ${{ inputs.failure }} | ||
run: | | ||
kubectl get po --all-namespaces | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Prepare checks | ||
description: Prepares everything for static code check execution | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
# uses an older go version by default, so configure go with newest version | ||
- name: Setup golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Prepare test | ||
description: Prepares everything for integration test execution | ||
|
||
inputs: | ||
release: | ||
description: Deploy operator in release mode | ||
required: false | ||
github-token: | ||
description: Github token to use for github access | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
|
||
# uses an older go version by default, so configure go with newest version | ||
- name: Setup golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
|
||
- name: Provision K3D | ||
shell: bash | ||
run: make provision-k3d | ||
|
||
# wait for the build to succeed so that the manager image is available | ||
- name: Wait for the 'pull-telemetry-manager-build' job to succeed | ||
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20 | ||
with: | ||
context: "pull-telemetry-manager-build" | ||
commit_ref: "${{ github.event.pull_request.head.sha }}" # Note: 'github.event.pull_request.head.sha' is not same as 'github.sha' on pull requests. | ||
timeout: 600000 # 10 minutes in milliseconds | ||
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting) | ||
check_interval: 60000 # 1 minute in milliseconds | ||
env: | ||
GITHUB_TOKEN: "${{ inputs.github-token }}" | ||
GITHUB_OWNER: "${{ github.repository_owner }}" | ||
GITHUB_REPO: "telemetry-manager" | ||
|
||
- name: Deploy module experimental | ||
if: ${{ inputs.release }} | ||
shell: bash | ||
run: make deploy | ||
|
||
- name: Deploy module release | ||
if: ${{ !inputs.release }} | ||
shell: bash | ||
run: make deploy-dev | ||
|
||
- name: Wait for operator readiness | ||
shell: bash | ||
run: kubectl -n kyma-system rollout status deployment telemetry-operator --timeout=90s | ||
|
||
- name: Print cluster info | ||
shell: bash | ||
run: | | ||
kubectl cluster-info | ||
kubectl -n kyma-system get po |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: PR Code checks | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "release-*" | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare test | ||
uses: "./.github/template/prepare-checks" | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare test | ||
uses: "./.github/template/prepare-checks" | ||
|
||
- name: Run linting | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
install-mode: binary | ||
version: latest | ||
args: --timeout=5m --config=./.golangci.yaml | ||
|
||
verify-manifests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare test | ||
uses: "./.github/template/prepare-checks" | ||
|
||
- name: Verify manifests | ||
run: make lint-manifests | ||
|
||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate links | ||
uses: gaurav-nelson/github-action-markdown-link-check@v1 | ||
with: | ||
use-verbose-mode: 'no' | ||
config-file: '.mlc.config.json' | ||
folder-path: '.' | ||
max-depth: -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: PR Integration | ||
|
||
env: | ||
IMG: europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:PR-${{ github.event.number }} | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "release-*" | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
e2e-metrics: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare test | ||
uses: "./.github/template/prepare-test" | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run tests | ||
run: make run-e2e-test-metrics | ||
|
||
- name: Finalize test | ||
uses: "./.github/template/finalize-test" | ||
if: success() || failure() | ||
with: | ||
failure: failure() | ||
|
||
e2e-traces-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare Test | ||
uses: "./.github/template/prepare-test" | ||
with: | ||
release: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run tests | ||
run: make run-e2e-test-tracing | ||
|
||
- name: Finalize Test | ||
uses: "./.github/template/finalize-test" | ||
if: success() || failure() | ||
with: | ||
failure: failure() | ||
|
||
e2e-traces: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare Test | ||
uses: "./.github/template/prepare-test" | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run tests | ||
run: make run-e2e-test-tracing | ||
|
||
- name: Finalize Test | ||
uses: "./.github/template/finalize-test" | ||
if: success() || failure() | ||
with: | ||
failure: failure() | ||
|
||
e2e-logs-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare Test | ||
uses: "./.github/template/prepare-test" | ||
with: | ||
release: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run tests | ||
run: make run-e2e-test-logging | ||
|
||
- name: Finalize Test | ||
uses: "./.github/template/finalize-test" | ||
if: success() || failure() | ||
with: | ||
failure: failure() | ||
|
||
e2e-logs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare Test | ||
uses: "./.github/template/prepare-test" | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run tests | ||
run: make run-e2e-test-logging | ||
|
||
- name: Finalize Test | ||
uses: "./.github/template/finalize-test" | ||
if: success() || failure() | ||
with: | ||
failure: failure() | ||
|
||
e2e-integration-istio: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare Test | ||
uses: "./.github/template/prepare-test" | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run tests | ||
run: make run-integration-test-istio | ||
|
||
- name: Finalize Test | ||
uses: "./.github/template/finalize-test" | ||
if: success() || failure() | ||
with: | ||
failure: failure() |
Oops, something went wrong.