From 359b82960b368e3780dfda461b8bc984610e8cca Mon Sep 17 00:00:00 2001 From: Elssky <43638383+Elssky@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:53:50 +0800 Subject: [PATCH] feat(devinfra): Add test coverage to CI to measure the covering code of unitest (PySpark) (#601) --- .github/workflows/pyspark.yml | 10 ++++++++-- pyspark/Makefile | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pyspark.yml b/.github/workflows/pyspark.yml index 8630a1ce9..c5f075d71 100644 --- a/.github/workflows/pyspark.yml +++ b/.github/workflows/pyspark.yml @@ -74,6 +74,12 @@ jobs: working-directory: pyspark run: make install_test - - name: Run PyTest + - name: Run PyTest and Generate Coverage Report working-directory: pyspark - run: make test + run: make coverage_report + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/pyspark/Makefile b/pyspark/Makefile index ceac363df..7e709be6b 100644 --- a/pyspark/Makefile +++ b/pyspark/Makefile @@ -32,7 +32,7 @@ test: coverage_report: export JAVA_HOME=${JAVA_HOME_11_X64} export SPARK_TESTING=1 - poetry run pytest --cov --cov-report=html:coverage_html graphar_pyspark tests/ + poetry run pytest --cov --cov-report=html:coverage_html --cov-report=xml graphar_pyspark tests/ .PHONY: install_lint install_lint: