]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix e2e script 22903/head
authorTiago Melo <tmelo@suse.com>
Fri, 6 Jul 2018 12:32:44 +0000 (13:32 +0100)
committerTiago Melo <tmelo@suse.com>
Fri, 6 Jul 2018 12:32:44 +0000 (13:32 +0100)
Angular 6 changed the cli and how you can configure the e2e cmd.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/angular.json
src/pybind/mgr/dashboard/frontend/package.json
src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh

index 037d517620a5e2079256a8abdc66c40fd43c72bc..96a685f4e8a15f8668b1ef82dc5ad43fd152cffe 100644 (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": {
       "prefix": "cd"
     }
   }
-}
\ No newline at end of file
+}
index 6b43c6b34b3626a480f2bc3d1dca6f79f92897b4..9975c6e9b6c8c037be52d4d2e074754b1ece5b8b 100644 (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",
index b831a33fa7136a5ed5c863a93162b77c27479248..190175edd8f514dff7777aaf130b28235ecaeb0e 100755 (executable)
@@ -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