Skip to content

Commit

Permalink
Revert "Migrate from MongoDB => Postgres (#600)"
Browse files Browse the repository at this point in the history
This reverts commit dda1b9c.
  • Loading branch information
akevinge authored Jul 14, 2023
1 parent dda1b9c commit ba3858a
Show file tree
Hide file tree
Showing 43 changed files with 10,007 additions and 14,250 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,17 @@ jobs:
release:
name: Test build app
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-replica-set: test-rs
mongodb-version: '6.0'
mongodb-port: 27017

- name: Setup Node.js
uses: actions/setup-node@v2
with:
Expand All @@ -47,9 +37,8 @@ jobs:
npm run build
env:
# Prisma
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB # This is a dead connection URL - build does not need live DB.

DATABASE_URL: mongodb://localhost:27017/db
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB
# Next Auth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: abc
Expand Down
57 changes: 9 additions & 48 deletions .github/workflows/tests.yml → .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: E2E tests

on:
workflow_dispatch:
Expand All @@ -9,31 +9,9 @@ on:
- 'master'

jobs:
integration-tests:
name: Integration tests
release:
name: Cypress tests
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# Prisma
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -54,16 +32,19 @@ jobs:
run: |
npm ci
- name: Prisma generate and push
- name: Prisma generate
run: |
npm run prisma:generate &&
npx prisma db push
npm run prisma:generate
- name: Run Cypress e2e tests
run: |
npm run cypress:run
env:
# Prisma
DATABASE_URL: mongodb://localhost:27017/testing
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}

# Next Auth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: abc
Expand Down Expand Up @@ -96,23 +77,3 @@ jobs:
# UMAMI
NEXT_PUBLIC_UMAMI_URL: hi
NEXT_PUBLIC_UMAMI_WEBSITE_ID: bye

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18

- name: Install dependencies
run: |
npm ci
- name: Run unit tests with Jest
run: |
npm test -- --silent
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
cypress/screenshots
cypress/videos
cypress/downloads
coverage/

# next.js
/.next/
Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Request project lead by default
* @syl15
* @ZzRanger

# Request all Project Nebula Maintainers to review other pull requests
src/**/* @UTDNebula/Planner-Maintainers
src/**/* @UTDNebula/nebula-planner @UTDNebula/planner
9 changes: 0 additions & 9 deletions docker-compose.yml

This file was deleted.

17 changes: 0 additions & 17 deletions jest.config.ts

This file was deleted.

Loading

0 comments on commit ba3858a

Please sign in to comment.