Tools: Run Joplin Server Postgres tests on CI (#5807)

pull/5809/head
Laurent 2021-11-30 15:37:07 +00:00 committed by GitHub
parent 6eec0dd58e
commit 6bbf053a4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 22 deletions

View File

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

View File

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

View File

@ -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);

View File

@ -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();