Skip to content

Commit

Permalink
Merge branch 'release-0.2.0' into feat/daniel-add-cr-transactions-1668
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaselhan authored Jan 14, 2025
2 parents b36508b + 4a4b44e commit f1fa504
Show file tree
Hide file tree
Showing 46 changed files with 686 additions and 341 deletions.
125 changes: 0 additions & 125 deletions .github/workflows/cypress-auto-test.yaml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Cypress Daily

on:
schedule:
- cron: '0 16 * * *' # Runs daily at 16:00 UTC (8 AM PST)
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
cypress:
runs-on: ubuntu-latest
services:
db:
image: postgres:14.2
env:
POSTGRES_DB: lcfs
POSTGRES_USER: lcfs
POSTGRES_PASSWORD: development_only
ports:
- 5432:5432
redis:
image: bitnami/redis:6.2.5
env:
ALLOW_EMPTY_PASSWORD: "yes"
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:3-management
env:
RABBITMQ_DEFAULT_USER: lcfs
RABBITMQ_DEFAULT_PASS: development_only
RABBITMQ_DEFAULT_VHOST: lcfs
ports:
- "15672:15672"
steps:
- uses: actions/checkout@v2

- name: Build and Run Backend Service
run: |
docker build -t backend-service -f ./backend/Dockerfile ./backend
docker run -d --name backend \
--network=host \
-e LCFS_DB_HOST=localhost \
-e LCFS_REDIS_HOST=localhost \
backend-service
- name: Wait for DB to be Ready
run: sleep 20

- name: Run Alembic Migrations
run: docker exec backend poetry run alembic upgrade head

- name: Data Seeding
run: docker exec backend poetry run python /app/lcfs/db/seeders/seed_database.py

- name: Build and Run Frontend Service
run: |
docker build -t frontend-service -f ./frontend/Dockerfile.dev ./frontend
docker run -d --name frontend \
--network=host \
frontend-service
- name: Cypress run
uses: cypress-io/github-action@v2
with:
browser: chrome
wait-on: 'http://localhost:3000'
wait-on-timeout: 60
record: false
config-file: cypress.config.js
working-directory: frontend
env:
IDIR_TEST_USER: ${{ secrets.CYPRESS_IDIR_TEST_USER }}
IDIR_TEST_PASS: ${{ secrets.CYPRESS_IDIR_TEST_PASS }}
BCEID_TEST_USER: ${{ secrets.CYPRESS_BCEID_TEST_USER }}
BCEID_TEST_PASS: ${{ secrets.CYPRESS_BCEID_TEST_PASS }}

- name: Cleanup
if: always()
run: |
docker stop backend frontend
docker rm backend frontend
123 changes: 0 additions & 123 deletions .github/workflows/tests.yml

This file was deleted.

5 changes: 5 additions & 0 deletions backend/lcfs/db/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@
"mv_director_review_transaction_count",
"mv_org_compliance_report_count",
"transaction_status_view",
"mv_compliance_report_count",
]


def include_object(object, name, type_, reflected, compare_to):
if type_ == "table" and name in exclude_tables:
# Exclude these tables from autogenerate
return False
else:
return True


async def run_migrations_offline() -> None:
"""Run migrations in 'offline' mode.
Expand All @@ -65,6 +68,7 @@ async def run_migrations_offline() -> None:
with context.begin_transaction():
context.run_migrations()


def do_run_migrations(connection: Connection) -> None:
"""
Run actual sync migrations.
Expand All @@ -80,6 +84,7 @@ def do_run_migrations(connection: Connection) -> None:
with context.begin_transaction():
context.run_migrations()


async def run_migrations_online() -> None:
"""
Run migrations in 'online' mode.
Expand Down
Loading

0 comments on commit f1fa504

Please sign in to comment.