-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Cloud Slack Dev E2E tests and fix migration test
- Loading branch information
Showing
19 changed files
with
2,888 additions
and
67 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
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,104 @@ | ||
name: CLI Migration E2E tests | ||
|
||
concurrency: | ||
group: cli-migration-e2e | ||
cancel-in-progress: false | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' # TODO: Ensure it runs after branch build | ||
- 'cloud-slack-dev-e2e' # TODO: Remove before merge | ||
repository_dispatch: | ||
types: [ trigger-e2e-tests ] | ||
|
||
env: | ||
HELM_VERSION: v3.9.0 | ||
K3D_VERSION: v5.4.6 | ||
IMAGE_REGISTRY: "ghcr.io" | ||
IMAGE_REPOSITORY: "kubeshop/botkube" | ||
IMAGE_TAG: v9.99.9-dev # TODO: Use commit hash tag to make the predictable builds for each commit on branch | ||
|
||
jobs: | ||
migration-e2e-test: | ||
name: Migration e2e test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
e2e: | ||
- discord | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Install GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
install-only: true | ||
version: latest | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
cache: true | ||
- name: Run GoReleaser | ||
run: make release-snapshot-cli | ||
- name: Add botkube alias | ||
run: | | ||
echo BOTKUBE_BINARY_PATH="$PWD/dist/botkube-cli_linux_amd64_v1/botkube" >> $GITHUB_ENV | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: ${{ env.HELM_VERSION }} | ||
- name: Download k3d | ||
run: "wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=${K3D_VERSION} bash" | ||
- name: Create k3d cluster | ||
run: "k3d cluster create migration-test-cluster --wait --timeout=5m" | ||
- name: Run e2e tests for botkube client | ||
env: | ||
DISCORD_BOT_ID: ${{ secrets.DISCORD_BOT_ID }} | ||
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | ||
DISCORD_GUILD_ID: ${{ secrets.DISCORD_GUILD_ID }} | ||
DISCORD_TESTER_APP_TOKEN: ${{ secrets.DISCORD_TESTER_APP_TOKEN }} | ||
BOTKUBE_CLOUD_DEV_GQL_ENDPOINT: ${{ secrets.BOTKUBE_CLOUD_DEV_GQL_ENDPOINT }} | ||
BOTKUBE_CLOUD_DEV_REFRESH_TOKEN: ${{ secrets.BOTKUBE_CLOUD_DEV_REFRESH_TOKEN }} | ||
BOTKUBE_CLOUD_DEV_AUTH0_CLIENT_ID: ${{ secrets.BOTKUBE_CLOUD_DEV_AUTH0_CLIENT_ID }} | ||
run: | | ||
KUBECONFIG=$(k3d kubeconfig write migration-test-cluster) \ | ||
make test-migration-tool | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: screenshots_dump_${{github.sha}} | ||
path: ${{ runner.temp }}/screenshots | ||
retention-days: 5 | ||
|
||
- name: Dump cluster state | ||
if: ${{ failure() }} | ||
uses: ./.github/actions/dump-cluster | ||
|
||
# TODO: Uncomment | ||
# slackNotification: | ||
# name: Slack Notification | ||
# runs-on: ubuntu-latest | ||
# needs: [ e2e ] | ||
# if: failure() | ||
# steps: | ||
# - name: Slack Notification | ||
# uses: rtCamp/action-slack-notify@v2 | ||
# env: | ||
# SLACK_USERNAME: Botkube Cloud CI | ||
# SLACK_COLOR: 'red' | ||
# SLACK_TITLE: 'Message' | ||
# SLACK_CHANNEL: 'botkube-cloud-ci-alerts' | ||
# SLACK_MESSAGE: 'CLI Migration E2E tests failed :scream:' | ||
# SLACK_ICON_EMOJI: ':this-is-fine-fire:' | ||
# SLACK_FOOTER: "Fingers crossed it's just an outdated/flaky test..." | ||
# SLACK_WEBHOOK: ${{ secrets.SLACK_CI_ALERTS_WEBHOOK }} |
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,73 @@ | ||
name: Botkube Cloud Slack Dev E2E | ||
|
||
concurrency: | ||
group: cloud-slack-dev-e2e | ||
cancel-in-progress: false | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' # TODO: Ensure it runs after branch build | ||
- 'cloud-slack-dev-e2e' # TODO: Remove before merge | ||
repository_dispatch: | ||
types: [ trigger-e2e-tests ] | ||
|
||
jobs: | ||
e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Kubernetes | ||
uses: medyagh/setup-minikube@latest | ||
|
||
- name: Setup Helm | ||
uses: azure/setup-helm@v3 | ||
|
||
- name: Run e2e tests | ||
env: | ||
SLACK_WORKSPACE_NAME: ${{ secrets.E2E_DEV_SLACK_WORKSPACE_NAME }} | ||
SLACK_EMAIL: ${{ secrets.E2E_DEV_SLACK_EMAIL }} | ||
SLACK_PASSWORD: ${{ secrets.E2E_DEV_SLACK_USER_PASSWORD }} | ||
SLACK_TESTER_TESTER_BOT_TOKEN: ${{ secrets.E2E_DEV_SLACK_TESTER_BOT_TOKEN }} | ||
SLACK_TESTER_BOT_NAME: botkubedev | ||
BOTKUBE_CLOUD_EMAIL: ${{ secrets.E2E_DEV_BOTKUBE_CLOUD_EMAIL }} | ||
BOTKUBE_CLOUD_PASSWORD: ${{ secrets.E2E_DEV_BOTKUBE_CLOUD_PASSWORD }} | ||
BOTKUBE_CLOUD_TEAM_ORGANIZATION_ID: ${{ secrets.E2E_DEV_BOTKUBE_CLOUD_TEAM_ORGANIZATION_ID }} | ||
BOTKUBE_CLOUD_FREE_ORGANIZATION_ID: ${{ secrets.E2E_DEV_BOTKUBE_CLOUD_FREE_ORGANIZATION_ID }} | ||
SCREENSHOTS_DIR: ${{ runner.temp }}/screenshots | ||
DEBUG_MODE: true | ||
run: | ||
make test-cloud-slack-dev-e2e | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: screenshots_dump_${{github.sha}} | ||
path: ${{ runner.temp }}/screenshots | ||
retention-days: 5 | ||
|
||
- name: Dump cluster state | ||
if: ${{ failure() }} | ||
uses: ./.github/actions/dump-cluster | ||
|
||
# TODO: Uncomment | ||
# slackNotification: | ||
# name: Slack Notification | ||
# runs-on: ubuntu-latest | ||
# needs: [ e2e ] | ||
# if: failure() | ||
# steps: | ||
# - name: Slack Notification | ||
# uses: rtCamp/action-slack-notify@v2 | ||
# env: | ||
# SLACK_USERNAME: Botkube Cloud CI | ||
# SLACK_COLOR: 'red' | ||
# SLACK_TITLE: 'Message' | ||
# SLACK_CHANNEL: 'botkube-cloud-ci-alerts' | ||
# SLACK_MESSAGE: 'Cloud Slack Dev E2E tests failed :scream:' | ||
# SLACK_ICON_EMOJI: ':this-is-fine-fire:' | ||
# SLACK_FOOTER: "Fingers crossed it's just an outdated/flaky test..." | ||
# SLACK_WEBHOOK: ${{ secrets.SLACK_CI_ALERTS_WEBHOOK }} |
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
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
Oops, something went wrong.