Skip to content

Commit

Permalink
[chore] Enable codecov for fairscale (#551)
Browse files Browse the repository at this point in the history
* codedcov testing

* codecov testnig

* more changes for uploading cov

* fix invalid config

* fix invalid config

* modify name

* fix config

Co-authored-by: Anjali Sridhar <anj@devfair0443.h2.fair>
  • Loading branch information
anj-s and Anjali Sridhar authored Mar 29, 2021
1 parent c9db477 commit 9a95065
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# Pro tip: download circle ci cli to validate the config locally during development.

version: 2.1

orbs:
codecov: codecov/codecov@1.0.2
# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
Expand Down Expand Up @@ -159,17 +160,10 @@ check_test_list: &check_test_list
bash ./tests/ci_test_list_check.sh
# TODO (Min): figure out how to do coverage nightly or on-demand. Doing it
# on every commit seems like an overkill since we can easily figure out which
# code is not covered without looking at coverage results from each commit.
# Also, it is a long pole for testing time, which slows down development a lot.
run_coverage: &run_coverage
- run:
name: Run Unit Tests With Coverage
command: |
pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
#Uploading test coverage for Python code
bash <(curl -s https://codecov.io/bash) -f coverage.xml -cF Python
upload_coverage: &upload_coverage
- codecov/upload:
file: 'coverage.xml'
token: $CODECOV_TOKEN

run_mpi_unittests: &run_mpi_unittests
- run:
Expand Down Expand Up @@ -233,7 +227,7 @@ run_unittests: &run_unittests
name: Run all unit tests.
# We run all and not stopping on failure on CPU since docker time is cheaper.
command: |
pytest --junitxml=test-results/junit.xml --verbose --timeout 60
pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
commands:

Expand All @@ -249,7 +243,7 @@ commands:
name: Run Unit Tests
command: |
if [ ! -f <<parameters.test_list_file>> ]; then exit 1; fi
pytest --junitxml=test-results/junit.xml --verbose --timeout 60 `cat <<parameters.test_list_file>>`
pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./ `cat <<parameters.test_list_file>>`
# -------------------------------------------------------------------------------------
# Jobs to run
Expand Down Expand Up @@ -399,6 +393,8 @@ jobs:

- store_test_results:
path: test-results

- <<: *upload_coverage

gpu_tests_171:
parameters:
Expand Down Expand Up @@ -439,6 +435,8 @@ jobs:

- store_test_results:
path: test-results

- <<: *upload_coverage

gpu_tests_181:
parameters:
Expand Down Expand Up @@ -479,6 +477,8 @@ jobs:

- store_test_results:
path: test-results

- <<: *upload_coverage

benchmarks_1:
<<: *gpu
Expand Down
17 changes: 17 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
codecov:
require_ci_to_pass: yes
coverage:
status:
project:
default:
target: 94%
threshold: 0.1%
status:
project: yes
patch: yes
changes: no
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no

0 comments on commit 9a95065

Please sign in to comment.