Skip to content

Conversation

@Raja-89
Copy link
Contributor

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

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

  1. Workflow Separation: The test naming check is removed from the high-privilege pr-checks.yml and moved to a new, separate workflow file (pr-check-naming-test.yml). This is necessary because pr-checks.yml's pull_request_target event and write permissions were blocking the test job from running on forks.
  2. Permissions Update: The new workflow uses the standard pull_request event and requires only contents: read permissions, resolving the security constraint issue.
  3. Checkout V5: The action is updated to use actions/checkout@v5 (pinned to its latest SHA), as requested.
  4. Refined Logic & Exclusions: The validation logic is updated to enforce two distinct rules while correctly excluding utility files:
    • Unit Tests (tests/unit): Must start with test_*.py.
    • Integration Tests (tests/integration): Must end with *_test.py.
    • Exclusions: Helper files like __init__.py, conftest.py, mock_server.py, and utils_for_test.py are explicitly excluded from the naming check.

✅ Readiness & Policy Checklist

  • The naming check logic matches the required conventions (unit starts with test_, integration ends with _test).
  • Helper files are excluded to prevent false failures.
  • All commits are signed (git commit -s) and verified.
  • Changelog entry has been added to the [Unreleased] -> Added section.

⚠️ Note to Maintainer

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

@Raja-89
Copy link
Contributor Author

Raja-89 commented Nov 10, 2025

Hey @exploreriii , can you pleasse review this one?

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.

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

Image

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

@exploreriii
Copy link
Contributor

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

@Raja-89 Raja-89 force-pushed the feat/test-naming-check-v2 branch from 8548d07 to 242cdbc Compare November 11, 2025 17:10
@exploreriii
Copy link
Contributor

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

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.

Awesome - please check logs of your workflow to refine them

@Raja-89
Copy link
Contributor Author

Raja-89 commented Nov 11, 2025

Hey @exploreriii , I have applied the changes.

@exploreriii
Copy link
Contributor

its working! please can you
fix the naming for tests/integration/test_token_fee_schedule_update_transaction_e2e.py

@exploreriii
Copy link
Contributor

