]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: run e2e tests against prod build (jenkins job) 29198/head
authoralfonsomthd <almartin@redhat.com>
Thu, 25 Jul 2019 06:40:49 +0000 (08:40 +0200)
committeralfonsomthd <almartin@redhat.com>
Thu, 25 Jul 2019 06:40:49 +0000 (08:40 +0200)
Signed-off-by: alfonsomthd <almartin@redhat.com>
src/pybind/mgr/dashboard/frontend/package.json
src/pybind/mgr/dashboard/frontend/protractor.conf.js
src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh

index fe5acc3c74a2742bd56e16cd9a94b6a38546fd68..524d058985b3a1a1a716789fee6231e04eb52193 100644 (file)
@@ -12,7 +12,7 @@
     "test:ci": "npm run test:config && JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter",
     "test:config": "if [ ! -e 'src/unit-test-configuration.ts' ]; then cp 'src/unit-test-configuration.ts.sample' 'src/unit-test-configuration.ts'; fi",
     "e2e": "npm run env_build && ng e2e",
-    "e2e:dev": "npm run env_build && ng e2e --dev-server-target",
+    "e2e:ci": "npm run env_build && ng e2e --dev-server-target",
     "lint:tslint": "ng lint",
     "lint:prettier": "prettier --list-different \"{src,e2e}/**/*.{ts,scss}\"",
     "lint:html": "html-linter --config html-linter.config.json",
index edc0ffcf990de006d1186cb1b6e5d47b42ba3959..7898ef8d17c6c7e577dd844f44faebf42e95adaf 100644 (file)
@@ -15,7 +15,7 @@ exports.config = {
     }
   },
   directConnect: true,
-  baseUrl: 'http://localhost:4200/',
+  baseUrl: process.env.BASE_URL || 'http://localhost:4200/',
   framework: 'jasmine',
   jasmineNodeOpts: {
     showColors: true,
index 313cd392ba4d47b4ae13754b63a4508518174eac..cf7ee4bce6021710aabc3c4ff643666f92c87793 100755 (executable)
@@ -56,22 +56,23 @@ if [ "$BASE_URL" == "" ]; then
     # Set SSL verify to False
     ./bin/ceph dashboard set-rgw-api-ssl-verify False
 
-    BASE_URL=$(./bin/ceph mgr services | jq .dashboard)
+    BASE_URL=$(./bin/ceph mgr services | jq -r .dashboard)
 fi
 
+export BASE_URL
+
 cd $DASH_DIR/frontend
-jq .[].target=$BASE_URL proxy.conf.json.sample > proxy.conf.json
+jq .[].target=\"$BASE_URL\" proxy.conf.json.sample > proxy.conf.json
 
 . $BUILD_DIR/src/pybind/mgr/dashboard/node-env/bin/activate
-timeout 1h npm ci
 
 if [ "$DEVICE" == "chrome" ]; then
-    npm run e2e || stop 1
+    npm run e2e:ci || stop 1
     stop 0
 elif [ "$DEVICE" == "docker" ]; then
     failed=0
     docker run -d -v $(pwd):/workdir --net=host --name angular-e2e-container rogargon/angular-e2e || failed=1
-    docker exec angular-e2e-container npm run e2e || failed=1
+    docker exec -e BASE_URL=$BASE_URL angular-e2e-container npm run e2e:ci || failed=1
     docker stop angular-e2e-container
     docker rm angular-e2e-container
     stop $failed