Skip to content

Commit

Permalink
feat: doorway specific changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan committed Mar 6, 2024
1 parent 484dd21 commit 1ed0807
Show file tree
Hide file tree
Showing 84 changed files with 7,906 additions and 8,935 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cypress_public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
- name: yarn in root dir
run: yarn

- name: yarn in backend/core dir
working-directory: ./backend/core
- name: yarn in api dir
working-directory: ./api
run: yarn

- name: Check postgres
Expand All @@ -73,7 +73,7 @@ jobs:
PGPASSWORD: bloom

- name: Setup backend
run: yarn test:backend:core:dbsetup
run: yarn test:backend:new:dbsetup:withseed
env:
PGHOST: 127.0.0.1
PGPASSWORD: bloom
Expand All @@ -96,9 +96,9 @@ jobs:
with:
working-directory: ./sites/public
build: yarn build
start: yarn dev:listings, yarn start
start: yarn dev:new-backend, yarn start
wait-on: 'http://localhost:3100/jurisdictions'
record: false # set this value to true to record videos in cypress cloud for debugging purposes - skip passing tests
record: true # set this value to true to record videos in cypress cloud for debugging purposes - skip passing tests
env:
CYPRESS_RECORD_KEY: ${{ secrets.PUBLIC_CYPRESS_RECORD_KEY }}

Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ env:
TEST_DATABASE_URL: postgres://bloom-dev:[email protected]:5432/bloom_test
BLOOM_API_BASE: https://fake_website.fake
BLOOM_LISTINGS_QUERY: "/fake"
TWILIO_ACCOUNT_SID: 'AC.TEST'
TWILIO_AUTH_TOKEN: 'TEST'
MFA_CODE_VALID: '600000'
MFA_CODE_LENGTH: 5
AUTH_LOCK_LOGIN_COOLDOWN: '1800000'
AUTH_LOCK_LOGIN_AFTER_FAILED_ATTEMPTS: '5'

jobs:
backend-integration:
Expand Down Expand Up @@ -43,26 +49,23 @@ jobs:
with:
node-version: 18

- name: yarn in root dir
run: yarn

- name: yarn in backend/core dir
working-directory: ./backend/core
- name: yarn in api dir
working-directory: ./api
run: yarn

- name: Check postgres
run: pg_isready -h 127.0.0.1 -p 5432

- name: Not sure why but there is a dependency on this database existing
run: psql -c 'CREATE DATABASE bloom_test;'
env:
PGHOST: 127.0.0.1
PGPASSWORD: bloom
PGUSER: bloom-dev
# - name: Not sure why but there is a dependency on this database existing
# run: psql -c 'CREATE DATABASE bloom_test;'
# env:
# PGHOST: 127.0.0.1
# PGPASSWORD: bloom
# PGUSER: bloom-dev

- name: yarn e2e tests backend
working-directory: ./backend/core
run: yarn test:e2e:local
- name: yarn e2e tests api
working-directory: ./api
run: yarn test:e2e
env:
PGHOST: 127.0.0.1
PGPASSWORD: bloom
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/unit_tests_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Backend Unit

on:
pull_request:
branches:
- main
env:
APP_SECRET: 'SOME-LONG-SECRET-KEY'
DATABASE_URL: postgres://bloom-dev:[email protected]:5432/bloom
EMAIL_API_KEY: 'SG.SOME-LONG-SECRET-KEY'
TWILIO_ACCOUNT_SID: 'AC.TEST'
TWILIO_AUTH_TOKEN: 'TEST'
MFA_CODE_VALID: '600000'
MFA_CODE_LENGTH: 5
AUTH_LOCK_LOGIN_COOLDOWN: '1800000'
AUTH_LOCK_LOGIN_AFTER_FAILED_ATTEMPTS: '5'
TWILIO_PHONE_NUMBER: '123456789'

jobs:
backend-unit:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 18

- name: yarn in api
working-directory: ./api
run: yarn

# Tests
- name: yarn unit test api
working-directory: ./api
run: yarn test
43 changes: 0 additions & 43 deletions .github/workflows/unit_tests_backend_core.yml

This file was deleted.

10 changes: 8 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@
"db:migration:run": "yarn prisma migrate deploy",
"db:seed:production": "npx prisma db seed -- --environment production",
"db:seed:staging": "npx prisma db seed -- --environment staging",
"db:seed:development": "npx prisma db seed -- --environment development --jurisdictionName Bloomington",
"db:seed:development": "npx prisma db seed -- --environment development --jurisdictionName 'Bay Area'",
"generate:client": "ts-node scripts/generate-axios-client.ts && prettier -w ../shared-helpers/src/types/backend-swagger.ts",
"test:e2e": "yarn db:resetup && yarn db:migration:run && jest --config ./test/jest-e2e.config.js",
"db:setup": "yarn db:resetup && yarn db:migration:run && yarn db:seed:development",
"db:setup:staging": "yarn db:resetup && yarn db:migration:run && yarn db:seed:staging --jurisdictionName Bloomington",
"db:setup:staging": "yarn db:resetup && yarn db:migration:run && yarn db:seed:staging",
"setup": "yarn install && yarn prisma generate && yarn build && yarn db:setup:staging",
"db:migration:skip": "yarn prisma migrate resolve --applied ",
"setup:dev": "yarn install && yarn prisma generate && yarn build && yarn db:setup"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.326.0",
"@aws-sdk/s3-request-presigner": "^3.327.0",
"@google-cloud/translate": "^7.2.1",
"@nestjs/axios": "~3.0.0",
"@nestjs/common": "^10.3.2",
Expand All @@ -50,6 +52,7 @@
"@turf/boolean-point-in-polygon": "6.5.0",
"@turf/points-within-polygon": "6.5.0",
"@types/archiver": "^6.0.2",
"@types/multer": "^1.4.7",
"archiver": "^6.0.1",
"casbin": "^5.27.1",
"class-transformer": "~0.5.1",
Expand Down Expand Up @@ -80,10 +83,13 @@
"@types/compression": "^1.7.5",
"@types/express": "~4.17.17",
"@types/jest": "~29.5.3",
"@types/multer": "^1.4.7",
"@types/node": "^18.7.14",
"@types/supertest": "~2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"aws-sdk-client-mock": "^2.1.1",
"aws-sdk-client-mock-jest": "^2.1.1",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
Loading

0 comments on commit 1ed0807

Please sign in to comment.