mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
ci: Run db tests with a table-prefix as well (no-changelog) (#5818)
This commit is contained in:
committed by
GitHub
parent
0b0024d722
commit
e4796c169b
4
.github/workflows/ci-postgres-mysql.yml
vendored
4
.github/workflows/ci-postgres-mysql.yml
vendored
@@ -48,6 +48,10 @@ jobs:
|
|||||||
working-directory: packages/cli
|
working-directory: packages/cli
|
||||||
run: pnpm test:postgres:alt-schema
|
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
|
- name: Notify Slack on failure
|
||||||
uses: act10ns/slack@v2.0.0
|
uses: act10ns/slack@v2.0.0
|
||||||
if: failure()
|
if: failure()
|
||||||
|
|||||||
@@ -36,9 +36,10 @@
|
|||||||
"swagger": "swagger-cli",
|
"swagger": "swagger-cli",
|
||||||
"test": "pnpm test:sqlite",
|
"test": "pnpm test:sqlite",
|
||||||
"test:sqlite": "N8N_LOG_LEVEL=silent DB_TYPE=sqlite jest",
|
"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: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\"",
|
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\"",
|
||||||
"typeorm": "ts-node -T ../../node_modules/typeorm/cli.js"
|
"typeorm": "ts-node -T ../../node_modules/typeorm/cli.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -512,7 +512,7 @@ export const getSqliteOptions = ({ name }: { name: string }): ConnectionOptions
|
|||||||
name,
|
name,
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: ':memory:',
|
database: ':memory:',
|
||||||
entityPrefix: '',
|
entityPrefix: config.getEnv('database.tablePrefix'),
|
||||||
dropSchema: true,
|
dropSchema: true,
|
||||||
migrations: sqliteMigrations,
|
migrations: sqliteMigrations,
|
||||||
migrationsTableName: 'migrations',
|
migrationsTableName: 'migrations',
|
||||||
@@ -525,6 +525,7 @@ const baseOptions = (type: TestDBType) => ({
|
|||||||
port: config.getEnv(`database.${type}db.port`),
|
port: config.getEnv(`database.${type}db.port`),
|
||||||
username: config.getEnv(`database.${type}db.user`),
|
username: config.getEnv(`database.${type}db.user`),
|
||||||
password: config.getEnv(`database.${type}db.password`),
|
password: config.getEnv(`database.${type}db.password`),
|
||||||
|
entityPrefix: config.getEnv('database.tablePrefix'),
|
||||||
schema: type === 'postgres' ? config.getEnv('database.postgresdb.schema') : undefined,
|
schema: type === 'postgres' ? config.getEnv('database.postgresdb.schema') : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user