chore: setup sqlite tests, drop postgres CI

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-02-19 16:58:38 +05:30
parent 69d22a8194
commit 2b92073aa7
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F
4 changed files with 5 additions and 24 deletions

View file

@ -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}

View file

@ -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
}
}

View file

@ -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:

View file

@ -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' }}