-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ARO-HCP Extract aro-hcp-tests from aro-hcp-e2e-tools #75802
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
base: main
Are you sure you want to change the base?
Changes from all commits
92d71b7
3b8726f
6a82feb
f5a5c78
2712c0d
213e4b5
085b8bc
0c603be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| approvers: | ||
| - geoberle | ||
| - jharrington22 | ||
| - mmazur | ||
| - raelga | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k | ||
| - patriksuba | ||
| reviewers: | ||
| - geoberle | ||
| - jharrington22 | ||
| - mmazur | ||
| - raelga | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k | ||
| - patriksuba |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,19 +14,20 @@ export INFRA_SUBSCRIPTION_ID; INFRA_SUBSCRIPTION_ID=$(cat "${CLUSTER_PROFILE_DIR | |
| az login --service-principal -u "${AZURE_CLIENT_ID}" -p "${AZURE_CLIENT_SECRET}" --tenant "${AZURE_TENANT_ID}" --output none | ||
| az account set --subscription "${SUBSCRIPTION_ID}" | ||
|
|
||
| # TODO: Remove kubeconfig setup once exporter_metrics.go no longer requires direct svc cluster access. | ||
| unset GOFLAGS | ||
| make -C dev-infrastructure/ svc.aks.kubeconfig.pipeline SVC_KUBECONFIG_FILE=../kubeconfig DEPLOY_ENV=prow | ||
| export KUBECONFIG=kubeconfig | ||
| export AZURE_TOKEN_CREDENTIALS=prod | ||
|
Comment on lines
18
to
21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't you move this to setup?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not quite. The e2e tests also use the Azure Go client, so this variable lets it pull credentials from the environment. |
||
|
|
||
| FRONTEND_ADDRESS=$(kubectl get virtualservice -n aro-hcp aro-hcp-vs-frontend -o jsonpath='{.spec.hosts[0]}') | ||
| ADMIN_API_ADDRESS=$(kubectl get virtualservice -n aro-hcp-admin-api admin-api-vs -o jsonpath='{.spec.hosts[0]}') | ||
|
|
||
| az account set --subscription "${INFRA_SUBSCRIPTION_ID}" | ||
| make frontend-grant-ingress DEPLOY_ENV=prow | ||
| az account set --subscription "${SUBSCRIPTION_ID}" | ||
|
|
||
| make e2e/local -o test/aro-hcp-tests SKIP_CERT_VERIFICATION=true FRONTEND_ADDRESS="https://${FRONTEND_ADDRESS}" ADMIN_API_ADDRESS="https://${ADMIN_API_ADDRESS}" | ||
| make e2e-local/run -o test/aro-hcp-tests \ | ||
| FRONTEND_ADDRESS="$(cat "${SHARED_DIR}/frontend-address")" \ | ||
| ADMIN_API_ADDRESS="$(cat "${SHARED_DIR}/admin-api-address")" \ | ||
| SKIP_CERT_VERIFICATION=true | ||
|
|
||
| # the make target produces a junit.xml in ARTIFACT_DIR. We want to copy to SHARED_DIR so we can create | ||
| # direct debugging links for the individual tests that failed. Gzip it due to 3mb SHARED_DIR limit. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| approvers: | ||
| - geoberle | ||
| - jharrington22 | ||
| - mmazur | ||
| - raelga | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k | ||
| - patriksuba | ||
| reviewers: | ||
| - geoberle | ||
| - jharrington22 | ||
| - mmazur | ||
| - raelga | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k | ||
| - patriksuba |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/bin/bash | ||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
|
|
||
| export CLUSTER_PROFILE_DIR="/var/run/aro-hcp-${VAULT_SECRET_PROFILE}" | ||
|
|
||
| export AZURE_CLIENT_ID; AZURE_CLIENT_ID=$(cat "${CLUSTER_PROFILE_DIR}/client-id") | ||
| export AZURE_TENANT_ID; AZURE_TENANT_ID=$(cat "${CLUSTER_PROFILE_DIR}/tenant") | ||
| export AZURE_CLIENT_SECRET; AZURE_CLIENT_SECRET=$(cat "${CLUSTER_PROFILE_DIR}/client-secret") | ||
| export CUSTOMER_SUBSCRIPTION; CUSTOMER_SUBSCRIPTION=$(cat "${CLUSTER_PROFILE_DIR}/subscription-name") | ||
| export SUBSCRIPTION_ID; SUBSCRIPTION_ID=$(cat "${CLUSTER_PROFILE_DIR}/subscription-id") | ||
| export INFRA_SUBSCRIPTION_ID; INFRA_SUBSCRIPTION_ID=$(cat "${CLUSTER_PROFILE_DIR}/infra-subscription-id") | ||
| az login --service-principal -u "${AZURE_CLIENT_ID}" -p "${AZURE_CLIENT_SECRET}" --tenant "${AZURE_TENANT_ID}" --output none | ||
| az account set --subscription "${SUBSCRIPTION_ID}" | ||
|
|
||
| unset GOFLAGS | ||
| make -C dev-infrastructure/ svc.aks.kubeconfig.pipeline SVC_KUBECONFIG_FILE=../kubeconfig DEPLOY_ENV=prow | ||
| export KUBECONFIG=kubeconfig | ||
| export AZURE_TOKEN_CREDENTIALS=prod | ||
|
|
||
| FRONTEND_ADDRESS="https://$(kubectl get virtualservice -n aro-hcp aro-hcp-vs-frontend -o jsonpath='{.spec.hosts[0]}')" | ||
| ADMIN_API_ADDRESS="https://$(kubectl get virtualservice -n aro-hcp-admin-api admin-api-vs -o jsonpath='{.spec.hosts[0]}')" | ||
|
Comment on lines
+22
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate discovered hosts before composing/storing URLs. If jsonpath returns empty hosts, the script currently writes invalid Proposed validation-FRONTEND_ADDRESS="https://$(kubectl get virtualservice -n aro-hcp aro-hcp-vs-frontend -o jsonpath='{.spec.hosts[0]}')"
-ADMIN_API_ADDRESS="https://$(kubectl get virtualservice -n aro-hcp-admin-api admin-api-vs -o jsonpath='{.spec.hosts[0]}')"
+FRONTEND_HOST="$(kubectl get virtualservice -n aro-hcp aro-hcp-vs-frontend -o jsonpath='{.spec.hosts[0]}')"
+ADMIN_API_HOST="$(kubectl get virtualservice -n aro-hcp-admin-api admin-api-vs -o jsonpath='{.spec.hosts[0]}')"
+if [[ -z "${FRONTEND_HOST}" || -z "${ADMIN_API_HOST}" ]]; then
+ echo "Failed to resolve virtualservice hosts for frontend/admin API" >&2
+ exit 1
+fi
+FRONTEND_ADDRESS="https://${FRONTEND_HOST}"
+ADMIN_API_ADDRESS="https://${ADMIN_API_HOST}"Also applies to: 31-32 🤖 Prompt for AI Agents |
||
|
|
||
| az account set --subscription "${INFRA_SUBSCRIPTION_ID}" | ||
| make frontend-grant-ingress DEPLOY_ENV=prow | ||
| az account set --subscription "${SUBSCRIPTION_ID}" | ||
|
|
||
| make e2e-local/setup FRONTEND_ADDRESS="${FRONTEND_ADDRESS}" | ||
|
|
||
| echo "${FRONTEND_ADDRESS}" > "${SHARED_DIR}/frontend-address" | ||
| echo "${ADMIN_API_ADDRESS}" > "${SHARED_DIR}/admin-api-address" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "path": "aro-hcp/test/local/setup/aro-hcp-test-local-setup-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "geoberle", | ||
| "jharrington22", | ||
| "mmazur", | ||
| "raelga", | ||
| "roivaz", | ||
| "venkateshsredhat", | ||
| "deads2k", | ||
| "patriksuba" | ||
| ], | ||
| "reviewers": [ | ||
| "geoberle", | ||
| "jharrington22", | ||
| "mmazur", | ||
| "raelga", | ||
| "roivaz", | ||
| "venkateshsredhat", | ||
| "deads2k", | ||
| "patriksuba" | ||
| ] | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.