Skip to content

Commit 3bcc73a

Browse files
authored
Merge pull request #605 from UTDNebula/develop
Sync with develop
2 parents 66a1014 + e1808ec commit 3bcc73a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+11063
-6820
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,27 @@ jobs:
1212
release:
1313
name: Test build app
1414
runs-on: ubuntu-latest
15+
16+
services:
17+
postgres:
18+
image: postgres:latest
19+
env:
20+
POSTGRES_DB: postgres
21+
POSTGRES_PASSWORD: postgres
22+
POSTGRES_USER: postgres
23+
ports:
24+
- 5432:5432
25+
# Set health checks to wait until postgres has started
26+
options: >-
27+
--health-cmd pg_isready
28+
--health-interval 10s
29+
--health-timeout 5s
30+
--health-retries 5
31+
1532
steps:
1633
- name: Checkout
1734
uses: actions/checkout@v3
1835

19-
- name: Start MongoDB
20-
uses: supercharge/mongodb-github-action@1.8.0
21-
with:
22-
mongodb-replica-set: test-rs
23-
mongodb-version: '6.0'
24-
mongodb-port: 27017
25-
2636
- name: Setup Node.js
2737
uses: actions/setup-node@v2
2838
with:
@@ -37,8 +47,9 @@ jobs:
3747
npm run build
3848
env:
3949
# Prisma
40-
DATABASE_URL: mongodb://localhost:27017/db
41-
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB
50+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
51+
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB # This is a dead connection URL - build does not need live DB.
52+
4253
# Next Auth
4354
NEXTAUTH_URL: http://localhost:3000
4455
NEXTAUTH_SECRET: abc
Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E tests
1+
name: Tests
22

33
on:
44
workflow_dispatch:
@@ -9,9 +9,31 @@ on:
99
- 'master'
1010

1111
jobs:
12-
release:
13-
name: Cypress tests
12+
integration-tests:
13+
name: Integration tests
1414
runs-on: ubuntu-latest
15+
16+
services:
17+
postgres:
18+
image: postgres:latest
19+
env:
20+
POSTGRES_DB: postgres
21+
POSTGRES_PASSWORD: postgres
22+
POSTGRES_USER: postgres
23+
ports:
24+
- 5432:5432
25+
# Set health checks to wait until postgres has started
26+
options: >-
27+
--health-cmd pg_isready
28+
--health-interval 10s
29+
--health-timeout 5s
30+
--health-retries 5
31+
32+
env:
33+
# Prisma
34+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
35+
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}
36+
1537
steps:
1638
- name: Checkout
1739
uses: actions/checkout@v3
@@ -32,19 +54,16 @@ jobs:
3254
run: |
3355
npm ci
3456
35-
- name: Prisma generate
57+
- name: Prisma generate and push
3658
run: |
37-
npm run prisma:generate
59+
npm run prisma:generate &&
60+
npx prisma db push
3861
3962
- name: Run Cypress e2e tests
4063
run: |
4164
npm run cypress:run
4265
4366
env:
44-
# Prisma
45-
DATABASE_URL: mongodb://localhost:27017/testing
46-
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}
47-
4867
# Next Auth
4968
NEXTAUTH_URL: http://localhost:3000
5069
NEXTAUTH_SECRET: abc
@@ -77,3 +96,23 @@ jobs:
7796
# UMAMI
7897
NEXT_PUBLIC_UMAMI_URL: hi
7998
NEXT_PUBLIC_UMAMI_WEBSITE_ID: bye
99+
100+
unit-tests:
101+
name: Unit tests
102+
runs-on: ubuntu-latest
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@v3
106+
107+
- name: Setup Node.js
108+
uses: actions/setup-node@v2
109+
with:
110+
node-version: 18
111+
112+
- name: Install dependencies
113+
run: |
114+
npm ci
115+
116+
- name: Run unit tests with Jest
117+
run: |
118+
npm test -- --silent

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
cypress/screenshots
1010
cypress/videos
1111
cypress/downloads
12+
coverage/
1213

1314
# next.js
1415
/.next/

CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Request project lead by default
2-
* @ZzRanger
2+
* @syl15
33

44
# Request all Project Nebula Maintainers to review other pull requests
5-
src/**/* @UTDNebula/nebula-planner @UTDNebula/planner
5+
src/**/* @UTDNebula/Planner-Maintainers

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3.1'
2+
3+
services:
4+
db:
5+
image: postgres
6+
ports:
7+
- '5432:5432'
8+
environment:
9+
POSTGRES_PASSWORD: postgres

jest.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { JestConfigWithTsJest } from 'ts-jest';
2+
3+
const config: JestConfigWithTsJest = {
4+
clearMocks: true,
5+
extensionsToTreatAsEsm: ['.ts'],
6+
coverageProvider: 'v8',
7+
transform: {
8+
'^.+\\.[tj]sx?$': [
9+
'ts-jest',
10+
{
11+
useESM: true,
12+
},
13+
],
14+
},
15+
};
16+
17+
export default config;

0 commit comments

Comments
 (0)