forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR Code Coverage with Coveralls (babelfish-for-postgresql#2205)
urrently we run code coverage as scheduled job on a daily basis where all the tests are run one after the another. We aim to generate coverage for pull request as well. But running all the test frameworks sequentially takes too long. So we create a new workflow which will trigger all the tests in parallel and merge the individual code coverage reports into one overall code coverage report. Specifically we are merging the .info files generated by lcov. These files contains the count of times each line / function has been hit & the relative path for this line / function in source code. So as long as we use the same source code, merging these files will be okay. The consolidated lcov.info is uploaded to Coveralls - A web-based code coverage service that provided useful insights about the how well the newly introduced code diff in a pull request is covered by the test suites. Task: BABEL-4602 Co-authored-by: Tanzeel Khan [email protected], Sharu Goel [email protected] Signed-off-by: Sharu Goel [email protected]
- Loading branch information
1 parent
d4bedd4
commit a75d3ef
Showing
9 changed files
with
278 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
run-jdbc-tests: | ||
name: JDBC Tests | ||
uses: ./.github/workflows/jdbc-tests.yml | ||
|
||
run-odbc-tests: | ||
name: ODBC Tests | ||
uses: ./.github/workflows/odbc-tests.yml | ||
|
||
run-dotnet-tests: | ||
name: Dotnet Tests | ||
uses: ./.github/workflows/dotnet-tests.yml | ||
|
||
run-python-tests: | ||
name: Python Tests | ||
uses: ./.github/workflows/python-tests.yml | ||
|
||
run-isolation-tests: | ||
name: Isolation Tests | ||
uses: ./.github/workflows/isolation-tests.yml | ||
|
||
run-babelfish-code-coverage-for-pull_request: | ||
needs: [run-jdbc-tests, run-odbc-tests, run-dotnet-tests, run-python-tests, run-isolation-tests] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
id: checkout | ||
|
||
- name: Install Code Coverage Dependencies | ||
id: install-code-coverage-dependencies | ||
if: always() | ||
run: | | ||
sudo apt-get install lcov | ||
- uses: actions/download-artifact@v3 | ||
id: download-jdbc-coverage | ||
with: | ||
name: coverage-babelfish-extensions-jdbc | ||
path: contrib/ | ||
|
||
- uses: actions/download-artifact@v3 | ||
id: download-dotnet-coverage | ||
with: | ||
name: coverage-babelfish-extensions-dotnet | ||
path: contrib/ | ||
|
||
- uses: actions/download-artifact@v3 | ||
id: download-odbc-coverage | ||
with: | ||
name: coverage-babelfish-extensions-odbc | ||
path: contrib/ | ||
|
||
- uses: actions/download-artifact@v3 | ||
id: download-python-coverage | ||
with: | ||
name: coverage-babelfish-extensions-python | ||
path: contrib/ | ||
|
||
- uses: actions/download-artifact@v3 | ||
id: download-isolation-coverage | ||
with: | ||
name: coverage-babelfish-extensions-isolation | ||
path: contrib/ | ||
|
||
- name: Generate Overall Code Coverage | ||
id: generate-total-code-coverage | ||
if: | | ||
always() && steps.download-dotnet-coverage.outcome == 'success' | ||
&& steps.download-jdbc-coverage.outcome == 'success' | ||
&& steps.download-odbc-coverage.outcome == 'success' | ||
&& steps.download-python-coverage.outcome == 'success' | ||
&& steps.download-isolation-coverage.outcome == 'success' | ||
run: | | ||
cd contrib/ | ||
lcov -a jdbc-lcov.info -a dotnet-lcov.info -a odbc-lcov.info -o lcov.info | ||
lcov --list lcov.info | ||
shell: bash | ||
|
||
- name: Upload coverage to coveralls | ||
if: always() && steps.generate-total-code-coverage.outcome == 'success' | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: $GITHUB_WORKSPACE/contrib/lcov.info |
Oops, something went wrong.