Skip to content

Commit 0c93055

Browse files
Attempt with docker compose instead of GH services
1 parent d5ef500 commit 0c93055

File tree

2 files changed

+62
-27
lines changed

2 files changed

+62
-27
lines changed

.github/docker-compose.test.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This docker compose setup configures:
2+
# - the Unleash server instance + the necessary backing Postgres database
3+
# - the Unleash proxy
4+
#
5+
# To learn more about all the parts of Unleash, visit
6+
# https://docs.getunleash.io
7+
#
8+
# NOTE: please do not use this configuration for production setups.
9+
# Unleash does not take responsibility for any data leaks or other
10+
# problems that may arise as a result.
11+
#
12+
# This is intended to be used for demo, development, and learning
13+
# purposes only.
14+
15+
services:
16+
# The Unleash server contains the Unleash configuration and
17+
# communicates with server-side SDKs and the Unleash Proxy
18+
unleash:
19+
image: 726824350591.dkr.ecr.eu-central-1.amazonaws.com/unleash-enterprise:latest
20+
pull_policy: "always"
21+
ports:
22+
- "4242:4242"
23+
environment:
24+
DATABASE_URL: "postgres://postgres:unleash@db/unleash"
25+
DATABASE_SSL: "false"
26+
UNLEASH_LICENSE: "${FRONTEND_TEST_LICENSE}"
27+
depends_on:
28+
db:
29+
condition: service_healthy
30+
healthcheck:
31+
test: wget --no-verbose --tries=1 --spider http://localhost:4242/health || exit 1
32+
interval: 1s
33+
timeout: 1m
34+
retries: 5
35+
start_period: 15s
36+
db:
37+
expose:
38+
- "5432"
39+
image: postgres:16
40+
environment:
41+
POSTGRES_DB: "unleash"
42+
# trust incoming connections blindly (DON'T DO THIS IN PRODUCTION!)
43+
POSTGRES_HOST_AUTH_METHOD: "trust"
44+
healthcheck:
45+
test:
46+
[
47+
"CMD",
48+
"pg_isready",
49+
"--username=postgres",
50+
"--host=127.0.0.1",
51+
"--port=5432",
52+
]
53+
interval: 2s
54+
timeout: 1m
55+
retries: 5
56+
start_period: 10s

.github/workflows/e2e.frontend.yaml

+6-27
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,6 @@ jobs:
1818
e2e:
1919
runs-on: ubuntu-latest
2020
needs: get-token
21-
services:
22-
db:
23-
image: postgres
24-
env:
25-
POSTGRES_USER: unleash_user
26-
POSTGRES_PASSWORD: password
27-
POSTGRES_DB: unleash_test
28-
POSTGRES_INITDB_ARGS: "--no-sync"
29-
ports:
30-
- 5432:5432
31-
options: >-
32-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
33-
unleashEnterprise:
34-
image: 726824350591.dkr.ecr.eu-central-1.amazonaws.com/unleash-enterprise:latest
35-
credentials:
36-
username: AWS
37-
password: ${{ needs.get-token.outputs.token }}
38-
env:
39-
DATABASE_URL: "postgres://postgres:unleash@localhost/unleash"
40-
UNLEASH_LICENSE: ${{ secrets.FRONTEND_TEST_LICENSE }}
41-
options: >-
42-
--health-cmd "wget --no-verbose --tries=1 --spider http://localhost:4242/health || exit 1"
43-
--health-interval 10s
44-
--health-timeout 5s
45-
--health-retries 5
46-
47-
4821
strategy:
4922
matrix:
5023
test:
@@ -60,6 +33,12 @@ jobs:
6033
echo "$GITHUB_CONTEXT"
6134
- name: Checkout
6235
uses: actions/checkout@v4
36+
- name: Start Unleash test instance
37+
run: |
38+
echo ${{ needs.get-token.outputs.token }} | docker login --username AWS --password-stdin 726824350591.dkr.ecr.eu-central-1.amazonaws.com
39+
docker compose up -f .github/docker-compose.test.yml -d --wait -t 90
40+
env:
41+
FRONTEND_TEST_LICENSE: ${{ secrets.FRONTEND_TEST_LICENSE }}
6342
- name: Run Cypress
6443
uses: cypress-io/github-action@v6
6544
with:

0 commit comments

Comments
 (0)