mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 00:36:01 +00:00
e2e tests
This commit is contained in:
12
.github/workflows/e2e-tests.yaml
vendored
12
.github/workflows/e2e-tests.yaml
vendored
@@ -12,6 +12,9 @@ jobs:
|
|||||||
container: node:18
|
container: node:18
|
||||||
|
|
||||||
steps:
|
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
|
- name: Context
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
@@ -26,13 +29,10 @@ jobs:
|
|||||||
uses: cypress-io/github-action@v6
|
uses: cypress-io/github-action@v6
|
||||||
with:
|
with:
|
||||||
build: yarn prepare:packer
|
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:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"cypress": "^13.16.1"
|
"cypress": "^13.16.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cy:open": "cypress open"
|
"cy:open": "cypress open",
|
||||||
|
"cy:run": "cypress run"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const files = require('./controllers/files');
|
|||||||
const scheduler = require('./controllers/scheduler');
|
const scheduler = require('./controllers/scheduler');
|
||||||
const queryHistory = require('./controllers/queryHistory');
|
const queryHistory = require('./controllers/queryHistory');
|
||||||
const onFinished = require('on-finished');
|
const onFinished = require('on-finished');
|
||||||
|
const processArgs = require('./utility/processArgs');
|
||||||
|
|
||||||
const { rundir } = require('./utility/directories');
|
const { rundir } = require('./utility/directories');
|
||||||
const platformInfo = require('./utility/platformInfo');
|
const platformInfo = require('./utility/platformInfo');
|
||||||
@@ -77,6 +78,8 @@ function start() {
|
|||||||
app.use(getExpressPath('/'), express.static('/home/dbgate-docker/public'));
|
app.use(getExpressPath('/'), express.static('/home/dbgate-docker/public'));
|
||||||
} else if (platformInfo.isAwsUbuntuLayout) {
|
} else if (platformInfo.isAwsUbuntuLayout) {
|
||||||
app.use(getExpressPath('/'), express.static('/home/ubuntu/build/public'));
|
app.use(getExpressPath('/'), express.static('/home/ubuntu/build/public'));
|
||||||
|
} else if (processArgs.staticDir) {
|
||||||
|
app.use(getExpressPath('/'), express.static(processArgs.staticDir));
|
||||||
} else if (platformInfo.isNpmDist) {
|
} else if (platformInfo.isNpmDist) {
|
||||||
app.use(
|
app.use(
|
||||||
getExpressPath('/'),
|
getExpressPath('/'),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const workspaceDir = getNamedArg('--workspace-dir');
|
|||||||
const processDisplayName = getNamedArg('--process-display-name');
|
const processDisplayName = getNamedArg('--process-display-name');
|
||||||
const listenApi = process.argv.includes('--listen-api');
|
const listenApi = process.argv.includes('--listen-api');
|
||||||
const listenApiChild = process.argv.includes('--listen-api-child') || listenApi;
|
const listenApiChild = process.argv.includes('--listen-api-child') || listenApi;
|
||||||
|
const staticDir = getNamedArg('--static-dir');
|
||||||
|
|
||||||
function getPassArgs() {
|
function getPassArgs() {
|
||||||
const res = [];
|
const res = [];
|
||||||
@@ -36,4 +37,5 @@ module.exports = {
|
|||||||
listenApi,
|
listenApi,
|
||||||
listenApiChild,
|
listenApiChild,
|
||||||
processDisplayName,
|
processDisplayName,
|
||||||
|
staticDir,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user