test fixes

This commit is contained in:
SPRINX0\prochazka
2024-12-09 16:52:02 +01:00
parent 5405b9bf72
commit 7f367a1f84
9 changed files with 23 additions and 29 deletions

View File

@@ -43,6 +43,7 @@ function authMiddleware(req, res, next) {
'/connections/dblogin-app',
'/connections/dblogin-auth',
'/connections/dblogin-auth-token',
'/connections/reload-connection-list',
];
// console.log('********************* getAuthProvider()', getAuthProvider());

View File

@@ -510,4 +510,10 @@ module.exports = {
}
return null;
},
reloadConnectionList_meta: true,
async reloadConnectionList() {
if (portalConnections) return;
await this.datastore.unload();
},
};

View File

@@ -78,7 +78,7 @@ function start() {
app.use(getExpressPath('/'), express.static('/home/dbgate-docker/public'));
} else if (platformInfo.isAwsUbuntuLayout) {
app.use(getExpressPath('/'), express.static('/home/ubuntu/build/public'));
} else if (processArgs.runPackerBuild) {
} else if (processArgs.runE2eTests) {
app.use(getExpressPath('/'), express.static(path.resolve('packer/build/public')));
} else if (platformInfo.isNpmDist) {
app.use(

View File

@@ -23,6 +23,12 @@ class JsonLinesDatabase {
await fs.writeFile(this.filename, this.data.map(x => JSON.stringify(x)).join('\n'));
}
async unload() {
this.data = [];
this.loadedOk = false;
this.loadPerformed = false;
}
async _ensureLoaded() {
if (!this.loadPerformed) {
await lock.acquire('reader', async () => {

View File

@@ -96,7 +96,7 @@ function packagedPluginsDir() {
// return path.resolve(__dirname, '../../plugins');
// }
}
if (processArgs.runPackerBuild) {
if (processArgs.runE2eTests) {
return path.resolve('packer/build/plugins');
}
return null;

View File

@@ -14,7 +14,7 @@ const workspaceDir = getNamedArg('--workspace-dir');
const processDisplayName = getNamedArg('--process-display-name');
const listenApi = process.argv.includes('--listen-api');
const listenApiChild = process.argv.includes('--listen-api-child') || listenApi;
const runPackerBuild = process.argv.includes('--run-packer-build');
const runE2eTests = process.argv.includes('--run-e2e-tests');
function getPassArgs() {
const res = [];
@@ -24,8 +24,8 @@ function getPassArgs() {
if (listenApiChild) {
res.push('listen-api-child');
}
if (runPackerBuild) {
res.push('--run-packer-build');
if (runE2eTests) {
res.push('--run-e2e-tests');
}
return res;
}
@@ -40,5 +40,5 @@ module.exports = {
listenApi,
listenApiChild,
processDisplayName,
runPackerBuild,
runE2eTests,
};