Skip to content

Commit

Permalink
UID2-2772 Enable e2e tests (#65)
Browse files Browse the repository at this point in the history
* Not override `enforce_https` in gcp

* Use kcc-UID2-2772-enable-e2e-tests branch

* Remove e2e folder from operator

* Revert kcc-UID2-2772-enable-e2e-tests to v2
  • Loading branch information
cYKatherine authored Feb 23, 2024
1 parent 01a9cc8 commit ba14bdc
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/shared-run-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ on:
core_root:
description: 'The root path for uid2-core folder'
type: string
default: '../uid2-core'
default: 'uid2-core'
optout_root:
description: 'The root path for uid2-optout folder'
type: string
default: '../uid2-optout'
default: 'uid2-optout'
admin_root:
description: 'The root path for uid2-admin folder'
type: string
default: '../uid2-admin'
default: 'uid2-admin'
operator_root:
description: 'The root path for uid2-operator folder'
type: string
default: '../uid2-operator'
default: 'uid2-operator'
operator_image_version:
description: 'The version of UID2 operator image'
type: string
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
id: bore
if: ${{ inputs.operator_type == 'gcp' || inputs.operator_type == 'azure' }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/setup_bore.sh
bash uid2-shared-actions/scripts/setup_bore.sh
- name: Prepare GCP metadata
id: prepare_gcp_metadata
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
BORE_URL_OPTOUT: ${{ steps.bore.outputs.BORE_URL_OPTOUT }}
BORE_URL_LOCALSTACK: ${{ steps.bore.outputs.BORE_URL_LOCALSTACK }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/prepare_resources_for_e2e_docker_compose.sh
bash uid2-shared-actions/scripts/prepare_resources_for_e2e_docker_compose.sh
- name: Start GCP private operator
id: start_gcp_private_operator
Expand Down Expand Up @@ -249,11 +249,11 @@ jobs:
SERVICE_ACCOUNT: ${{ vars.GCP_SERVICE_ACCOUNT }}
GCP_INSTANCE_NAME: ${{ steps.start_gcp_private_operator.outputs.gcp_instance_name }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/gcp/stop_gcp_enclave.sh
bash uid2-shared-actions/scripts/gcp/stop_gcp_enclave.sh
- name: Stop Azure private operator
if: ${{ inputs.operator_type == 'azure' }}
env:
CONTAINER_GROUP_NAME: ${{ steps.start_azure_private_operator.outputs.container_group_name }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/azure/stop_azure_cc_enclave.sh
bash uid2-shared-actions/scripts/azure/stop_azure_cc_enclave.sh
6 changes: 3 additions & 3 deletions actions/prepare_azure_metadata/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
admin_root:
description: The root path for uid2-admin folder
type: string
default: ../uid2-admin
default: uid2-admin
outputs:
output_template_file:
description: Output template file
Expand All @@ -25,7 +25,7 @@ runs:
env:
IMAGE_VERSION: ${{ inputs.operator_image_version }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/azure/prepare_azure_cc_artifacts.sh
bash uid2-shared-actions/scripts/azure/prepare_azure_cc_artifacts.sh
- name: Prepare Azure enclave metadata
id: azure_metadata
Expand All @@ -34,5 +34,5 @@ runs:
OUTPUT_POLICY_DIGEST_FILE: ${{ steps.azure_artifacts.outputs.OUTPUT_POLICY_DIGEST_FILE }}
ADMIN_ROOT: ${{ inputs.admin_root }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/azure/prepare_azure_cc_enclave_metadata.sh
bash uid2-shared-actions/scripts/azure/prepare_azure_cc_enclave_metadata.sh
4 changes: 2 additions & 2 deletions actions/prepare_gcp_metadata/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
admin_root:
description: 'The root path for uid2-admin folder'
type: string
default: '../uid2-admin'
default: 'uid2-admin'
gcp_service_account:
description: 'The GCP service account'
type: string
Expand Down Expand Up @@ -71,5 +71,5 @@ runs:
IMAGE_HASH: ${{ steps.get_digest.outputs.image_hash }}
ADMIN_ROOT: ${{ inputs.admin_root }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/gcp/prepare_gcp_enclave_metadata.sh
bash uid2-shared-actions/scripts/gcp/prepare_gcp_enclave_metadata.sh
2 changes: 1 addition & 1 deletion actions/start_azure_private_operator/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ runs:
OUTPUT_TEMPLATE_FILE: ${{ inputs.output_template_file }}
OUTPUT_PARAMETERS_FILE: ${{ inputs.output_parameters_file }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/azure/start_azure_cc_enclave.sh
bash uid2-shared-actions/scripts/azure/start_azure_cc_enclave.sh
2 changes: 1 addition & 1 deletion actions/start_gcp_private_operator/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ runs:
OPERATOR_KEY: ${{ inputs.operator_key }}
IMAGE_HASH: ${{ inputs.image_hash }}
run: |
cd e2e && bash ../uid2-shared-actions/scripts/gcp/start_gcp_enclave.sh
bash uid2-shared-actions/scripts/gcp/start_gcp_enclave.sh
2 changes: 1 addition & 1 deletion scripts/azure/prepare_azure_cc_artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ex

ROOT="../uid2-shared-actions/scripts/azure"
ROOT="uid2-shared-actions/scripts/azure"
INPUT_DIR="$ROOT/artifacts_schema"
OUT_PUT_DIR="$ROOT/azure-artifacts"

Expand Down
2 changes: 1 addition & 1 deletion scripts/azure/start_azure_cc_enclave.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ex

ROOT="../uid2-shared-actions/scripts"
ROOT="uid2-shared-actions/scripts"
# below resources should be prepared ahead
RESOURCE_GROUP=uid-enclave-ci-cd
IDENTITY=uid-operator
Expand Down
4 changes: 2 additions & 2 deletions scripts/gcp/start_gcp_enclave.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ex

ROOT="../uid2-shared-actions/scripts"
ROOT="uid2-shared-actions/scripts"
GCP_INSTANCE_NAME="ci-test-$RANDOM"
OPERATOR_KEY_SECRET_NAME=$GCP_INSTANCE_NAME

Expand Down Expand Up @@ -56,7 +56,7 @@ gcloud compute instances create $GCP_INSTANCE_NAME \
--image-project confidential-space-images \
--image-family confidential-space-debug \
--service-account $SERVICE_ACCOUNT \
--metadata ^~^tee-image-reference=us-docker.pkg.dev/uid2-prod-project/iabtechlab/uid2-operator@$IMAGE_HASH~tee-restart-policy=Never~tee-container-log-redirect=true~tee-env-DEPLOYMENT_ENVIRONMENT=integ~tee-env-API_TOKEN_SECRET_NAME=$OPERATOR_KEY_SECRET_VERSION~tee-env-CORE_BASE_URL=http://$BORE_URL_CORE~tee-env-OPTOUT_BASE_URL=http://$BORE_URL_OPTOUT~tee-env-ENFORCE_HTTPS=false
--metadata ^~^tee-image-reference=us-docker.pkg.dev/uid2-prod-project/iabtechlab/uid2-operator@$IMAGE_HASH~tee-restart-policy=Never~tee-container-log-redirect=true~tee-env-DEPLOYMENT_ENVIRONMENT=integ~tee-env-API_TOKEN_SECRET_NAME=$OPERATOR_KEY_SECRET_VERSION~tee-env-CORE_BASE_URL=http://$BORE_URL_CORE~tee-env-OPTOUT_BASE_URL=http://$BORE_URL_OPTOUT

# export to Github output
echo "GCP_INSTANCE_NAME=$GCP_INSTANCE_NAME"
Expand Down
6 changes: 3 additions & 3 deletions scripts/prepare_resources_for_e2e_docker_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ OPERATOR_CONFIG_FILE_DIR="$ROOT/docker/uid2-operator/conf"
CORE_RESOURCE_FILE_DIR="$ROOT/docker/uid2-core/src"
OPTOUT_RESOURCE_FILE_DIR="$ROOT/docker/uid2-optout/src"

source "../uid2-shared-actions/scripts/jq_helper.sh"
source "../uid2-shared-actions/scripts/healthcheck.sh"
source "uid2-shared-actions/scripts/jq_helper.sh"
source "uid2-shared-actions/scripts/healthcheck.sh"

if [ -z "$CORE_ROOT" ]; then
echo "CORE_ROOT can not be empty"
Expand Down Expand Up @@ -47,7 +47,7 @@ if [ $OPERATOR_TYPE == "public" ]; then
cp "$OPERATOR_ROOT/conf/local-e2e-docker-$OPERATOR_TYPE-config.json" "$OPERATOR_CONFIG_FILE_DIR/local-e2e-docker-config.json"
fi

cp "../uid2-e2e/docker-compose.yml" "$ROOT"
cp "uid2-e2e/docker-compose.yml" "$ROOT"

CORE_CONFIG_FILE="$ROOT/docker/uid2-core/conf/local-e2e-docker-config.json"
OPTOUT_CONFIG_FILE="$ROOT/docker/uid2-optout/conf/local-e2e-docker-config.json"
Expand Down

0 comments on commit ba14bdc

Please sign in to comment.