Skip to content

Commit a484f2b

Browse files
GH613 Adding documentation to tests.md and workflow file
1 parent 83763bd commit a484f2b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/comment_commands.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ permissions:
77
checks: write
88

99
env:
10+
# store mapping of commands to use with poetry
1011
RUN_COMMAND: '{"/pandas_nightly": "pytest --nightly", "/pyright_strict": "pyright_strict", "/mypy_nightly": "mypy --mypy_nightly"}'
12+
# store mapping of labels to display in the check runs
1113
DISPLAY_COMMAND: '{"/pandas_nightly": "Pandas nightly tests", "/pyright_strict": "Pyright strict tests", "/mypy_nightly": "Mypy nightly tests"}'
1214

1315
jobs:
1416
optional_tests:
1517
name: "Optional tests run"
1618
runs-on: ubuntu-latest
1719
timeout-minutes: 10
20+
# if more commends are added, they will need to be added here too as we don't have avvecc to env at this stage
1821
if: (github.event.issue.pull_request) && contains(fromJSON('["/pandas_nightly", "/pyright_strict", "/mypy_nightly"]'), github.event.comment.body)
1922

2023
steps:
@@ -27,10 +30,12 @@ jobs:
2730
python-version: "3.11"
2831

2932
- name: Run ${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }}
33+
# run the tests based on the value of the comment
3034
id: tests-step
3135
run: poetry run poe ${{ fromJSON(env.RUN_COMMAND)[github.event.comment.body] }}
3236

3337
- name: Get head sha and store value
38+
# get the sha of the last commit to attach the results of the tests
3439
if: always()
3540
id: get-sha
3641
uses: actions/github-script@v7
@@ -45,6 +50,7 @@ jobs:
4550
core.setOutput('sha', pr.data.head.sha)
4651
4752
- name: Report results of the tests and publish
53+
# publish the results to a check run no matter the pass or fail
4854
if: always()
4955
uses: actions/github-script@v7
5056
with:

docs/tests.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Here are the most important options. Fore more details, please use `poe --help`.
66

77
- Run all tests (against both source and installed stubs): `poe test_all`
8-
- Run tests against the source code: `poe test`
8+
- Run tests against the source code: `poe test`
99
- Run only mypy: `poe mypy`
1010
- Run only pyright: `poe pyright`
1111
- Run only pytest: `poe pytest`
@@ -20,3 +20,9 @@ The following tests are **optional**. Some of them are run by the CI but it is o
2020
- Use mypy nightly to validate the annotations: `poe mypy --mypy_nightly`
2121
- Use pyright in full strict mode: `poe pyright_strict`
2222
- Run stubtest to compare the installed pandas-stubs against pandas (this will fail): `poe stubtest`. If you have created an allowlist to ignore certain errors: `poe stubtest path_to_the_allow_list`
23+
24+
Among the tests above, the following can be run directly during a PR by commenting in the discussion.
25+
26+
- Run pytest against pandas nightly by commenting `\pandas_nightly`
27+
- Use mypy nightly to validate the annotations by commenting `\mypy_nightly`
28+
- Use pyright in full strict mode by commenting `\pyright_strict`

0 commit comments

Comments
 (0)