Skip to content

Commit

Permalink
chore(v2): misc build pipeline updates in preparation for merging int…
Browse files Browse the repository at this point in the history
…o main branch (#5010)

* fix(test): update AngularJS's feedback generator quote check

should not have any quotes prefix since AngularJS's generator had no changes

* chore: run correct AngularJS test script in GitHub Actions

* fix: update test-e2e-build command

* feat: update validator package to v13.7.0

* chore: update github actions workflows to work on any branch

* chore: update chromatic to run on all branches
  • Loading branch information
karrui authored Oct 5, 2022
1 parent 93d1ade commit 40331be
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 64 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ on:
push:
branches:
- 'form-v2/develop'
- 'develop'
pull_request:
branches:
# PR events to branches matching refs/heads/form-v2
- 'form-v2'
- 'form-v2/**'

# List of jobs
jobs:
Expand All @@ -41,6 +38,6 @@ jobs:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: frontend
autoAcceptChanges: form-v2/develop
autoAcceptChanges: develop
exitOnceUploaded: true
onlyChanged: true
32 changes: 1 addition & 31 deletions .github/workflows/ci-angularjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ name: CI (AngularJS)

on:
push:
branches-ignore:
# Push events to branches matching refs/heads/form-v2
- 'form-v2'
- 'form-v2/**'
pull_request:
branches-ignore:
# PRs to branches matching refs/heads/form-v2
- 'form-v2'
- 'form-v2/**'
types: [opened, reopened]

jobs:
Expand Down Expand Up @@ -104,26 +96,4 @@ jobs:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test:frontend

test-backend:
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-backend
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: npm run test:angularjs
8 changes: 0 additions & 8 deletions .github/workflows/ci-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ name: CI (React)

on:
push:
branches:
# Push events to branches matching refs/heads/form-v2
- 'form-v2'
- 'form-v2/**'
pull_request:
branches:
# PR events to branches matching refs/heads/form-v2
- 'form-v2'
- 'form-v2/**'
types: [opened, reopened]

jobs:
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"test:backend:watch": "env-cmd -f tests/.test-env jest --watch",
"test:frontend": "npm --prefix frontend test",
"build": "npm run clean && npm run build:backend && npm run build:frontend && npm run build:old-frontend",
"test:angularjs": "jest --config=tests/unit/frontend/jest.config.js",
"dev:angularjs": "webpack --config webpack.dev.js",
"build:old-frontend": "webpack --config webpack.prod.js",
"build:frontend": "npm run --prefix frontend build",
Expand All @@ -42,7 +43,7 @@
"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-build": "npm run build:backend && npm run dev:angularjs",
"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\"",
Expand Down
14 changes: 7 additions & 7 deletions shared/package-lock.json

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

2 changes: 1 addition & 1 deletion shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"libphonenumber-js": "^1.9.43",
"lodash": "^4.17.21",
"type-fest": "^2.8.0",
"validator": "^13.6.0",
"validator": "^13.7.0",
"zod": "^3.11.6"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ describe('FeedbackCsvGenerator', () => {
)
})

it('should add single quote before comment if comment starts with a formula character', () => {
// Testing for no regression in this generator as compared to the one in React.
it('should not add single quote before comment if comment starts with a formula character', () => {
// Arrange
const feedbackCsv = new FeedbackCsvGenerator(1)
const feedback: FormFeedbackDto = {
Expand All @@ -82,7 +83,7 @@ describe('FeedbackCsvGenerator', () => {
.tz('Asia/Singapore')
.format('DD MMM YYYY hh:mm:ss A')

const insertedLine = `${insertedCreatedDate},'${feedback.comment},${feedback.rating}`
const insertedLine = `${insertedCreatedDate},${feedback.comment},${feedback.rating}`

// Act
feedbackCsv.addLineFromFeedback(feedback)
Expand Down

0 comments on commit 40331be

Please sign in to comment.