mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 21:26:00 +00:00
SYNC: fixed SQLite E2E tests (use absolute folder)
This commit is contained in:
committed by
Diflow
parent
0ece662d8c
commit
b40168182a
@@ -17,8 +17,8 @@ function clearTestingData() {
|
||||
if (fs.existsSync(path.join(baseDir, 'archive-e2etests'))) {
|
||||
fs.rmdirSync(path.join(baseDir, 'archive-e2etests'), { recursive: true });
|
||||
}
|
||||
if (fs.existsSync(path.join(__dirname, '../my_guitar_shop.db'))) {
|
||||
fs.unlinkSync(path.join(__dirname, '../my_guitar_shop.db'));
|
||||
if (fs.existsSync(path.join(__dirname, 'tmpdata', 'my_guitar_shop.db'))) {
|
||||
fs.unlinkSync(path.join(__dirname, 'tmpdata', 'my_guitar_shop.db'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
3
e2e-tests/env/multi-sql/.env
vendored
3
e2e-tests/env/multi-sql/.env
vendored
@@ -1,4 +1,5 @@
|
||||
CONNECTIONS=mysql,postgres,mssql,oracle,sqlite
|
||||
LOG_CONNECTION_SENSITIVE_VALUES=true
|
||||
|
||||
LABEL_mysql=MySql-connection
|
||||
SERVER_mysql=localhost
|
||||
@@ -32,5 +33,5 @@ PORT_mssql=16014
|
||||
ENGINE_mssql=mssql@dbgate-plugin-mssql
|
||||
|
||||
LABEL_sqlite=Sqlite-connection
|
||||
FILE_sqlite=my_guitar_shop.db
|
||||
FILE_sqlite=%%E2E_TEST_DATA_DIRECTORY%%/my_guitar_shop.db
|
||||
ENGINE_sqlite=sqlite@dbgate-plugin-sqlite
|
||||
|
||||
@@ -97,7 +97,10 @@ async function run() {
|
||||
if (localconfig.sqlite) {
|
||||
await createDb(
|
||||
{
|
||||
databaseFile: process.env.FILE_sqlite,
|
||||
databaseFile: process.env.FILE_sqlite.replace(
|
||||
'%%E2E_TEST_DATA_DIRECTORY%%',
|
||||
path.join(path.dirname(__dirname), 'tmpdata')
|
||||
),
|
||||
singleDatabase: true,
|
||||
engine: 'sqlite@dbgate-plugin-sqlite',
|
||||
},
|
||||
|
||||
0
e2e-tests/tmpdata/.gitkeep
Normal file
0
e2e-tests/tmpdata/.gitkeep
Normal file
@@ -62,7 +62,10 @@ function getPortalCollections() {
|
||||
port: process.env[`PORT_${id}`],
|
||||
databaseUrl: process.env[`URL_${id}`],
|
||||
useDatabaseUrl: !!process.env[`URL_${id}`],
|
||||
databaseFile: process.env[`FILE_${id}`],
|
||||
databaseFile: process.env[`FILE_${id}`]?.replace(
|
||||
'%%E2E_TEST_DATA_DIRECTORY%%',
|
||||
path.join(path.dirname(path.dirname(__dirname)), 'e2e-tests', 'tmpdata')
|
||||
),
|
||||
socketPath: process.env[`SOCKET_PATH_${id}`],
|
||||
serviceName: process.env[`SERVICE_NAME_${id}`],
|
||||
authType: process.env[`AUTH_TYPE_${id}`] || (process.env[`SOCKET_PATH_${id}`] ? 'socket' : undefined),
|
||||
|
||||
@@ -88,6 +88,9 @@ function decryptConnection(connection) {
|
||||
}
|
||||
|
||||
function pickSafeConnectionInfo(connection) {
|
||||
if (process.env.LOG_CONNECTION_SENSITIVE_VALUES) {
|
||||
return connection;
|
||||
}
|
||||
return _.mapValues(connection, (v, k) => {
|
||||
if (k == 'engine' || k == 'port' || k == 'authType' || k == 'sshMode' || k == 'passwordMode') return v;
|
||||
if (v === null || v === true || v === false) return v;
|
||||
|
||||
Reference in New Issue
Block a user