-
-
Notifications
You must be signed in to change notification settings - Fork 123
Run ferc_to_sqlite and pudl_etl independent of integration tests #2825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 112 commits
6bf1115
d89e1f4
3b43bef
a8fb7dc
8587dc7
a5b2867
4916320
2b1a116
bb623af
da07819
7dc86aa
162f62a
68c6dee
09fb56d
f05fcd3
173ad8c
c9b83ab
e35efc9
a81ebf0
364b053
d4b46fc
ffd56e0
2edea32
d5fcc73
4f42efa
ac95389
61bb7b6
b1f3b95
fb2892f
678d54e
6ec7d99
2f43405
66f5f54
3ac2879
12903a0
28af787
a725c07
00e41fb
645ae4f
051d2b1
58597e4
5b162bd
b7afb1e
e17f35c
64500b7
3a7b30a
2a9f5a2
f226f38
583f7f8
0590f29
fa814ea
c3da09e
0fdd73d
171dab5
2c96289
666f1e9
31dde43
297eca0
fb30bd5
6ff74f5
567da80
ca9854e
b08ead3
a23f7eb
e834f03
6d14c83
8414ce3
65aaa60
48726c0
cc1f6a9
14d9a4a
1c8dd9c
6e4770c
04812b5
fc023db
7ac4fbb
1ea46f5
ba40c9b
5515cbf
5fa6f5a
9f2ad16
c039a0a
b0105f3
dd6d357
908e83c
2fb0603
bf77921
a9f6053
9976578
87c6ab4
d5c5b91
a8e0eaa
910977b
c65426b
50eec4f
da8dbcc
5c9a194
72ce2f2
6d032f9
892adac
7f8619a
e94e277
da3b055
5d49446
6696f2f
fec6061
c201637
8ec32bb
e52c349
131b9fa
d17fa54
01a5efc
c51d8e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,16 @@ on: | |
- opened | ||
- synchronize | ||
- ready_for_review | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PUDL_OUTPUT: /home/runner/pudl-work/output/ | ||
PUDL_INPUT: /home/runner/pudl-work/input/ | ||
DAGSTER_HOME: /home/runner/pudl-work/dagster_home/ | ||
ETL_CONFIG: src/pudl/package_data/settings/etl_fast.yml | ||
ETL_COMMANDLINE_OPTIONS: --gcs-cache-path=gs://zenodo-cache.catalyst.coop | ||
|
||
jobs: | ||
ci-docs: | ||
|
@@ -64,7 +69,6 @@ jobs: | |
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -105,31 +109,31 @@ jobs: | |
path: coverage.xml | ||
|
||
ci-integration: | ||
runs-on: | ||
group: large-runner-group | ||
labels: ubuntu-22.04-4core | ||
needs: | ||
- ci-unit | ||
zaneselvans marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ubuntu-22.04-4core | ||
if: github.event.pull_request.draft == false | ||
permissions: | ||
contents: read | ||
id-token: write | ||
strategy: | ||
fail-fast: false | ||
Comment on lines
-115
to
-116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we want |
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Install Conda environment using mamba | ||
- name: Install conda-lock environment with micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: environments/conda-lock.yml | ||
environment-name: pudl-dev | ||
cache-environment: true | ||
|
||
- name: Install PUDL and its dependencies | ||
run: pip install --no-deps --no-cache-dir . | ||
|
||
- name: Log environment details | ||
run: | | ||
conda info | ||
|
@@ -169,22 +173,41 @@ jobs: | |
workload_identity_provider: "projects/345950277072/locations/global/workloadIdentityPools/gh-actions-pool/providers/gh-actions-provider" | ||
service_account: "tox-pytest-github-action@catalyst-cooperative-pudl.iam.gserviceaccount.com" | ||
|
||
- name: Run integration tests, trying to use GCS cache if possible | ||
- name: Run ferc_to_sqlite | ||
env: | ||
COVERAGE_FILE: .coverage.ferc_to_sqlite | ||
run: | | ||
pip install --no-deps --editable . | ||
pudl_datastore --dataset epacems --partition year_quarter=2022q1 | ||
make pytest-integration | ||
|
||
coverage run --concurrency=multiprocessing \ | ||
src/pudl/ferc_to_sqlite/cli.py --clobber ${{ env.ETL_COMMANDLINE_OPTIONS }} ${{ env.ETL_CONFIG }} | ||
- name: Run pudl_etl | ||
env: | ||
COVERAGE_FILE: .coverage.pudl_etl | ||
run: | | ||
alembic upgrade head | ||
coverage run --concurrency=multiprocessing \ | ||
src/pudl/etl/cli.py ${{ env.ETL_COMMANDLINE_OPTIONS }} ${{ env.ETL_CONFIG }} | ||
- name: Run integration tests | ||
env: | ||
COVERAGE_FILE: .coverage.pytest | ||
run: | | ||
coverage run --concurrency=multiprocessing \ | ||
-m pytest -n auto --live-dbs test/integration | ||
- name: Checksum coverage files | ||
run: ls .coverage* | xargs md5sum | sort | ||
zaneselvans marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Generate coverage | ||
run: | | ||
coverage --version | ||
coverage combine | ||
zaneselvans marked this conversation as resolved.
Show resolved
Hide resolved
|
||
coverage xml | ||
coverage report | ||
- name: Upload coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-integration | ||
path: coverage.xml | ||
|
||
- name: Log post-test Zenodo datastore contents | ||
run: find ${{ env.PUDL_INPUT }} | ||
|
||
ci-coverage: | ||
name: Upload coverage to CodeCov | ||
runs-on: ubuntu-latest | ||
needs: | ||
- ci-docs | ||
|
@@ -198,37 +221,9 @@ jobs: | |
with: | ||
path: coverage | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps this is a bit of confusing api. When uploading artifacts, |
||
- name: List downloaded files | ||
run: | | ||
ls -R | ||
run: find -type f | ||
- name: Upload test coverage report to CodeCov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
directory: coverage | ||
|
||
ci-notify: | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
needs: | ||
- ci-docs | ||
- ci-unit | ||
- ci-integration | ||
steps: | ||
- name: Inform the Codemonkeys | ||
uses: 8398a7/action-slack@v3 | ||
continue-on-error: true | ||
with: | ||
status: custom | ||
fields: workflow,job,commit,repo,ref,author,took | ||
custom_payload: | | ||
{ | ||
username: 'action-slack', | ||
icon_emoji: ':octocat:', | ||
attachments: [{ | ||
color: '${{ needs.ci-test.result }}' === 'success' ? 'good' : '${{ needs.ci-test.result }}' === 'failure' ? 'danger' : 'warning', | ||
text: `${process.env.AS_REPO}@${process.env.AS_REF}\n ${process.env.AS_WORKFLOW} (${process.env.AS_COMMIT})\n by ${process.env.AS_AUTHOR}\n Status: ${{ needs.ci-test.result }}`, | ||
}] | ||
} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} # required | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
MATRIX_CONTEXT: ${{ toJson(matrix) }} # required | ||
fail_ci_if_error: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,11 +310,30 @@ curl = ">=8.4.0" | |
|
||
[tool.coverage.run] | ||
# See note above on need to specify separate sources for pytest-coverage and coverage. | ||
source = ["src/pudl/", "test/integration/", "test/unit/"] | ||
include = [ | ||
"src/pudl/**", | ||
"test/integration/**", | ||
"test/unit/**", | ||
"*/site-packages/pudl/**", | ||
] | ||
omit = [ | ||
# Never hit by integration tests: | ||
"src/pudl/validate.py", | ||
] | ||
sigterm = true | ||
concurrency=["multiprocessing"] | ||
debug = ["config", "trace"] | ||
|
||
[tool.coverage.paths] | ||
# When running pudl tools installed with pip, the sources are imported | ||
# from package-data/pudl directory. The following maps this to raw | ||
# source files. | ||
pudl_sources = [ | ||
"src/pudl/", | ||
"*/site-packages/pudl/", | ||
"test/unit", | ||
"test/integration", | ||
] | ||
Comment on lines
-313
to
+336
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm re-running the CodeCov tests now, but it seems like something has changed that's reducing the test coverage by a few hundred lines / a couple of percent, and I don't understand what it is. Looking at the indirect coverage changes some differences make sense, like increased coverage for the If I run make pytest-coverage locally I get overall coverage of 92.8% which is comparable to the coverage on
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for delays, life has been busy. I will try to follow up on these in the coming week and try to figure out what is going on here. The fact that coverage is so brittle and it is so hard to figure out why it fluctuates so much is very discouraging; it shouldn't be that hard :-/ |
||
|
||
[tool.coverage.report] | ||
precision = 1 | ||
|
Uh oh!
There was an error while loading. Please reload this page.