Skip to content

Commit

Permalink
Added: 1. Python code coverage collection
Browse files Browse the repository at this point in the history
  • Loading branch information
patotskiy committed Oct 23, 2024
1 parent ad6eb84 commit d2fb6ba
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metadata-ingestion-modules/airflow-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ task testQuick(type: Exec, dependsOn: installTest) {
"pytest --cov-config=setup.cfg --cov-report xml:coverage_quick.xml -vv --continue-on-collection-errors --junit-xml=junit.quick.xml"
}

task generateCoverageReport(type: Exec, dependsOn: testQuick) {
outputs.dir("${venv_name}")
commandLine 'bash', '-c',
"source ${venv_name}/bin/activate && set -x && " +
"coverage html"
}

task cleanPythonCache(type: Exec) {
commandLine 'bash', '-c',
Expand Down
7 changes: 7 additions & 0 deletions metadata-ingestion-modules/dagster-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ task testQuick(type: Exec, dependsOn: installDevTest) {
"pytest -vv --continue-on-collection-errors --junit-xml=junit.quick.xml"
}

task generateCoverageReport(type: Exec, dependsOn: testQuick) {
outputs.dir("${venv_name}")
commandLine 'bash', '-c',
"source ${venv_name}/bin/activate && set -x && " +
"coverage html"
}

task buildWheel(type: Exec, dependsOn: [environmentSetup]) {
commandLine 'bash', '-c', "source ${venv_name}/bin/activate && " +
'uv pip install build && RELEASE_VERSION="\${RELEASE_VERSION:-0.0.0.dev1}" RELEASE_SKIP_INSTALL=1 RELEASE_SKIP_UPLOAD=1 ./scripts/release.sh'
Expand Down
7 changes: 7 additions & 0 deletions metadata-ingestion-modules/gx-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ task testQuick(type: Exec, dependsOn: installDevTest) {
"pytest -vv --continue-on-collection-errors --junit-xml=junit.quick.xml"
}

task generateCoverageReport(type: Exec, dependsOn: testQuick) {
outputs.dir("${venv_name}")
commandLine 'bash', '-c',
"source ${venv_name}/bin/activate && set -x && " +
"coverage html"
}

task buildWheel(type: Exec, dependsOn: [environmentSetup]) {
commandLine 'bash', '-c', "source ${venv_name}/bin/activate && " +
'uv pip install build && RELEASE_VERSION="\${RELEASE_VERSION:-0.0.0.dev1}" RELEASE_SKIP_INSTALL=1 RELEASE_SKIP_UPLOAD=1 ./scripts/release.sh'
Expand Down
7 changes: 7 additions & 0 deletions metadata-ingestion-modules/prefect-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ task testFull(type: Exec, dependsOn: [testQuick, installDevTest]) {
"pytest -m 'not slow_integration' -vv --continue-on-collection-errors --junit-xml=junit.full.xml"
}

task generateCoverageReport(type: Exec, dependsOn: testFull) {
outputs.dir("${venv_name}")
commandLine 'bash', '-c',
"source ${venv_name}/bin/activate && set -x && " +
"coverage html"
}


task buildWheel(type: Exec, dependsOn: [environmentSetup]) {
commandLine 'bash', '-c', "source ${venv_name}/bin/activate && " +
Expand Down
8 changes: 8 additions & 0 deletions metadata-ingestion/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ task testQuick(type: Exec, dependsOn: [installDev, ':metadata-models:generateJso
"pytest ${cvg_arg} tests/unit --random-order --durations=20 -m 'not integration' -vv --continue-on-collection-errors --junit-xml=junit.quick.xml"
}

task generateCoverageReport(type: Exec, dependsOn: testQuick) {
outputs.dir("${venv_name}")
commandLine 'bash', '-c',
"source ${venv_name}/bin/activate && set -x && " +
"coverage html"
}


task installDevTest(type: Exec, dependsOn: [install]) {
def sentinel_file = "${venv_name}/.build_install_dev_test_sentinel"
inputs.file file('setup.py')
Expand Down

0 comments on commit d2fb6ba

Please sign in to comment.