Skip to content

Commit

Permalink
chore: fix stress test
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Jan 5, 2025
1 parent e69ec35 commit fa8ef30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/stress_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ concurrency:
cancel-in-progress: true

env:
POSTGRES_HOST: localhost
REDIS_HOST: localhost
MINIO_HOST: localhost
SQLX_OFFLINE: true
RUST_TOOLCHAIN: "1.80"
LOCALHOST_URL: http://localhost
LOCALHOST_WS: ws://localhost/ws/v1
LOCALHOST_GOTRUE: http://localhost/gotrue
POSTGRES_HOST: localhost
REDIS_HOST: localhost

jobs:
test:
Expand All @@ -31,27 +27,33 @@ jobs:
- name: Copy and Rename deploy.env to .env
run: cp deploy.env .env

- name: Install PostgreSQL Client
run: |
brew update
brew install libpq
brew install sqlx-cli
- name: Replace Values in .env
run: |
sed -i '' 's|RUST_LOG=.*|RUST_LOG=debug|' .env
sed -i '' 's|API_EXTERNAL_URL=.*|API_EXTERNAL_URL=http://localhost:9999|' .env
sed -i '' 's|APPFLOWY_INDEXER_ENABLED=.*|APPFLOWY_INDEXER_ENABLED=false|' .env
sed -i '' 's|APPFLOWY_GOTRUE_BASE_URL=.*|APPFLOWY_GOTRUE_BASE_URL=http://localhost:9999|' .env
sed -i '' 's|GOTRUE_DATABASE_URL=.*|GOTRUE_DATABASE_URL=postgres://supabase_auth_admin:root@postgres:5432/postgres|' .env
sed -i '' 's|GOTRUE_MAILER_AUTOCONFIRM=.*|GOTRUE_MAILER_AUTOCONFIRM=false|' .env
sed -i '' 's|APPFLOWY_DATABASE_URL=.*|APPFLOWY_DATABASE_URL=postgres://postgres:password@localhost:5432/postgres|' .env
sed -i '' 's|DATABASE_URL=.*|DATABASE_URL=postgres://postgres:password@localhost:5432/postgres|' .env
cat .env
shell: bash

- name: Remove All Docker Data Used in docker-compose-dev.yml
run: |
# docker compose -f docker-compose-dev.yml down --volumes --remove-orphans

- name: Start Docker Compose Services
run: |
# docker compose -f docker-compose-dev.yml up -d
docker ps -a
./script/run_local_server.sh
- name: Install Prerequisites
run: |
brew install protobuf
- name: Run Server and Test
run: |
Expand Down
16 changes: 1 addition & 15 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_HOST=${POSTGRES_HOST:-postgres}
- SUPABASE_PASSWORD=${SUPABASE_PASSWORD:-root}
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}" ]
interval: 5s
timeout: 5s
retries: 6
ports:
- 5432:5432
volumes:
Expand All @@ -50,8 +45,7 @@ services:
restart: on-failure
image: appflowyinc/gotrue:${GOTRUE_VERSION:-latest}
depends_on:
postgres:
condition: service_healthy
- postgres
environment:
# Gotrue config: https://github.com/supabase/gotrue/blob/master/example.env
- GOTRUE_ADMIN_EMAIL=${GOTRUE_ADMIN_EMAIL}
Expand Down Expand Up @@ -104,14 +98,6 @@ services:
ports:
- 9999:9999

portainer:
restart: on-failure
image: portainer/portainer-ce:latest
ports:
- 9442:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock

pgadmin:
restart: on-failure
image: dpage/pgadmin4
Expand Down

0 comments on commit fa8ef30

Please sign in to comment.