mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-24 01:25:59 +00:00
cypress test WIP
This commit is contained in:
31
.github/workflows/e2e-tests.yaml
vendored
31
.github/workflows/e2e-tests.yaml
vendored
@@ -16,22 +16,33 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y xvfb libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6
|
apt-get install -y xvfb libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6
|
||||||
- name: Context
|
|
||||||
env:
|
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
||||||
run: echo "$GITHUB_CONTEXT"
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
- name: yarn install
|
- name: yarn install
|
||||||
run: |
|
run: |
|
||||||
yarn install
|
yarn install
|
||||||
- name: Cypress run
|
- name: Build
|
||||||
uses: cypress-io/github-action@v6
|
run: |
|
||||||
with:
|
yarn prepare:packer
|
||||||
build: yarn prepare:packer
|
- name: yarn install cypress
|
||||||
start: node packer/build/bundle.js --listen-api --static-dir packer/build/public
|
run: |
|
||||||
project: ./e2e-tests
|
cd e2e-tests
|
||||||
|
yarn install
|
||||||
|
- name: Start backend server
|
||||||
|
run: |
|
||||||
|
node packer/build/bundle.js --listen-api --run-packer-build &
|
||||||
|
echo $! > backend.pid
|
||||||
|
- name: Run Cypress tests
|
||||||
|
run: |
|
||||||
|
cd e2e-tests
|
||||||
|
yarn cy:run
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
- name: Stop backend server
|
||||||
|
run: |
|
||||||
|
kill $(cat backend.pid)
|
||||||
|
rm backend.pid
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
|
|||||||
@@ -78,8 +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) {
|
} else if (processArgs.runPackerBuild) {
|
||||||
app.use(getExpressPath('/'), express.static(processArgs.staticDir));
|
app.use(getExpressPath('/'), express.static(path.resolve('packer/build/public')));
|
||||||
} else if (platformInfo.isNpmDist) {
|
} else if (platformInfo.isNpmDist) {
|
||||||
app.use(
|
app.use(
|
||||||
getExpressPath('/'),
|
getExpressPath('/'),
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ function packagedPluginsDir() {
|
|||||||
// return path.resolve(__dirname, '../../plugins');
|
// return path.resolve(__dirname, '../../plugins');
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
if (processArgs.runPackerBuild) {
|
||||||
|
return path.resolve('packer/build/plugins');
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +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');
|
const runPackerBuild = process.argv.includes('--run-packer-build');
|
||||||
|
|
||||||
function getPassArgs() {
|
function getPassArgs() {
|
||||||
const res = [];
|
const res = [];
|
||||||
@@ -24,6 +24,9 @@ function getPassArgs() {
|
|||||||
if (listenApiChild) {
|
if (listenApiChild) {
|
||||||
res.push('listen-api-child');
|
res.push('listen-api-child');
|
||||||
}
|
}
|
||||||
|
if (runPackerBuild) {
|
||||||
|
res.push('--run-packer-build');
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,5 +40,5 @@ module.exports = {
|
|||||||
listenApi,
|
listenApi,
|
||||||
listenApiChild,
|
listenApiChild,
|
||||||
processDisplayName,
|
processDisplayName,
|
||||||
staticDir,
|
runPackerBuild,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user