Skip to content

Commit

Permalink
Trying to address the codecove issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JMkrish committed Apr 25, 2024
1 parent 57d9a52 commit 908c397
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
37 changes: 25 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ workflows:
context: org-sightmachine
- run-unit-tests:
context: org-sightmachine
- generate-code-coverage:
context: org-sightmachine
requires:
- run-unit-tests
- cve-repo-scan:
context: org-sightmachine
nightly-cve:
Expand Down Expand Up @@ -102,7 +106,6 @@ commands:
jobs:
## ------------------ Run Unit Tests ------------------

run-unit-tests:
# Use VM over docker container
docker:
Expand All @@ -123,27 +126,37 @@ jobs:
name: Run Unit Tests
command: |
set -x
pip install -r requirements-codecoverage.txt
pip install -r requirements-pytest.txt
pip install .
mkdir test-results
# coverage run -m pytest -vvv --nbmake --nbmake-timeout=300 -n=auto --junitxml=test-results/junit.xml tests
coverage run -m pytest -vvv -n=auto --junitxml=test-results/junit.xml tests
pytest -vvv --nbmake --nbmake-timeout=300 -n=auto --junitxml=test-results/junit.xml tests
- store_artifacts:
name: Save Unit Test Results
path: htmlcov

- send_slack_msg_on_fail

## ------------------ Generate Code Coverage Report ------------------
generate-code-coverage:
docker:
- image: cimg/python:3.11.0
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Compile Coverage Report
command: |
set -x
pip install -r requirements-codecoverage.txt
pip install .
coverage html -d htmlcov
codecov --required
# Store the test results on each node so we can see failures
- store_test_results:
path: test-results

- store_artifacts:
name: Save Unit Test Results
path: htmlcov

- send_slack_msg_on_fail
name: Save Code Coverage Report
path: htmlcov

## ------------------ Check Black python code formate ------------------
black-python-code-formatter:
Expand Down
4 changes: 1 addition & 3 deletions requirements-codecoverage.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Use public repo for coverall upload

codecov==2.1.13
coverage==7.3.2
nbmake==1.4.6
pytest-xdist==3.5.0
coverage==7.3.2
2 changes: 2 additions & 0 deletions requirements-pytest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nbmake==1.4.6
pytest-xdist==3.5.0

0 comments on commit 908c397

Please sign in to comment.