From fa8ef30e0a9771031b32e864ba51b9eb0c833a73 Mon Sep 17 00:00:00 2001 From: weidong fu Date: Mon, 6 Jan 2025 00:21:31 +0800 Subject: [PATCH] chore: fix stress test --- .github/workflows/stress_test.yml | 30 ++++++++++++++++-------------- docker-compose-dev.yml | 16 +--------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/stress_test.yml b/.github/workflows/stress_test.yml index 0e4bc238c..f62f3984d 100644 --- a/.github/workflows/stress_test.yml +++ b/.github/workflows/stress_test.yml @@ -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: @@ -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: | diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index c7625c97f..2c4803ee9 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -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: @@ -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} @@ -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