From 2b92073aa7041d04ef49995ea202af1c20d9057e Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Wed, 19 Feb 2025 16:58:38 +0530 Subject: [PATCH] chore: setup sqlite tests, drop postgres CI Signed-off-by: Akhil Narang --- .github/actions/setup/action.yml | 3 --- .github/helper/db/{postgres.json => sqlite.json} | 9 ++------- .github/workflows/_base-server-tests.yml | 15 ++------------- .github/workflows/server-tests.yml | 2 +- 4 files changed, 5 insertions(+), 24 deletions(-) rename .github/helper/db/{postgres.json => sqlite.json} (65%) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3e220bb9fc..b40f496094 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -166,9 +166,6 @@ runs: mariadb --host 127.0.0.1 --port 3306 -u root -p${{ inputs.db-root-password }} -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"; mariadb --host 127.0.0.1 --port 3306 -u root -p${{ inputs.db-root-password }} -e "FLUSH PRIVILEGES"; - elif [ "$DB" == "postgres" ]; then - echo "${{ inputs.db-root-password }}" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_frappe" -U postgres; - echo "${{ inputs.db-root-password }}" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres; fi - shell: bash -e {0} diff --git a/.github/helper/db/postgres.json b/.github/helper/db/sqlite.json similarity index 65% rename from .github/helper/db/postgres.json rename to .github/helper/db/sqlite.json index ea15dc82ee..8efe96a748 100644 --- a/.github/helper/db/postgres.json +++ b/.github/helper/db/sqlite.json @@ -1,9 +1,6 @@ { - "db_host": "127.0.0.1", - "db_port": 5432, "db_name": "test_frappe", - "db_password": "test_frappe", - "db_type": "postgres", + "db_type": "sqlite", "allow_tests": true, "auto_email_id": "test@example.com", "mail_server": "localhost", @@ -11,8 +8,6 @@ "mail_login": "test@example.com", "mail_password": "test", "admin_password": "admin", - "root_login": "postgres", - "root_password": "db_root", "host_name": "http://test_site:8000", "server_script_enabled": true -} \ No newline at end of file +} diff --git a/.github/workflows/_base-server-tests.yml b/.github/workflows/_base-server-tests.yml index aa47c70ef1..a362c97eec 100644 --- a/.github/workflows/_base-server-tests.yml +++ b/.github/workflows/_base-server-tests.yml @@ -18,7 +18,7 @@ on: required: false type: number default: 2 - enable-postgres: + enable-sqlite: required: false type: boolean default: false @@ -63,7 +63,7 @@ jobs: strategy: fail-fast: false matrix: - db: ${{ fromJson(inputs.enable-postgres && '["mariadb", "postgres"]' || '["mariadb"]') }} + db: ${{ fromJson(inputs.enable-sqlite && '["mariadb", "sqlite"]' || '["mariadb"]') }} index: ${{ fromJson(needs.gen-idx-integration.outputs.indices) }} services: mariadb: @@ -73,17 +73,6 @@ jobs: options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=5s --health-timeout=2s --health-retries=3 env: MARIADB_ROOT_PASSWORD: ${{ env.DB_ROOT_PASSWORD }} - postgres: - image: postgres:12.4 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - env: - POSTGRES_PASSWORD: ${{ env.DB_ROOT_PASSWORD }} smtp_server: image: rnwood/smtp4dev:3.7.1 ports: diff --git a/.github/workflows/server-tests.yml b/.github/workflows/server-tests.yml index d99879923d..78e8d7b0d6 100644 --- a/.github/workflows/server-tests.yml +++ b/.github/workflows/server-tests.yml @@ -44,7 +44,7 @@ jobs: name: Tests uses: ./.github/workflows/_base-server-tests.yml with: - enable-postgres: true # This will test against both MariaDB and PostgreSQL + enable-sqlite: true # This will test against both MariaDB and PostgreSQL parallel-runs: 2 enable-coverage: ${{ github.event_name != 'pull_request' }} fake-success: ${{ needs.checkrun.outputs.build != 'strawberry' }}