ci: Run db tests with a table-prefix as well (no-changelog) (#5818)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-03-30 15:09:13 +02:00 committed by GitHub
parent 0b0024d722
commit e4796c169b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -48,6 +48,10 @@ jobs:
working-directory: packages/cli
run: pnpm test:postgres:alt-schema
- name: Test Postgres (table prefix)
working-directory: packages/cli
run: pnpm test:postgres:with-table-prefix
- name: Notify Slack on failure
uses: act10ns/slack@v2.0.0
if: failure()

View file

@ -36,9 +36,10 @@
"swagger": "swagger-cli",
"test": "pnpm test:sqlite",
"test:sqlite": "N8N_LOG_LEVEL=silent DB_TYPE=sqlite jest",
"test:postgres": "N8N_LOG_LEVEL=silent DB_TYPE=postgresdb jest",
"test:postgres": "N8N_LOG_LEVEL=silent DB_TYPE=postgresdb jest --no-coverage",
"test:postgres:alt-schema": "DB_POSTGRESDB_SCHEMA=alt_schema pnpm test:postgres",
"test:mysql": "N8N_LOG_LEVEL=silent DB_TYPE=mysqldb jest",
"test:postgres:with-table-prefix": "DB_TABLE_PREFIX=xyz_ pnpm test:postgres",
"test:mysql": "N8N_LOG_LEVEL=silent DB_TYPE=mysqldb jest --no-coverage",
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\"",
"typeorm": "ts-node -T ../../node_modules/typeorm/cli.js"
},

View file

@ -512,7 +512,7 @@ export const getSqliteOptions = ({ name }: { name: string }): ConnectionOptions
name,
type: 'sqlite',
database: ':memory:',
entityPrefix: '',
entityPrefix: config.getEnv('database.tablePrefix'),
dropSchema: true,
migrations: sqliteMigrations,
migrationsTableName: 'migrations',
@ -525,6 +525,7 @@ const baseOptions = (type: TestDBType) => ({
port: config.getEnv(`database.${type}db.port`),
username: config.getEnv(`database.${type}db.user`),
password: config.getEnv(`database.${type}db.password`),
entityPrefix: config.getEnv('database.tablePrefix'),
schema: type === 'postgres' ? config.getEnv('database.postgresdb.schema') : undefined,
});