Skip to content

Commit 9e4a877

Browse files
Updated config.yml
1 parent 31475b8 commit 9e4a877

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.circleci/config.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,31 @@ jobs:
5050
command: |
5151
pip install --upgrade pip setuptools wheel
5252
pip install -r requirements.txt
53+
pip install pytest-cov
5354
- run:
54-
name: Run Unit Tests
55+
name: Run Unit Tests with Coverage
5556
command: |
56-
pytest tests/unit -v --junitxml=test-results/unit/junit.xml || true
57+
pytest tests/unit -v \
58+
--junitxml=test-results/unit/junit.xml \
59+
--cov=okta \
60+
--cov-report=xml:coverage/unit/coverage.xml \
61+
--cov-report=html:coverage/unit/html \
62+
--cov-report=term-missing || true
63+
- run:
64+
name: Display Coverage Summary
65+
command: |
66+
if [ -f coverage/unit/coverage.xml ]; then
67+
pip install coverage
68+
coverage report --data-file=.coverage 2>/dev/null || echo "Coverage data processed"
69+
fi
5770
- store_test_results:
5871
path: test-results
5972
- store_artifacts:
6073
path: test-results
74+
destination: test-results
75+
- store_artifacts:
76+
path: coverage/unit
77+
destination: coverage-unit
6178

6279
integration_tests:
6380
docker:
@@ -74,14 +91,31 @@ jobs:
7491
command: |
7592
pip install --upgrade pip setuptools wheel
7693
pip install -r requirements.txt
94+
pip install pytest-cov
7795
- run:
78-
name: Run Integration Tests
96+
name: Run Integration Tests with Coverage
7997
command: |
80-
pytest tests/integration -v --junitxml=test-results/integration/junit.xml || true
98+
pytest tests/integration -v \
99+
--junitxml=test-results/integration/junit.xml \
100+
--cov=okta \
101+
--cov-report=xml:coverage/integration/coverage.xml \
102+
--cov-report=html:coverage/integration/html \
103+
--cov-report=term-missing || true
104+
- run:
105+
name: Display Coverage Summary
106+
command: |
107+
if [ -f coverage/integration/coverage.xml ]; then
108+
pip install coverage
109+
coverage report --data-file=.coverage 2>/dev/null || echo "Coverage data processed"
110+
fi
81111
- store_test_results:
82112
path: test-results
83113
- store_artifacts:
84114
path: test-results
115+
destination: test-results
116+
- store_artifacts:
117+
path: coverage/integration
118+
destination: coverage-integration
85119

86120
snyk-scan:
87121
docker:

0 commit comments

Comments
 (0)