Merge pull request #22903 from tspmelo/fix-e2e-script

mgr/dashboard: Fix e2e script

Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
This commit is contained in:
Lenz Grimmer 2018-07-09 14:37:32 +02:00 committed by GitHub
commit ebbc3bc241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -54,7 +54,8 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ceph-dashboard:build"
"browserTarget": "ceph-dashboard:build",
"proxyConfig": "proxy.conf.json"
},
"configurations": {
"production": {
@ -141,4 +142,4 @@
"prefix": "cd"
}
}
}
}

View File

@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json --host 0.0.0.0",
"start": "ng serve --host 0.0.0.0",
"build": "ng build",
"test": "jest --watch",
"test:ci": "jest --coverage",

View File

@ -44,19 +44,18 @@ if [ "$BASE_URL" == "" ]; then
sleep 10
BASE_URL=`./bin/ceph mgr services | jq .dashboard`
BASE_URL=${BASE_URL//\"}
fi
cd $DASH_DIR/frontend
jq '.["/api/"].target'=$BASE_URL proxy.conf.json.sample | jq '.["/ui-api/"].target'=$BASE_URL > proxy.conf.json
. $BUILD_DIR/src/pybind/mgr/dashboard/node-env/bin/activate
npm install
npm run build -- --prod
if [ $DEVICE == "chrome" ]; then
npm run e2e -- --serve=false --base-href $BASE_URL || stop
npm run e2e || stop
elif [ $DEVICE == "docker" ]; then
docker run -d -v $(pwd):/workdir --net=host --name angular-e2e-container rogargon/angular-e2e || stop
docker exec angular-e2e-container npm run e2e -- --serve=false --base-href $BASE_URL
docker exec angular-e2e-container npm run e2e
docker stop angular-e2e-container
docker rm angular-e2e-container
else