Skip to content

Commit

Permalink
chore: add ci script for e2e testing
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
  • Loading branch information
salasberryfin committed Nov 15, 2023
1 parent 5227075 commit e265622
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
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
#

0 comments on commit e265622

Please sign in to comment.