diff --git a/.github/scripts/run_ci.sh b/.github/scripts/run_ci.sh index c63b6749f6..4edc43d881 100755 --- a/.github/scripts/run_ci.sh +++ b/.github/scripts/run_ci.sh @@ -62,6 +62,15 @@ npm install if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then echo "Step: Running tests..." + # On Linux, we run the Joplin Server tests using PostgreSQL + if [ "$IS_LINUX" == "1" ]; then + echo "Running Joplin Server tests using PostgreSQL..." + sudo docker-compose --file docker-compose.db-dev.yml up -d + export JOPLIN_TESTS_SERVER_DB=pg + else + echo "Running Joplin Server tests using SQLite..." + fi + # Need this because we're getting this error: # # @joplin/lib: FATAL ERROR: Ineffective mark-compacts near heap limit diff --git a/.github/workflows/github-actions-main.yml b/.github/workflows/github-actions-main.yml index cfd3abeddc..759a06b435 100644 --- a/.github/workflows/github-actions-main.yml +++ b/.github/workflows/github-actions-main.yml @@ -29,7 +29,8 @@ jobs: brew install translate-toolkit - name: Install Docker Engine - if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v') + # if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v') + if: runner.os == 'Linux' run: | sudo apt-get install -y apt-transport-https sudo apt-get install -y ca-certificates diff --git a/packages/lib/models/Folder.sharing.test.ts b/packages/lib/models/Folder.sharing.test.ts index 90318af8b9..1cab7719ae 100644 --- a/packages/lib/models/Folder.sharing.test.ts +++ b/packages/lib/models/Folder.sharing.test.ts @@ -414,11 +414,6 @@ describe('models/Folder.sharing', function() { note3 = await Note.load(note3.id); note4 = await Note.load(note4.id); - console.info(note1.body); - console.info(note2.body); - console.info(note3.body); - console.info(note4.body); - expect(note1.body).not.toBe(note2.body); expect(note1.body).not.toBe(note3.body); expect(note1.body).not.toBe(note4.body); diff --git a/packages/server/src/utils/testing/testUtils.ts b/packages/server/src/utils/testing/testUtils.ts index 7633bea89a..0fd536ea83 100644 --- a/packages/server/src/utils/testing/testUtils.ts +++ b/packages/server/src/utils/testing/testUtils.ts @@ -78,22 +78,24 @@ export async function beforeAllDb(unitName: string, createDbOptions: CreateDbOpt // // sudo docker compose -f docker-compose.db-dev.yml up - // await initConfig(Env.Dev, parseEnv({ - // DB_CLIENT: 'pg', - // POSTGRES_DATABASE: unitName, - // POSTGRES_USER: 'joplin', - // POSTGRES_PASSWORD: 'joplin', - // SUPPORT_EMAIL: 'testing@localhost', - // }), { - // tempDir: tempDir, - // }); - - await initConfig(Env.Dev, parseEnv({ - SQLITE_DATABASE: createdDbPath_, - SUPPORT_EMAIL: 'testing@localhost', - }), { - tempDir: tempDir, - }); + if (process.env.JOPLIN_TESTS_SERVER_DB === 'pg') { + await initConfig(Env.Dev, parseEnv({ + DB_CLIENT: 'pg', + POSTGRES_DATABASE: unitName, + POSTGRES_USER: 'joplin', + POSTGRES_PASSWORD: 'joplin', + SUPPORT_EMAIL: 'testing@localhost', + }), { + tempDir: tempDir, + }); + } else { + await initConfig(Env.Dev, parseEnv({ + SQLITE_DATABASE: createdDbPath_, + SUPPORT_EMAIL: 'testing@localhost', + }), { + tempDir: tempDir, + }); + } initGlobalLogger();