Skip to content

Commit

Permalink
Merge pull request #20 from awhipp/feature/code_coverage
Browse files Browse the repository at this point in the history
Adding code coverage and enhanced build testing
  • Loading branch information
awhipp authored Apr 20, 2024
2 parents d94f6f9 + 7f0f240 commit 30bed43
Show file tree
Hide file tree
Showing 9 changed files with 717 additions and 5 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Build stack
run: docker-compose up -d

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -29,3 +32,30 @@ jobs:

- name: Install dependencies
run: python -m poetry install

- name: Run tests
env:
OANDA_ACCOUNT_ID: ${{secrets.OANDA_ACCOUNT_ID}}
OANDA_TOKEN: ${{secrets.OANDA_TOKEN}}
APP_RANDOM_WALK: "True"
TIMESCALE_HOST: 127.0.0.1
TIMESCALE_PORT: 5432
TIMESCALE_DB: project_foresight
TIMESCALE_USER: postgres
TIMESCALE_PASSWORD: postgres
AWS_ENDPOINT_URL: http://localhost:4566
run: python -m poetry run python -m pytest --disable-warnings -xv --cov=. --cov-report=xml

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
title: Code Coverage
badge-title: Code Coverage
hide-badge: false
hide-report: false
create-new-comment: false
hide-comment: false
report-only-changed-files: false
remove-link-from-badge: false
unique-id-for-comment: python3.9
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.venv
.env
**.pyc
.coverage
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

[![Code Linting and Pre-commit Checks](https://github.com/awhipp/project-foresight/actions/workflows/precommit_checks.yml/badge.svg)](https://github.com/awhipp/project-foresight/actions/workflows/precommit_checks.yml)

[![Versioning Workflow](https://github.com/awhipp/project-foresight/actions/workflows/bump_version.yml/badge.svg)](https://github.com/awhipp/project-foresight/actions/workflows/bump_version.yml)

[![CodeQL](https://github.com/awhipp/project-foresight/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/awhipp/project-foresight/actions/workflows/github-code-scanning/codeql)

## Description

Overall, this architecture facilitates the continuous flow of data from ticket sources to the user interface, with various microservices handling data ingestion, aggregation, calculations, storage, and presentation. It provides a scalable and maintainable solution for processing and visualizing ticket-related indicators.
Expand Down Expand Up @@ -61,7 +65,8 @@ The following sets up
- pre-commit

```bash
docker-compose up -d
sudo service docker start
sudo docker-compose up -d
```

### Deploy Services
Expand All @@ -82,6 +87,12 @@ python indicator_service/moving_average_indicator.py
python interface_service/app.py
```

### Run Tests

```bash
python -m pytest --disable-warnings -xv
```

## End State Architecture

This is the end-goal and a work in progres (subject to change).
Expand Down
Loading

1 comment on commit 30bed43

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Coverage

Code Coverage
FileStmtsMissCoverMissing
foresight
   __init__.py00100% 
foresight/indicator_services
   __init__.py00100% 
   indicator.py65650%3–4, 7–8, 10–13, 16, 21, 24, 27–30, 32, 39–44, 50, 52–56, 58, 60, 63, 69, 71, 73–75, 79, 83–84, 88–90, 94, 96, 98, 100, 102, 114, 116–117, 123, 125, 128, 131, 134, 136, 138, 140–142, 144–145, 147, 149, 151
   moving_average_indicator.py19190%2, 4–5, 8, 13, 16, 24–25, 32, 34, 37–38, 40–41, 44, 46, 49–50, 55
foresight/interface_service
   __init__.py00100% 
   app.py32320%3–5, 7–10, 12, 15, 18, 21, 26, 29, 31, 39–40, 42, 45–46, 48, 51–52, 54–57, 59–60, 62, 65–67
foresight/models
   __init__.py00100% 
   forex_data.py70100% 
   #.py40100% 
   stream.py180100% 
foresight/stream_service
   __init__.py00100% 
   app.py741382%83, 111, 132, 134–135, 159, 162–168
foresight/utils
   __init__.py00100% 
   aws.py12120%3, 5, 8, 11, 13–14, 21, 27, 30, 32–33, 40
   database.py551376%57–58, 73–76, 79, 90–91, 93, 97–99
   logger.py90100% 
foresight/window_service
   __init__.py00100% 
   app.py42420%3–4, 6–7, 9–10, 13, 18, 21, 32, 34–35, 49, 52–53, 66–68, 71, 73, 83, 85–87, 92–93, 98–107, 111–113, 117–118, 124
tests
   __init__.py00100% 
   conftest.py90100% 
tests/stream_service
   __init__.py00100% 
   test_app.py530100% 
TOTAL39919650% 

Please # to comment.