-
Notifications
You must be signed in to change notification settings - Fork 92
ci: add standalone workflow to enforce test naming rules (Fixes #744) #763
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?
Conversation
|
Hey @exploreriii , can you pleasse review this one? |
exploreriii
left a comment
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.
To help you test this, I coped the code and did a PR to my personal fork:
exploreriii#13
Before it could run, I had to fix this:
actions/checkout@8ade135
Where did you get it from? this doesn't exist.
i had to find the correct version by visting the new release and then clicking on the commit linked there:
https://github.com/actions/checkout
then https://github.com/actions/checkout/releases
then
https://github.com/actions/checkout/releases/tag/v5.0.0
then
actions/checkout@08c6903
and thus copying
08c6903cd8c0fde910a37f88322edcfb5dd907a8
Once that is fixed, i ran it in my PR.
Note that it does not work as desired
it found the first error and exited
It should isntead LIST ALL files that don't work
Additionally, given we have an issue open that will rename every test to _test.py, we don't need to check for other naming schemes.
In summary, you need to:
- only test for _test.py
- remove all excluded files (there is more of them, why did you not check!) ! -path "tests/integration/init.py"
! -path "tests/unit/conftest.py"
! -path "tests/unit/mock_server.py"
! -path "tests/unit/init.py"
! -path "tests/init.py" \ - make sure it checks for all the misnamed files, and only then exits when completed, not at the first failure
You can look at my PR which basically solves this issue and just use that code if you want
exploreriii@c99d627
else solve your issues above.
Find the logs to the failures in your script:
https://github.com/exploreriii/hiero_sdk_python/actions/runs/19245731429
and the PR I tested it on: exploreriii#13
|
Hi @Raja-89 please rebase, we have just released 0.1.8 so yoru changelog entry will need to be moved up to the new unreleased section |
…-ledger#744) Signed-off-by: Raja Rathour <[email protected]>
Signed-off-by: Raja Rathour <[email protected]>
Signed-off-by: Raja Rathour <[email protected]>
Signed-off-by: Raja Rathour <[email protected]>
8548d07 to
242cdbc
Compare
|
I think you've forgotten to exclude some files - am just running the workflow (well done! its now recognised) but you'll see errors that shouldn't be there |
exploreriii
left a comment
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.
Awesome - please check logs of your workflow to refine them
Signed-off-by: Raja Rathour <[email protected]>
|
Hey @exploreriii , I have applied the changes. |
|
its working! please can you |
…t.py convention Signed-off-by: Raja Rathour <[email protected]>
|
Raja please avoid merging from main, we strongly suggest against it and always recommend rebasing |
exploreriii
left a comment
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.
|
Hi @Raja-89 Would you mind renaming the following files to what we are enforcing? ❌ Invalid test filenames detected: We have an open issue to resolve that naming but the assignee has not been able to complete the PR. Can I assign you to issue 760, and you solve it in this PR by changing the naming of these unit tests to test at the end #760 |
|
@Raja-89 please rename these files tests/unit/test_keys_public.py to be etc is that clear? |
|
Hi @Raja-89 , |
Summary
This PR replaces the previous non-functional test naming check by implementing a new, standalone CI workflow (
pr-check-naming-test.yml) that adheres to the maintainers' security and architecture guidance.It ensures that test files follow the required naming conventions for proper test discovery and CI reliability, thus resolving #744.
🛠️ Key Changes
pr-checks.ymland moved to a new, separate workflow file (pr-check-naming-test.yml). This is necessary becausepr-checks.yml'spull_request_targetevent and write permissions were blocking the test job from running on forks.pull_requestevent and requires onlycontents: readpermissions, resolving the security constraint issue.actions/checkout@v5(pinned to its latest SHA), as requested.tests/unit): Must start withtest_*.py.tests/integration): Must end with*_test.py.__init__.py,conftest.py,mock_server.py, andutils_for_test.pyare explicitly excluded from the naming check.✅ Readiness & Policy Checklist
test_, integration ends with_test).git commit -s) and verified.[Unreleased] -> Addedsection.This PR can be marked as Ready for Review after the team merges the ongoing issue to standardize all existing test filenames (which will ensure the workflow passes immediately).
Closes: #744