Skip to content

Commit

Permalink
Add E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Dec 11, 2023
1 parent 94d1775 commit e3b60cc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
description: 'The version of UID2 optout image'
type: string
default: '2.7.3-4f813a8ad9-default'
e2e_image_version:
description: 'The version of E2E image'
type: string
default: 'latest'

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -83,5 +87,6 @@ jobs:
CORE_VERSION: ${{ inputs.core_image_version }}
OPTOUT_VERSION: ${{ inputs.optout_image_version }}
OPERATOR_VERSION: ${{ inputs.operator_image_version }}
E2E_VERSION: ${{ inputs.e2e_image_version }}
run: |
cd ./e2e && bash ./docker-build-public.sh
6 changes: 6 additions & 0 deletions e2e/docker-build-public.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ if [ -z "$OPERATOR_VERSION" ]; then
exit 1
fi

if [ -z "$E2E_VERSION" ]; then
echo "E2E_VERSION can not be empty"
exit 1
fi

# replace placeholders
sed -i.bak "s#<CORE_VERSION>#$CORE_VERSION#g" $COMPOSE_FILE
sed -i.bak "s#<OPTOUT_VERSION>#$OPTOUT_VERSION#g" $COMPOSE_FILE
sed -i.bak "s#<OPERATOR_VERSION>#$OPERATOR_VERSION#g" $COMPOSE_FILE
sed -i.bak "s#<E2E_VERSION>#$E2E_VERSION#g" $COMPOSE_FILE

cat $CORE_CONFIG_FILE
cat $OPTOUT_CONFIG_FILE
Expand Down
22 changes: 22 additions & 0 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ services:
depends_on:
core:
condition: service_healthy
optout:
condition: service_healthy
healthcheck:
test: [ "CMD", "wget", "--spider", "http://localhost:8080/ops/healthcheck" ]
interval: 5s

e2etest:
container_name: E2E tests
image: ghcr.io/iabtechlab/uid2-e2e:<E2E_VERSION>
environment:
- UID2_E2E_API_KEY=UID2-C-L-999-fCXrMM.fsR3mDqAXELtWWMS+xG1s7RdgRTMqdOH2qaAo=
- UID2_E2E_API_KEY_OLD=UID2-C-L-1000-qxpBsF.ibeCDBpD2bq4Zm7inDacGioUk1aaLeNJrabow=
- UID2_E2E_API_SECRET=DzBzbjTJcYL0swDtFs2krRNu+g1Eokm2tBU4dEuD0Wk=
- UID2_E2E_API_SECRET_OLD=VT7+t0G/RVueMuVZAL56I2c3JJFSYQfhbu8yo0V/Tds=
- UID2_E2E_ENV=local
- UID2_E2E_IDENTITY_SCOPE=UID2
- UID2_E2E_PHONE_SUPPORT=true
- UID2_E2E_SITE_ID=999
depends_on:
core:
condition: service_healthy
optout:
condition: service_healthy
operator:
condition: service_healthy

0 comments on commit e3b60cc

Please sign in to comment.