diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 147b2227a..a4c0d9883 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -12,6 +12,9 @@ jobs: container: node:18 steps: + - name: Install dependencies + run: | + apt-get install libgtk2.0-0t64 libgtk-3-0t64 libgbm-dev libnotify-dev libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb - name: Context env: GITHUB_CONTEXT: ${{ toJson(github) }} @@ -26,13 +29,10 @@ jobs: uses: cypress-io/github-action@v6 with: build: yarn prepare:packer - start: node packer/build/bundle.js --listen-api + start: node packer/build/bundle.js --listen-api --static-dir packer/build/public + with: + project: ./e2e-tests - - name: Cypress run - uses: cypress-io/github-action@v6 - with: - build: npm run build - start: npm start services: mysql: diff --git a/e2e-tests/package.json b/e2e-tests/package.json index 1c6b717ab..6c272e21f 100644 --- a/e2e-tests/package.json +++ b/e2e-tests/package.json @@ -7,6 +7,7 @@ "cypress": "^13.16.1" }, "scripts": { - "cy:open": "cypress open" + "cy:open": "cypress open", + "cy:run": "cypress run" } } diff --git a/packages/api/src/main.js b/packages/api/src/main.js index 9fb3fbe53..0b008b03c 100644 --- a/packages/api/src/main.js +++ b/packages/api/src/main.js @@ -28,6 +28,7 @@ const files = require('./controllers/files'); const scheduler = require('./controllers/scheduler'); const queryHistory = require('./controllers/queryHistory'); const onFinished = require('on-finished'); +const processArgs = require('./utility/processArgs'); const { rundir } = require('./utility/directories'); const platformInfo = require('./utility/platformInfo'); @@ -77,6 +78,8 @@ 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.staticDir) { + app.use(getExpressPath('/'), express.static(processArgs.staticDir)); } else if (platformInfo.isNpmDist) { app.use( getExpressPath('/'), diff --git a/packages/api/src/utility/processArgs.js b/packages/api/src/utility/processArgs.js index b00877cce..72e977bf5 100644 --- a/packages/api/src/utility/processArgs.js +++ b/packages/api/src/utility/processArgs.js @@ -14,6 +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 staticDir = getNamedArg('--static-dir'); function getPassArgs() { const res = []; @@ -36,4 +37,5 @@ module.exports = { listenApi, listenApiChild, processDisplayName, + staticDir, };