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

WIP: chore: add ci script for e2e testing #268

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions hack/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,24 @@ EOF
return 2
fi
}

turtles::utils::ensure_ngrok_envs() {
: "${NGROK_AUTHTOKEN:?Environment variable empty or not defined.}"
: "${NGROK_API_KEY:?Environment variable empty or not defined.}"
}

turtles::utils::ensure_rancher_envs() {
: "${RANCHER_HOSTNAME:?Environment variable empty or not defined.}"
: "${RANCHER_PASSWORD:?Environment variable empty or not defined.}"
}

turtles::utils::ensure_azure_envs() {
: "${AZURE_SUBSCRIPTION_ID:?Environment variable empty or not defined.}"
: "${AZURE_TENANT_ID:?Environment variable empty or not defined.}"
: "${AZURE_CLIENT_ID:?Environment variable empty or not defined.}"
: "${AZURE_CLIENT_SECRET:?Environment variable empty or not defined.}"
}

turtles::utils::ensure_aws_envs() {
: "${CAPA_ENCODED_CREDS:?Environment variable empty or not defined.}"
}
38 changes: 38 additions & 0 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

################################################################################
# usage: ./ci-e2e.sh
# This program runs the e2e tests.
# It is automatically triggered by Rancher Turtles CI system.
#
# If you want to run it locally, you'll need to export the following environment variables:
# - Ngrok: NGROK_AUTHTOKEN, NGROK_API_KEY
# - Rancher: RANCHER_HOSTNAME, RANCHER_PASSWORD
# - Azure: AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET
# - AWS: CAPA_ENCODED_CREDS
#
################################################################################

set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

# shellcheck source=hack/utils.sh
source "${REPO_ROOT}/hack/utils.sh"

# Verify the required environment variables
turtles::utils::ensure_ngrok_envs
turtles::utils::ensure_rancher_envs
turtles::utils::ensure_azure_envs
turtles::utils::ensure_aws_envs

# Run E2E
make test-e2e

# Run janitors
# Azure janitor
#
# AWS janitor
#