Skip to content

Conversation

@Raja-89
Copy link
Contributor

@Raja-89 Raja-89 commented Nov 7, 2025

Fixes #744

Adds CI check enforcing *_test.py naming for unit/integration tests.

@Raja-89
Copy link
Contributor Author

Raja-89 commented Nov 7, 2025

Hey @exploreriii , It is ready for review now.
Thanks

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Could we check if this works to pick up incorrectly named files?
can you add a unit and integration test file (a copy of another unit and integration test) and just name them incorrectly?


- name: Validate test file naming convention
run: |
echo "Checking for test files that don't end with _test.py..."
Copy link
Contributor

Choose a reason for hiding this comment

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

only the integration tests end with test
the unit tests start with test

@Raja-89
Copy link
Contributor Author

Raja-89 commented Nov 7, 2025

@exploreriii , ready for final review, please check

exploreriii

This comment was marked as outdated.

@exploreriii

This comment was marked as outdated.

exploreriii

This comment was marked as outdated.

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @Raja-89
So! Turns out this PR for it to work is more advanced than I had initially anticipated - sorry!

in pr-checks.yml, we basically have a permissions restriction that will never let your test workflow run as a pull request to the python sdk main. The reason this is there, is because one workflow (title check) requires a write permission which requires special security handling.

Therefore, my recommendation is to create a separate pr-check for the title check, call it say pr-check-naming-test.yml. This should have looser permissions because it only requires read access.

To test if this worked, I created a pull request to my exploreriii python sdk main (the fork). This then allows it to run as a separate workflow.

Additionally, as mentioned, we currently have tests named all kinds of different things. Therefore, I created a new issue to standardise the tests to end in _test.py. This will allow your approach of checking all files end in _test.py to pick up all the test files.

There is another issue which you have considered - some files in unit/ and integration/ tests are not tests, but helper utility files. These are necessary to be in unit/ and integration/ but should not be included in the test. In summary, I had to exclude a test naming check on all these files.

So to make your PR actually work you need to:

  1. Remove the test from pr-check and create a new file.
  2. in your new test workflow, you need to exclude failures if the files that are helper files eg.. init, mock_server, utils_for_test.
  3. Wait until test files are renamed _test.py and that is merged
  4. copy and use for inspiration my test workflow here
    exploreriii#13
  5. exploreriii#13
    https://github.com/exploreriii/hiero_sdk_python/pull/13/files#diff-01e130e4348bfe2535500bc5e2613cd1a1aeb078a55bee55c1935c3e3871ae77
  6. actions 4 is outdated, you should use the most updated one which is version 5 and use the commit hash for it .
    https://github.com/actions/checkout/releases/tag/v5.0.0
  7. as its already tested, you can remove the bad name examples.

Hope this helps and is clearer as to why your workflow will not run and will not correctly pick up test name failures.

If you'd like me to complete the PR for you, please let me know, I can do it and have the files ready to go.

@Raja-89
Copy link
Contributor Author

Raja-89 commented Nov 10, 2025

Let me start fresh upon a new PR then I will let you know , if it doesn't give the desired output

@Raja-89 Raja-89 closed this by deleting the head repository Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solo network tests don't run different named tests

2 participants