Skip to content

Commit

Permalink
Avoid changing secrets in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed Nov 25, 2023
1 parent 58d937e commit 3f6640d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm run build
- name: Build Docker images
run: pnpm run docker:build
- name: Copy pusher secrets
run: cp pusher/secrets.example.env pusher/secrets.env
- name: Start services
# Start the e2e services in the background and wait a small amount of time for them to start.
run: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ signed-api.json

# Do not ignore e2e config files. These don't need to be listed on Dockerignore because e2e package is not dockerized.
!packages/e2e/**/pusher.json
!packages/e2e/**/secrets.env
!packages/e2e/**/.env
!packages/e2e/**/signed-api.json
5 changes: 3 additions & 2 deletions packages/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
## Getting started

1. If you are using Docker Desktop, you need to change the URL in `pusher/secrets.env` from `localhost` to
`host.docker.internal`, because pusher is running inside a Docker container.
1. Copy the pusher secrets. Run `cp pusher/secrets.example.env pusher/secrets.env`. If you are using Docker Desktop, you
need to change the URL in `pusher/secrets.env` from `localhost` to `host.docker.internal`, because pusher is running
inside a Docker container.
2. Build the latest Docker images. Run `pnpm run docker:build` from the monorepo root. The e2e flow uses the docker
images.
3. This module contains services (or configurations) that are integrated together. Specifically:
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e/src/pusher/pusher.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"signedApis": [
{
"name": "localhost",
"url": "http://${HOST_IP}:8090"
"url": "${SIGNED_API_URL}"
}
],
"ois": [
Expand All @@ -74,7 +74,7 @@
"paths": {
"/": { "get": { "parameters": [] } }
},
"servers": [{ "url": "http://${HOST_IP}:9876" }],
"servers": [{ "url": "${DATA_PROVIDER_API}" }],
"security": {}
},
"endpoints": [
Expand Down
4 changes: 0 additions & 4 deletions packages/e2e/src/pusher/secrets.env

This file was deleted.

5 changes: 5 additions & 0 deletions packages/e2e/src/pusher/secrets.example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Secrets must NOT be quoted.
#
# Use "host.docker.internal" if using Docker for Desktop, otherwise laeve it set to "localhost".
SIGNED_API_URL=http://localhost:8090
DATA_PROVIDER_API=http://localhost:9876

0 comments on commit 3f6640d

Please sign in to comment.