From 03fbda264cb36ed46cae37c8d0aaef928e3eb6a6 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:29 -0700 Subject: [PATCH] Add Codecov for test coverage reporting (#401) (#402) * Added Codecov for unit test coverage reporting Signed-off-by: saimedhi * Added Codecov for unit test coverage reporting Signed-off-by: saimedhi --------- Signed-off-by: saimedhi (cherry picked from commit 09897add48ca84f7ed59d9de91a8d43f747e8518) Co-authored-by: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> --- .github/workflows/build-and-test.yml | 7 ++++++- codecov.yml | 10 ++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 92b0ec6c..2ee8120b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -45,6 +45,12 @@ jobs: su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && cd ./plugins/dashboards-flow-framework && whoami && yarn osd bootstrap && yarn build && yarn run test:jest --coverage" + - name: Uploads coverage + uses: codecov/codecov-action@v3 + with: + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # TODO: once github actions supports windows and macos docker containers, we can # merge these in to the above step's matrix, including adding windows support @@ -96,4 +102,3 @@ jobs: run: | cd OpenSearch-Dashboards/plugins/dashboards-flow-framework yarn run test:jest --coverage - diff --git a/codecov.yml b/codecov.yml index 44df4e8e..604c63e6 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,17 +1,15 @@ -# disable tracking status entirely until UT is added. -# tracking issue: https://github.com/opensearch-project/dashboards-flow-framework/issues/95 coverage: # displays different colors depending on below, between, or above the range range: 50..90 status: project: - enabled: no + enabled: yes default: target: auto # allows 5% coverage reduction without failing threshold: 5% - patch: no - changes: no + patch: yes + changes: yes # disable comments in PRs -comment: no \ No newline at end of file +comment: yes