-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'djeck1432:main' into liquidation-crud-test
- Loading branch information
Showing
8 changed files
with
356 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Margin Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'margin_app/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'margin_app/**' | ||
jobs: | ||
shared: | ||
uses: ./.github/workflows/shared_workflow.yml | ||
with: | ||
python-version: "3.12" | ||
|
||
margin-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create .env file | ||
run: cp margin_app/.env.dev margin_app/.env | ||
|
||
- name: Build and Start Containers | ||
run: | | ||
docker compose -f margin_app/docker-compose.yml --env-file margin_app/.env up -d --build | ||
echo "Waiting for containers to be ready..." | ||
sleep 30 | ||
- name: Run Integration Tests with Coverage | ||
run: | | ||
docker compose -f margin_app/docker-compose.yml exec backend python -m pytest app/tests -v | ||
- name: Clean Up | ||
if: always() | ||
run: | | ||
docker compose -f margin_app/docker-compose.yml logs > docker-logs.txt || true | ||
docker compose -f margin_app/docker-compose.yml down -v | ||
- name: Upload Docker Logs on Failure | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docker-logs | ||
path: docker-logs.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
APP_ENV=development | ||
SECRET_KEY=SECRET_KEY | ||
|
||
# Database creds | ||
POSTGRES_USER=user | ||
POSTGRES_PASSWORD=password | ||
POSTGRES_DB=db_name | ||
DB_HOST=db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Test to check if worklow works properly""" | ||
|
||
import pytest | ||
|
||
@pytest.fixture | ||
def sample_data(): | ||
"""Test fixture""" | ||
return {"key": "value"} | ||
|
||
def test_sample(sample_data): | ||
"""Test function""" | ||
assert sample_data["key"] == "value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters