From 89166fc97bc924ed4b63f22210e6b622580d061d Mon Sep 17 00:00:00 2001 From: Ansh Srivastava Date: Wed, 7 Apr 2021 20:32:23 +0530 Subject: [PATCH 1/7] Added coverage badge --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index d9d01bc22..01d56c84b 100644 --- a/README.rst +++ b/README.rst @@ -13,6 +13,9 @@ VulnerableCode .. |stability-wip| image:: https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg .. |Gitter chat| image:: https://badges.gitter.im/gitterHQ/gitter.png :target: https://gitter.im/aboutcode-org/vulnerablecode +.. image:: https://coveralls.io/repos/github/anshsrtv/vulnerablecode/badge.svg?branch=main + :target: https://coveralls.io/github/anshsrtv/vulnerablecode?branch=main + VulnerableCode is a free and open database of FOSS software package From bc8a95b41fe227f782998c4274be1c52707988aa Mon Sep 17 00:00:00 2001 From: Ansh Srivastava Date: Wed, 7 Apr 2021 20:33:46 +0530 Subject: [PATCH 2/7] fix: Coverage badge position --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 01d56c84b..4ed7197ad 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ VulnerableCode ============== -|Build Status| |License| |Python 3.8| |stability-wip| |Gitter chat| +|Build Status| |License| |Python 3.8| |stability-wip| |Gitter chat| |Coverage| .. |Build Status| image:: https://github.com/nexB/vulnerablecode/workflows/CI/badge.svg @@ -13,7 +13,7 @@ VulnerableCode .. |stability-wip| image:: https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg .. |Gitter chat| image:: https://badges.gitter.im/gitterHQ/gitter.png :target: https://gitter.im/aboutcode-org/vulnerablecode -.. image:: https://coveralls.io/repos/github/anshsrtv/vulnerablecode/badge.svg?branch=main +.. |Coverage| image:: https://coveralls.io/repos/github/anshsrtv/vulnerablecode/badge.svg?branch=main :target: https://coveralls.io/github/anshsrtv/vulnerablecode?branch=main From 3ef0b5e8e21cd3b2ace1117e3da261e5b378a896 Mon Sep 17 00:00:00 2001 From: Ansh Srivastava Date: Wed, 7 Apr 2021 20:38:23 +0530 Subject: [PATCH 3/7] Create .coveralls.yml --- .coveralls.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 000000000..42a7d8e28 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +service_name: travis-pro +repo_token: O8pGVG8t4c9FMEkiWAwP3WyuJnXmGyNTr From 58340f4b4536aa23cf757d6ce2c4821728dfa40a Mon Sep 17 00:00:00 2001 From: anshsrtv Date: Wed, 7 Apr 2021 21:16:30 +0530 Subject: [PATCH 4/7] Added python-coveralls --- .travis.yml | 3 +++ requirements.txt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e47738ee8..69b70b46c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,3 +28,6 @@ notifications: on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: never # options: [always|never|change] default: always + +after_success: + - coveralls \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 37b289ae2..0322197b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,6 +37,7 @@ pygit2==1.5.0 Pygments==2.7.4 pyparsing==2.4.5 pytest==6.2.3 +python-coveralls==2.9.2 pytest-django==4.1.0 django-widget-tweaks==1.4.8 pytest-dependency==0.4.0 @@ -56,4 +57,4 @@ zipp==0.6.0 requests==2.23.0 toml==0.10.2 PyYAML==5.4 -freezegun==1.1.0 \ No newline at end of file +freezegun==1.1.0 From 1a1f6289e48c596d4bf28c5623538c89db75d633 Mon Sep 17 00:00:00 2001 From: anshsrtv Date: Tue, 20 Apr 2021 19:55:32 +0530 Subject: [PATCH 5/7] fix: Codecov report upload to workflow --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d05b5f0ba..04db34a6d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,3 +46,8 @@ jobs: POSTGRES_PORT: 5432 DJANGO_DEV: 1 GH_TOKEN: 1 + + - name: "Upload coverage to Codecov" + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: true \ No newline at end of file From 1cd8d610aaa6d123ccfb4249456819024dd31607 Mon Sep 17 00:00:00 2001 From: anshsrtv Date: Tue, 20 Apr 2021 20:11:55 +0530 Subject: [PATCH 6/7] Added .coveragerc --- .coveragerc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..f3ee8ebcf --- /dev/null +++ b/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True +source = vulnerablecode + +[report] +exclude_lines = + if self.debug: + pragma: no cover + raise NotImplementedError + if __name__ == .__main__.: +ignore_errors = True +omit = + tests/* \ No newline at end of file From b79117f3ea50470547aa2a173265aa4e89403b50 Mon Sep 17 00:00:00 2001 From: anshsrtv Date: Tue, 20 Apr 2021 20:51:24 +0530 Subject: [PATCH 7/7] codecov in .travis --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69b70b46c..bd6f45263 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,8 @@ notifications: on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: never # options: [always|never|change] default: always - + +language: + python after_success: - - coveralls \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file