-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
Pants CI: Run all unit and pack tests #6269
base: master
Are you sure you want to change the base?
Changes from 4 commits
be4ce9f
3661a0b
970aaaa
c401e72
838b8e1
eb3868a
8f16a19
9a532ad
16b4899
433cad5
df96ef0
37125e7
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 |
---|---|---|
|
@@ -88,6 +88,7 @@ jobs: | |
git submodule foreach 'git tag' | ||
|
||
- name: 'Set up Python (${{ matrix.python-version }})' | ||
id: python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '${{ matrix.python-version }}' | ||
|
@@ -102,19 +103,45 @@ jobs: | |
# To ignore a bad cache, bump the cache* integer. | ||
gha-cache-key: cache0-py${{ matrix.python-version }} | ||
|
||
- name: Test | ||
- name: Test pants-plugins | ||
if: ${{ matrix.python-version-short == '3.9' }} | ||
env: | ||
# Github Actions uses the 'runner' user, so use that instead of stanley. | ||
ST2TESTS_SYSTEM_USER: 'runner' | ||
# We do not support running pytest everywhere yet. When we do it will be simply: | ||
# pants test :: | ||
# Until then, we need to manually adjust this command line to test what we can. | ||
run: | | ||
pants test pylint_plugins/:: pants-plugins/:: | ||
pants test pants-plugins/:: | ||
|
||
# We do not support running pytest everywhere yet. When we do it will be simply: | ||
# pants test :: | ||
# Until then, we need to manually adjust this command line to test what we can. | ||
# So far, this includes unit, pack, and pants-plugins tests. | ||
# TODO: run integration tests | ||
|
||
- name: Unit Tests | ||
env: | ||
# Github Actions uses the 'runner' user, so use that instead of stanley. | ||
ST2TESTS_SYSTEM_USER: 'runner' | ||
run: > | ||
pants | ||
--python-bootstrap-search-path=[] | ||
--python-bootstrap-search-path=${{ steps.python.outputs.python-path }} | ||
--tag=unit | ||
test '::' | ||
|
||
- name: Pack Tests | ||
env: | ||
# Github Actions uses the 'runner' user, so use that instead of stanley. | ||
ST2TESTS_SYSTEM_USER: 'runner' | ||
run: > | ||
pants | ||
--python-bootstrap-search-path=[] | ||
--python-bootstrap-search-path=${{ steps.python.outputs.python-path }} | ||
--tag=pack | ||
test '::' | ||
Comment on lines
+305
to
+306
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.
|
||
|
||
- name: Upload pants log | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pants-log-py${{ matrix.python-version }} | ||
path: .pants.d/pants.log | ||
if: always() # We want the log even on failures. | ||
if: ${{ always() }} # We want the log even on failures. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ python_sources() | |
|
||
python_tests( | ||
name="tests", | ||
tags=["unit"], | ||
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. This allowed me to run all unit tests without explicitly running the pylint_plugins tests. |
||
dependencies=[ | ||
"./fixtures", | ||
"!//conftest.py:test_utils", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
::
is a glob that means everything. Using--tag=unit
filters everything down to only those test targets that are tagged withunit
.