From 4f0eff203ae23b5d63f55f2a991afb626457f7e7 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Tue, 16 Jun 2020 22:40:26 -0400 Subject: [PATCH 1/3] Re-enables e2e tests --- docker/docker-compose.yml | 61 +++++++++++++++++++-------------------- e2e/protractor.conf.js | 4 +-- package.json | 12 ++++---- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6a5c4e7..4b1fa28 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,11 +1,5 @@ version: "3.3" services: - ldap: - container_name: ldap - image: tuxmonteiro/ldap-mock - ports: - - "3890:3890" - db: container_name: db image: sartography/cr-connect-db:$E2E_TAG @@ -17,33 +11,10 @@ services: - POSTGRES_MULTIPLE_DATABASES=crc_test,pb_test healthcheck: test: ["CMD", "pg_isready"] - timeout: 20s + interval: 10s + timeout: 5s retries: 10 - backend: - container_name: backend - depends_on: - - db - image: sartography/cr-connect-workflow:$E2E_TAG - environment: - - APPLICATION_ROOT=/ - - CORS_ALLOW_ORIGINS=localhost:5002,bpmn:5002,localhost:4200,frontend:4200 - - DB_HOST=db - - DB_NAME=crc_test - - DB_PASSWORD=crc_pass - - DB_PORT=5432 - - DB_USER=crc_user - - LDAP_URL=ldap - - PB_ENABLED=true - - PB_BASE_URL=http://pb:5001/v2.0/ - - PORT0=5000 - - RESET_DB=true - - UPGRADE_DB=true - - TESTING=true - ports: - - "5000:5000" - command: ./wait-for-it.sh db:5432 -t 0 -- ./docker_run.sh - pb: container_name: pb depends_on: @@ -63,6 +34,34 @@ services: - "5001:5001" command: ./wait-for-it.sh db:5432 -t 0 -- ./docker_run.sh + backend: + container_name: backend + depends_on: + - db + - pb + image: sartography/cr-connect-workflow:$E2E_TAG + environment: + - APPLICATION_ROOT=/ + - CORS_ALLOW_ORIGINS=localhost:5002,bpmn:5002,localhost:4200,frontend:4200 + - DB_HOST=db + - DB_NAME=crc_test + - DB_PASSWORD=crc_pass + - DB_PORT=5432 + - DB_USER=crc_user + - DEVELOPMENT=true + - LDAP_URL=mock + - PB_BASE_URL=http://pb:5001/v2.0/ + - PB_ENABLED=true + - PORT0=5000 + - PRODUCTION=false + - RESET_DB=true + - TESTING=false + - UPGRADE_DB=true + ports: + - "5000:5000" + command: ./wait-for-it.sh pb:5001 -t 0 -- ./docker_run.sh + + # bpmn: # container_name: bpmn # depends_on: diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index 85510bf..c6b42bd 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -4,7 +4,7 @@ const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { - allScriptsTimeout: 11000, + allScriptsTimeout: 60000, specs: [ './src/**/*.e2e-spec.ts' ], @@ -21,7 +21,7 @@ exports.config = { framework: 'jasmine', jasmineNodeOpts: { showColors: true, - defaultTimeoutInterval: 30000, + defaultTimeoutInterval: 60000, print: function() {} }, onPrepare() { diff --git a/package.json b/package.json index de3ad60..099487b 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,13 @@ "test:coverage": "ng test --codeCoverage=true --watch=false --browsers=ChromeHeadless", "lint": "ng lint", "e2e": "./node_modules/protractor/bin/webdriver-manager update && ng e2e", - "e2e:with-wf": "npm run e2e-wf && ng e2e && npm run e2e-wf:stop", - "e2e-wf:stop": "cd docker && docker-compose down && cd ..", - "e2e-wf:build": "cd docker && docker-compose pull && docker-compose build && cd ..", - "e2e-wf:start": "cd docker && docker-compose up -d --force-recreate && cd ..", - "e2e-wf": "npm run e2e-wf:stop && npm run e2e-wf:build && npm run e2e-wf:start", + "e2e:with-backend": "npm run backend && ng e2e && npm run backend:stop", + "backend:stop": "cd docker && docker-compose down && cd ..", + "backend:build": "cd docker && docker-compose pull && docker-compose build && cd ..", + "backend:start": "cd docker && docker-compose up -d --force-recreate && cd ..", + "backend": "npm run backend:stop && npm run backend:build && npm run backend:start", "env": "chmod +x ./docker/substitute-env-variables.sh && ./docker/substitute-env-variables.sh src/index.html PRODUCTION,API_URL,IRB_URL,HOME_ROUTE,BASE_HREF,DEPLOY_URL,PORT0,GOOGLE_ANALYTICS_KEY,SENTRY_KEY,TITLE", - "ci": "npm run lint && npm run test:coverage && sonar-scanner" + "ci": "npm run lint && npm run test:coverage && sonar-scanner && npm run env && npm run backend && npm run e2e" }, "private": true, "dependencies": { From 8933908a9e6e19f1ed6ebb65024b012f47429bf5 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Wed, 17 Jun 2020 09:10:23 -0400 Subject: [PATCH 2/3] Fixes failing test --- e2e/src/app.e2e-spec.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts index 950e019..ebb569d 100644 --- a/e2e/src/app.e2e-spec.ts +++ b/e2e/src/app.e2e-spec.ts @@ -7,13 +7,10 @@ describe('workspace-project App', () => { page = new AppPage(); }); - it('should display fake sign-in screen', () => { + it('should display home screen', () => { page.navigateTo(); - expect(page.getText('h1')).toEqual('FAKE UVA NETBADGE SIGN IN (FOR TESTING ONLY)'); - }); - - it('should click sign-in and navigate to home screen', () => { - page.clickAndExpectRoute('#sign_in', '/home'); + expect(page.getText('h1')).toEqual('Workflow Specifications'); + expect(page.getRoute()).toEqual('/home'); expect(page.getElements('app-workflow-spec-list').count()).toBeGreaterThan(0); expect(page.getElements('app-file-list').count()).toBeGreaterThan(0); }); From f929d33aedbf4a51495bf0a91ecf1659181f6deb Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Wed, 17 Jun 2020 15:39:35 -0400 Subject: [PATCH 3/3] Updates sartography-workflow-lib --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 15db4d5..6e68585 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12356,9 +12356,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sartography-workflow-lib": { - "version": "0.0.265", - "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.265.tgz", - "integrity": "sha512-cb1Wc09m83hgpjz7d60KHGDjHvrpq6oZns8lL+kgjFUrGwsL8lRxwsjt1cOGMnCTzi48icybEogvSsluhU7RhA==" + "version": "0.0.266", + "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.266.tgz", + "integrity": "sha512-xUYCWdZox3JE/ABSx5ax0cn/3PRiC6K28QYe4keVpQfn43wEqyn3iuI8I7G4WyjfYgzTH3kLaw5g/qezrRJh0Q==" }, "sass": { "version": "1.23.3", diff --git a/package.json b/package.json index 099487b..4bf6e0f 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "ngx-file-drop": "^8.0.8", "ngx-markdown": "^9.0.0", "rxjs": "~6.5.4", - "sartography-workflow-lib": "0.0.265", + "sartography-workflow-lib": "0.0.266", "tslib": "^1.11.1", "uuid": "^7.0.2", "zone.js": "^0.10.3"