Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,29 @@ jobs:
for i in ${change_labels}; do
echo "${i}=true" | tee -a $GITHUB_OUTPUT
done
coveralls_done:
if: (always()) && (needs.classify_changes.outputs.no_code != 'true')
name: Coveralls Done
needs:
- test_python_linux_x86_64_0
- test_python_linux_x86_64_1
- test_python_linux_x86_64_2
- test_python_linux_x86_64_3
- test_python_linux_x86_64_4
- test_python_linux_x86_64_5
- test_python_linux_x86_64_6
- test_python_linux_x86_64_7
- test_python_linux_x86_64_8
- test_python_linux_x86_64_9
- test_python_linux_arm64
- test_python_macos13_x86_64
- classify_changes
runs-on:
- ubuntu-22.04
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason 22?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it is what our generator script spit out.

steps:
- uses: coverallsapp/github-action@v2
with:
parallel-finished: true
lint_python:
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.no_code != 'true')
name: Lint Python and Shell
Expand Down Expand Up @@ -793,6 +816,7 @@ jobs:
- build_wheels_macos14_arm64
- check_release_notes
- classify_changes
- coveralls_done
- lint_python
- test_python_linux_arm64
- test_python_linux_x86_64_0
Expand Down Expand Up @@ -873,6 +897,16 @@ jobs:
name: logs-python-test-Linux-ARM64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming: This means coveralls can't break a build, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite, that one is to satisfy the GitHub Action rules so that we upload coverage even if one of the test fails so we can see what code was executed when the test failed.

I added fail-on-error: false which should accomplish the "can't break a build" run.

if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_arm64
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_0:
env:
Expand Down Expand Up @@ -974,6 +1008,16 @@ jobs:
name: logs-python-test-0_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_0/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_1:
env:
Expand Down Expand Up @@ -1075,6 +1119,16 @@ jobs:
name: logs-python-test-1_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_1/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_2:
env:
Expand Down Expand Up @@ -1176,6 +1230,16 @@ jobs:
name: logs-python-test-2_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_2/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_3:
env:
Expand Down Expand Up @@ -1277,6 +1341,16 @@ jobs:
name: logs-python-test-3_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_3/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_4:
env:
Expand Down Expand Up @@ -1378,6 +1452,16 @@ jobs:
name: logs-python-test-4_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_4/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_5:
env:
Expand Down Expand Up @@ -1479,6 +1563,16 @@ jobs:
name: logs-python-test-5_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_5/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_6:
env:
Expand Down Expand Up @@ -1580,6 +1674,16 @@ jobs:
name: logs-python-test-6_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_6/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_7:
env:
Expand Down Expand Up @@ -1681,6 +1785,16 @@ jobs:
name: logs-python-test-7_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_7/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_8:
env:
Expand Down Expand Up @@ -1782,6 +1896,16 @@ jobs:
name: logs-python-test-8_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_8/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_linux_x86_64_9:
env:
Expand Down Expand Up @@ -1883,6 +2007,16 @@ jobs:
name: logs-python-test-9_10-Linux-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_linux_x86_64_9/10
format: cobertura
parallel: true
timeout-minutes: 90
test_python_macos13_x86_64:
env:
Expand Down Expand Up @@ -1953,6 +2087,16 @@ jobs:
name: logs-python-test-macOS13-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- continue-on-error: true
if: always()
name: Report coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
allow-empty: true
file: dist/coverage/python/coverage.xml
flag-name: test_python_macos13_x86_64
format: cobertura
parallel: true
timeout-minutes: 90
name: Pull Request CI
'on':
Expand Down
4 changes: 4 additions & 0 deletions pants.ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ sandboxer = true
[test]
report = true
attempts_default = 3
use_coverage = true

[pytest]
args = ["--no-header", "--noskip", "-vv"]

[coverage-py]
report = ["raw", "xml"]

[subprocess-environment]
env_vars.add = [
# Works around bad `-arch arm64` flag embedded in Xcode 12.x Python interpreters on intel
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ known_first_party = ["internal_plugins", "pants", "pants_test"]
asyncio_mode = "auto"
markers = ["platform_specific_behavior", "call_by_type"]

[tool.coverage.run]
omit = [
# pants/engine/internals tests
"preludes/bad.py",
# from testprojects/src/python/vcs_test/
"tables.py",
# While BUILD files are Python, during testing we create/inject/munge and do
# all sorts of things with them that is hard to track
"BUILD",
]

[tool.coverage.report]
# We inject this file at test time (see src/python/pants/conftest.py), and so
# coverage will gather stats for it, but it doesn't correspond to a real source file,
Expand Down
Loading
Loading