Raja please avoid merging from main, we strongly suggest against it and always recommend rebasing
See docs/sdk_developers/rebasing.md
(but this will be more difficult now that you've merged from main - maybe try this next time)

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
This is looking great, approved once #760 is merged
Thank you

@exploreriii
Copy link
Contributor

Hi @Raja-89

Would you mind renaming the following files to what we are enforcing?

❌ Invalid test filenames detected:
tests/unit/test_keys_public.py
tests/unit/test_token_create_transaction.py
tests/unit/test_file_update_transaction.py
tests/unit/test_token_associate_transaction.py
tests/unit/test_token_freeze_transaction.py
tests/unit/test_schedule_delete_transaction.py
tests/unit/test_prng_transaction.py
tests/unit/test_token_reject_transaction.py
tests/unit/test_token_relationship.py
tests/unit/test_topic_create_transaction.py
tests/unit/test_ethereum_transaction.py
tests/unit/test_token_dissociate_transaction.py
tests/unit/test_token_nft_info_query.py
tests/unit/test_token_info_query.py
tests/unit/test_keys_private.py
tests/unit/test_account_allowance_approve_transaction.py
tests/unit/test_transaction_record_query.py
tests/unit/test_contract_nonce_info.py
tests/unit/test_topic_id.py
tests/unit/test_token_fee_schedule_update_transaction.py
tests/unit/test_custom_fee.py
tests/unit/test_file_append_transaction.py
tests/unit/test_contract_execute_transaction.py
tests/unit/test_token_mint_transaction.py
tests/unit/test_token_revoke_kyc_transaction.py
tests/unit/test_topic_message_submit_transaction.py
tests/unit/test_token_unpause_transaction.py
tests/unit/test_contract_update_transaction.py
tests/unit/test_account_allowance_delete_transaction.py
tests/unit/test_hbar_allowance.py
tests/unit/test_account_update_transaction.py
tests/unit/test_executable.py
tests/unit/test_schedule_create_transaction.py
tests/unit/test_token_nft_transfer.py
tests/unit/test_file_id.py
tests/unit/test_contract_bytecode_query.py
tests/unit/test_account_records_query.py
tests/unit/test_token_id.py
tests/unit/test_token_nft_info.py
tests/unit/test_token_burn_transaction.py
tests/unit/test_account_info.py
tests/unit/test_token_nft_allowance.py
tests/unit/test_transaction_record.py
tests/unit/test_entity_id_helper.py
tests/unit/test_logger.py
tests/unit/test_token_airdrop_pending_id.py
tests/unit/test_file_contents_query.py
tests/unit/test_token_grant_kyc_transaction.py
tests/unit/test_file_delete_transaction.py
tests/unit/test_topic_info.py
tests/unit/test_supply_type.py
tests/unit/test_node_address.py
tests/unit/test_file_info.py
tests/unit/test_schedule_info.py
tests/unit/test_contract_delete_transaction.py
tests/unit/test_node_create_transaction.py
tests/unit/test_hbar_transfer.py
tests/unit/test_contract_create_transaction.py
tests/unit/test_account_balance_query.py
tests/unit/test_account_delete_transaction.py
tests/unit/test_contract_id.py
tests/unit/test_topic_update_transaction.py
tests/unit/test_token_type.py
tests/unit/test_token_info.py
tests/unit/test_file_create_transaction.py
tests/unit/test_freeze_transaction.py
tests/unit/test_query.py
tests/unit/test_schedule_sign_transaction.py
tests/unit/test_token_update_nfts_transaction.py
tests/unit/test_topic_delete_transaction.py
tests/unit/test_managed_node_address.py
tests/unit/test_node_delete_transaction.py
tests/unit/test_contract_call_query.py
tests/unit/test_account_info_query.py
tests/unit/test_file_info_query.py
tests/unit/test_freeze_type.py
tests/unit/test_node_update_transaction.py
tests/unit/test_token_transfer.py
tests/unit/test_token_pause_transaction.py
tests/unit/test_token_transfer_list.py
tests/unit/test_get_receipt_query.py
tests/unit/test_transfer_transaction.py
tests/unit/test_transaction_freeze_and_bytes.py
tests/unit/test_token_unfreeze_transaction.py
tests/unit/test_token_airdrop_transaction.py
tests/unit/test_schedule_info_query.py
tests/unit/test_contract_log_info.py
tests/unit/test_contract_info.py
tests/unit/test_token_allowance.py
tests/unit/test_token_wipe_transaction.py
tests/unit/test_schedule_id.py
tests/unit/test_token_airdrop_claim.py
tests/unit/test_token_update_transaction.py
tests/unit/test_topic_info_query.py
tests/unit/test_topic_message_query.py
tests/unit/test_token_delete_transaction.py
tests/unit/test_contract_function_result.py
tests/unit/test_token_airdrop_transaction_cancel.py
tests/unit/test_account_create_transaction.py
tests/unit/test_token_airdrop_pending_record.py
tests/unit/test_contract_info_query.py
tests/unit/test_custom_fee_limit.py
tests/unit/test_account_id.py

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
e.g.
test_topic_info_query.py -> topic_info_query_test.py

#760
?

@exploreriii
Copy link
Contributor

@Raja-89 please rename these files

tests/unit/test_keys_public.py
tests/unit/test_token_create_transaction.py
tests/unit/test_file_update_transaction.py
tests/unit/test_token_associate_transaction.py
tests/unit/test_token_freeze_transaction.py
tests/unit/test_schedule_delete_transaction.py
tests/unit/test_prng_transaction.py
tests/unit/test_token_reject_transaction.py
tests/unit/test_token_relationship.py
tests/unit/test_topic_create_transaction.py
tests/unit/test_ethereum_transaction.py
tests/unit/test_token_dissociate_transaction.py
tests/unit/test_token_nft_info_query.py
tests/unit/test_token_info_query.py
tests/unit/test_keys_private.py
tests/unit/test_account_allowance_approve_transaction.py
tests/unit/test_transaction_record_query.py
tests/unit/test_contract_nonce_info.py
tests/unit/test_topic_id.py
tests/unit/test_token_fee_schedule_update_transaction.py
tests/unit/test_custom_fee.py
tests/unit/test_file_append_transaction.py
tests/unit/test_contract_execute_transaction.py
tests/unit/test_token_mint_transaction.py
tests/unit/test_token_revoke_kyc_transaction.py
tests/unit/test_topic_message_submit_transaction.py
tests/unit/test_token_unpause_transaction.py
tests/unit/test_contract_update_transaction.py
tests/unit/test_account_allowance_delete_transaction.py
tests/unit/test_hbar_allowance.py
tests/unit/test_account_update_transaction.py
tests/unit/test_executable.py
tests/unit/test_schedule_create_transaction.py
tests/unit/test_token_nft_transfer.py
tests/unit/test_file_id.py
tests/unit/test_contract_bytecode_query.py
tests/unit/test_account_records_query.py
tests/unit/test_token_id.py
tests/unit/test_token_nft_info.py
tests/unit/test_token_burn_transaction.py
tests/unit/test_account_info.py
tests/unit/test_token_nft_allowance.py
tests/unit/test_transaction_record.py
tests/unit/test_entity_id_helper.py
tests/unit/test_logger.py
tests/unit/test_token_airdrop_pending_id.py
tests/unit/test_file_contents_query.py
tests/unit/test_token_grant_kyc_transaction.py
tests/unit/test_file_delete_transaction.py
tests/unit/test_topic_info.py
tests/unit/test_supply_type.py
tests/unit/test_node_address.py
tests/unit/test_file_info.py
tests/unit/test_schedule_info.py
tests/unit/test_contract_delete_transaction.py
tests/unit/test_node_create_transaction.py
tests/unit/test_hbar_transfer.py
tests/unit/test_contract_create_transaction.py
tests/unit/test_account_balance_query.py
tests/unit/test_account_delete_transaction.py
tests/unit/test_contract_id.py
tests/unit/test_topic_update_transaction.py
tests/unit/test_token_type.py
tests/unit/test_token_info.py
tests/unit/test_file_create_transaction.py
tests/unit/test_freeze_transaction.py
tests/unit/test_query.py
tests/unit/test_schedule_sign_transaction.py
tests/unit/test_token_update_nfts_transaction.py
tests/unit/test_topic_delete_transaction.py
tests/unit/test_managed_node_address.py
tests/unit/test_node_delete_transaction.py
tests/unit/test_contract_call_query.py
tests/unit/test_account_info_query.py
tests/unit/test_file_info_query.py
tests/unit/test_freeze_type.py
tests/unit/test_node_update_transaction.py
tests/unit/test_token_transfer.py
tests/unit/test_token_pause_transaction.py
tests/unit/test_token_transfer_list.py
tests/unit/test_get_receipt_query.py
tests/unit/test_transfer_transaction.py
tests/unit/test_transaction_freeze_and_bytes.py
tests/unit/test_token_unfreeze_transaction.py
tests/unit/test_token_airdrop_transaction.py
tests/unit/test_schedule_info_query.py
tests/unit/test_contract_log_info.py
tests/unit/test_contract_info.py
tests/unit/test_token_allowance.py
tests/unit/test_token_wipe_transaction.py
tests/unit/test_schedule_id.py
tests/unit/test_token_airdrop_claim.py
tests/unit/test_token_update_transaction.py
tests/unit/test_topic_info_query.py
tests/unit/test_topic_message_query.py
tests/unit/test_token_delete_transaction.py
tests/unit/test_contract_function_result.py
tests/unit/test_token_airdrop_transaction_cancel.py
tests/unit/test_account_create_transaction.py
tests/unit/test_token_airdrop_pending_record.py
tests/unit/test_contract_info_query.py
tests/unit/test_custom_fee_limit.py
tests/unit/test_account_id.py

to be
tests/unit/keys_public_test.py
tests/unittoken_create_transaction_test.py
tests/unit/file_update_transaction_test.py
tests/unit/token_associate_transaction_test.py
tests/unit/token_freeze_transaction_test.py
tests/unit/schedule_delete_transaction_test.py
tests/unit/prng_transaction_test.py
tests/unit/token_reject_transaction_test.py

etc is that clear?

@nadineloepfe
Copy link
Contributor

Hi @Raja-89 ,
Are you still working on this?
Thank you

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.

3 participants