mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
build(coverage): fix carry-forward coverage (#12306)
This commit is contained in:
parent
0d328f77ab
commit
d3ac112d28
65
.github/.codecov.yml
vendored
Normal file
65
.github/.codecov.yml
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
comment:
|
||||
layout: "header, files, footer" # remove "new" from "header" and "footer"
|
||||
hide_project_coverage: true # set to false
|
||||
require_changes: false # if true: only post the comment if coverage changes
|
||||
|
||||
codecov:
|
||||
#due to ci-optimization, reports for modules that have not changed may be quite old
|
||||
max_report_age: off
|
||||
|
||||
flag_management:
|
||||
default_rules: # the rules that will be followed for any flag added, generally
|
||||
carryforward: true
|
||||
statuses:
|
||||
- type: project
|
||||
target: auto
|
||||
threshold: 0% #Not enforcing project coverage yet.
|
||||
- type: patch
|
||||
target: 90%
|
||||
individual_flags: # exceptions to the default rules above, stated flag by flag
|
||||
- name: frontend
|
||||
paths:
|
||||
- "datahub-frontend/**"
|
||||
- "datahub-web-react/**"
|
||||
- name: backend
|
||||
paths:
|
||||
- "metadata-models/**"
|
||||
- "datahub-upgrade/**"
|
||||
- "entity-registry/**"
|
||||
- "li-utils/**"
|
||||
- "metadata-auth/**"
|
||||
- "metadata-dao-impl/**"
|
||||
- "metadata-events/**"
|
||||
- "metadata-jobs/**"
|
||||
- "metadata-service/**"
|
||||
- "metadata-utils/**"
|
||||
- "metadata-operation-context/**"
|
||||
- "datahub-graphql-core/**"
|
||||
- name: metadata-io
|
||||
paths:
|
||||
- "metadata-io/**"
|
||||
- name: ingestion
|
||||
paths:
|
||||
- "metadata-ingestion/**"
|
||||
- name: ingestion-airflow
|
||||
paths:
|
||||
- "metadata-ingestion-modules/airflow-plugin/**"
|
||||
- name: ingestion-dagster
|
||||
paths:
|
||||
- "metadata-ingestion-modules/dagster-plugin/**"
|
||||
- name: ingestion-gx-plugin
|
||||
paths:
|
||||
- "metadata-ingestion-modules/gx-plugin/**"
|
||||
- name: ingestion-prefect
|
||||
paths:
|
||||
- "metadata-ingestion-modules/prefect-plugin/**"
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: 0% # no threshold enforcement yet
|
||||
only_pulls: true
|
||||
patch:
|
||||
default:
|
||||
target: 90% # for new code added in the patch
|
||||
only_pulls: true
|
8
.github/workflows/airflow-plugin.yml
vendored
8
.github/workflows/airflow-plugin.yml
vendored
@ -77,15 +77,15 @@ jobs:
|
||||
**/build/test-results/test/**
|
||||
**/junit.*.xml
|
||||
!**/binary/**
|
||||
- name: Upload coverage to Codecov
|
||||
- name: Upload coverage to Codecov with ingestion flag
|
||||
if: always()
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
directory: ./build/coverage-reports/metadata-ingestion-modules/airflow-plugin/
|
||||
fail_ci_if_error: false
|
||||
flags: airflow-${{ matrix.python-version }}-${{ matrix.extra_pip_extras }}
|
||||
name: pytest-airflow
|
||||
flags: ingestion-airflow
|
||||
name: pytest-airflow-${{ matrix.python-version }}-${{ matrix.extra_pip_requirements }}
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
if: ${{ !cancelled() }}
|
||||
|
26
.github/workflows/build-and-test.yml
vendored
26
.github/workflows/build-and-test.yml
vendored
@ -113,6 +113,10 @@ jobs:
|
||||
if: ${{ matrix.command == 'except_metadata_ingestion' && needs.setup.outputs.backend_change == 'true' }}
|
||||
run: |
|
||||
./gradlew -PjavaClassVersionDefault=8 :metadata-integration:java:spark-lineage:compileJava
|
||||
- name: Gather coverage files
|
||||
run: |
|
||||
echo "BACKEND_FILES=`find ./build/coverage-reports/ -type f | grep -E '(metadata-models|entity-registry|datahuyb-graphql-core|metadata-io|metadata-jobs|metadata-utils|metadata-service|medata-dao-impl|metadata-operation|li-utils|metadata-integration|metadata-events|metadata-auth|ingestion-scheduler|notifications|datahub-upgrade)' | xargs | sed 's/ /,/g'`" >> $GITHUB_ENV
|
||||
echo "FRONTEND_FILES=`find ./build/coverage-reports/ -type f | grep -E '(datahub-frontend|datahub-web-react).*\.(xml|json)$' | xargs | sed 's/ /,/g'`" >> $GITHUB_ENV
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
@ -124,14 +128,28 @@ jobs:
|
||||
!**/binary/**
|
||||
- name: Ensure codegen is updated
|
||||
uses: ./.github/actions/ensure-codegen-updated
|
||||
- name: Upload coverage to Codecov
|
||||
if: always()
|
||||
- name: Upload backend coverage to Codecov
|
||||
if: ${{ matrix.command == 'except_metadata_ingestion' && needs.setup.outputs.backend_change == 'true' }}
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
files: ${{ env.BACKEND_FILES }}
|
||||
disable_search: true
|
||||
#handle_no_reports_found: true
|
||||
fail_ci_if_error: false
|
||||
flags: ${{ matrix.timezone }}
|
||||
flags: backend
|
||||
name: ${{ matrix.command }}
|
||||
verbose: true
|
||||
- name: Upload frontend coverage to Codecov
|
||||
if: ${{ matrix.command == 'frontend' && needs.setup.outputs.frontend_change == 'true' }}
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ${{ env.FRONTEND_FILES }}
|
||||
disable_search: true
|
||||
#handle_no_reports_found: true
|
||||
fail_ci_if_error: false
|
||||
flags: frontend
|
||||
name: ${{ matrix.command }}
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
|
6
.github/workflows/dagster-plugin.yml
vendored
6
.github/workflows/dagster-plugin.yml
vendored
@ -64,14 +64,14 @@ jobs:
|
||||
**/build/reports/tests/test/**
|
||||
**/build/test-results/test/**
|
||||
**/junit.*.xml
|
||||
- name: Upload coverage to Codecov
|
||||
- name: Upload coverage to Codecov with ingestion flag
|
||||
if: always()
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
directory: ./build/coverage-reports/metadata-ingestion-modules/dagster-plugin/
|
||||
fail_ci_if_error: false
|
||||
flags: dagster-${{ matrix.python-version }}-${{ matrix.extraPythonRequirement }}
|
||||
flags: ingestion-dagster-plugin
|
||||
name: pytest-dagster
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
|
6
.github/workflows/gx-plugin.yml
vendored
6
.github/workflows/gx-plugin.yml
vendored
@ -68,14 +68,14 @@ jobs:
|
||||
**/build/reports/tests/test/**
|
||||
**/build/test-results/test/**
|
||||
**/junit.*.xml
|
||||
- name: Upload coverage to Codecov
|
||||
- name: Upload coverage to Codecov with ingestion flag
|
||||
if: always()
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
directory: ./build/coverage-reports/metadata-ingestion-modules/gx-plugin/
|
||||
fail_ci_if_error: false
|
||||
flags: gx-${{ matrix.python-version }}-${{ matrix.extraPythonRequirement }}
|
||||
flags: ingestion-gx-plugin
|
||||
name: pytest-gx
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
|
10
.github/workflows/metadata-ingestion.yml
vendored
10
.github/workflows/metadata-ingestion.yml
vendored
@ -88,15 +88,15 @@ jobs:
|
||||
**/build/test-results/test/**
|
||||
**/junit.*.xml
|
||||
!**/binary/**
|
||||
- name: Upload coverage to Codecov
|
||||
if: ${{ always() }}
|
||||
- name: Upload coverage to Codecov with ingestion flag
|
||||
if: ${{ always() && matrix.python-version == '3.11' }}
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
directory: ./build/coverage-reports/metadata-ingestion/
|
||||
fail_ci_if_error: false
|
||||
flags: ingestion-${{ matrix.python-version }}-${{ matrix.command }}
|
||||
name: pytest-ingestion
|
||||
flags: ingestion
|
||||
name: pytest-${{ matrix.python-version }}-${{ matrix.command }}
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
if: ${{ !cancelled() }}
|
||||
|
3
.github/workflows/metadata-io.yml
vendored
3
.github/workflows/metadata-io.yml
vendored
@ -86,8 +86,9 @@ jobs:
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
directory: ./build/coverage-reports/metadata-io/
|
||||
fail_ci_if_error: false
|
||||
flags: metadata-io
|
||||
name: metadata-io-test
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
|
8
.github/workflows/prefect-plugin.yml
vendored
8
.github/workflows/prefect-plugin.yml
vendored
@ -60,15 +60,15 @@ jobs:
|
||||
**/build/test-results/test/**
|
||||
**/junit.*.xml
|
||||
!**/binary/**
|
||||
- name: Upload coverage to Codecov
|
||||
- name: Upload coverage to Codecov with ingestion flag
|
||||
if: always()
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
directory: ./build/coverage-reports/
|
||||
directory: ./build/coverage-reports/metadata-ingestion-modules/prefect-plugin/
|
||||
fail_ci_if_error: false
|
||||
flags: prefect-${{ matrix.python-version }}
|
||||
name: pytest-prefect
|
||||
flags: ingestion-prefect-plugin
|
||||
name: pytest-prefect-${{ matrix.python-version }}
|
||||
verbose: true
|
||||
- name: Upload test results to Codecov
|
||||
if: ${{ !cancelled() }}
|
||||
|
@ -22,7 +22,7 @@ afterEvaluate {
|
||||
Tools that aggregate and analyse coverage tools search for the coverage result files. Keeping them under one
|
||||
folder will minimize the time spent searching through the full source tree.
|
||||
*/
|
||||
outputLocation = rootProject.layout.buildDirectory.file("coverage-reports/jacoco-${project.name}.xml")
|
||||
outputLocation = rootProject.layout.buildDirectory.file("coverage-reports/${rootProject.relativePath(project.projectDir)}/jacoco-${project.name}.xml")
|
||||
}
|
||||
csv.required = false
|
||||
html.required = false
|
||||
|
@ -7,7 +7,7 @@ ext.get_coverage_args = { test_name = "" ->
|
||||
Tools that aggregate and analyse coverage tools search for the coverage result files. Keeping them under one folder
|
||||
will minimize the time spent searching through the full source tree.
|
||||
*/
|
||||
def base_path = "${rootProject.buildDir}/coverage-reports"
|
||||
def base_path = "${rootProject.buildDir}/coverage-reports/${rootProject.relativePath(project.projectDir)}/"
|
||||
|
||||
/*
|
||||
--cov=src was added via setup.cfg in many of the python projects but for some reason, was not getting picked up
|
||||
|
Loading…
x
Reference in New Issue
Block a user