Skip to content

Commit

Permalink
chore: remove e2e tests (#3146)
Browse files Browse the repository at this point in the history
* feat: remove tests/end-to-end folders

* chore(ci): remove test-e2e ci job

* feat(package.json): remove testcafe packages and related scripts

* fix: add missing lodash types package due to removal of testcafe

* docs: update README entry on end to end tests

* chore(ci/mergify): remove test-e2e condition to auto-merge
  • Loading branch information
karrui authored Dec 9, 2021
1 parent cccacdd commit bdcdd1d
Show file tree
Hide file tree
Showing 29 changed files with 202 additions and 5,734 deletions.
2 changes: 0 additions & 2 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pull_request_rules:
- check-success~=build
- check-success~=test-frontend
- check-success~=test-backend
- check-success~=test-e2e
- check-success~=Analyze # CodeQL / Analyze
- check-success~=CodeQL # CodeQL code scanning results
- check-success~=GitGuardian
Expand All @@ -26,7 +25,6 @@ pull_request_rules:
- check-success~=build
- check-success~=test-frontend
- check-success~=test-backend
- check-success~=test-e2e
- check-success~=Analyze # CodeQL / Analyze
- check-success~=CodeQL # CodeQL code scanning results
- check-success~=GitGuardian
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,6 @@ jobs:
- run: npm ci
- run: npm run build

test-e2e:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test-e2e

test-frontend:
needs: lint
runs-on: ubuntu-latest
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,7 @@ npm run test-ci

#### End-to-end tests

```bash
npm run test-e2e
```

will build both the frontend and backend then run our end-to-end tests. The tests are located at [`tests/end-to-end`](./tests/end-to-end). You will need to stop the Docker dev container to be able to run the end-to-end tests.

If you do not need to rebuild the frontend and backend, you can run

```bash
npm run test-e2e-ci
```
Removed in [#3146](https://github.com/opengovsg/FormSG/pull/3146). Will be reimplemented when the React app is ready.

## Architecture

Expand Down
2,842 changes: 192 additions & 2,650 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
"dev": "docker-compose up --build",
"docker-dev": "npm run build-frontend-dev:watch & ts-node-dev --respawn --transpile-only --inspect=0.0.0.0 --exit-child -r dotenv/config -- src/app/server.ts",
"test": "npm run test-backend && npm run test-frontend",
"download-binary": "node tests/end-to-end/helpers/get-mongo-binary.js",
"test-e2e": "npm run test-e2e-build && npm run test-e2e-ci",
"test-e2e-build": "npm run build-backend && npm run build-frontend-dev",
"test-e2e-ci": "env-cmd -f tests/.test-env --use-shell \"npm run download-binary && npm run testcafe-command\"",
"testcafe-command": "testcafe --skip-js-errors -c 2 chrome:headless ./tests/end-to-end --app \"npm run test-e2e-server\" --app-init-delay 10000",
"test-e2e-server": "concurrently --success last --kill-others \"mockpass\" \"maildev\" \"node dist/backend/src/app/server.js\" \"node ./tests/mock-webhook-server.js\"",
"lint-code": "eslint src/ --quiet --fix",
"lint-style": "stylelint '*/**/*.css' --quiet --fix",
"lint-html": "htmlhint && prettier --write './src/public/**/*.html' --ignore-path './dist/**' --loglevel silent",
Expand Down Expand Up @@ -181,6 +175,7 @@
"@types/ip": "^1.1.0",
"@types/jest": "^27.0.3",
"@types/json-stringify-safe": "^5.0.0",
"@types/lodash": "^4.14.177",
"@types/mongodb": "^3.6.20",
"@types/mongodb-uri": "^0.9.1",
"@types/node": "^14.18.0",
Expand Down Expand Up @@ -243,7 +238,6 @@
"supertest": "^6.1.6",
"supertest-session": "^4.1.0",
"terser-webpack-plugin": "^1.2.3",
"testcafe": "=1.15.1",
"ts-essentials": "^9.0.0",
"ts-jest": "^26.5.6",
"ts-loader": "^7.0.5",
Expand Down
6 changes: 6 additions & 0 deletions shared/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"zod": "^3.7.2"
},
"devDependencies": {
"@types/lodash": "^4.14.177",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"eslint-config-prettier": "^8.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/bounce/__tests__/bounce.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import axios from 'axios'
import { ObjectId } from 'bson'
import crypto from 'crypto'
import dedent from 'dedent'
import dedent from 'dedent-js'
import { cloneDeep, omit, pick } from 'lodash'
import mongoose from 'mongoose'
import { errAsync, okAsync } from 'neverthrow'
Expand Down
7 changes: 0 additions & 7 deletions tests/end-to-end/.eslintrc

This file was deleted.

250 changes: 0 additions & 250 deletions tests/end-to-end/email-submission.e2e.js

This file was deleted.

Loading

0 comments on commit bdcdd1d

Please sign in to comment.