-
Notifications
You must be signed in to change notification settings - Fork 152
ci: add workflow check for *_test.py naming convention #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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3da5f92
ci: add workflow check for *_test.py naming convention
Raja-89 722ea7d
Merge branch 'main' into fix/test-naming-check
Raja-89 4caa4f9
ci: add workflow check for *_test.py naming convention
Raja-89 c33fb75
ci: add workflow check for *_test.py naming convention
Raja-89 15ae9e1
ci: add workflow check for *_test.py naming convention
Raja-89 d493576
test(ci): add intentionally misnamed unit & integration tests to vali…
Raja-89 e4cdd27
Merge branch 'main' into fix/test-naming-check
Raja-89 bed4d0a
Merge branch 'main' into fix/test-naming-check
Raja-89 af21f8a
test: add intentionally misnamed test files for CI validation
Raja-89 48bdd5a
test: add intentionally misnamed test files for CI validation
Raja-89 56bd8cd
ci: add separate workflow for test naming checks
Raja-89 1f1ff6e
test: add intentionally misnamed test file to validate CI failure
Raja-89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: 'Test Naming Check' | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "tests/**" | ||
| - ".github/workflows/pr-check-naming-test.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test-name-check: | ||
| name: Validate Test File Naming | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@8ade135a368bb9860e15bcafd2cf940ba6f36c4c | ||
|
|
||
|
|
||
| - name: Check Unit Test Naming (must start with test_*.py) | ||
| run: | | ||
| echo "Checking unit tests naming…" | ||
|
|
||
| invalid_unit=$(find tests/unit -type f -name "*.py" \ | ||
| ! -name "test_*.py" \ | ||
| ! -name "__init__.py" \ | ||
| ! -name "conftest.py" \ | ||
| ! -name "mock_server.py" \ | ||
| ! -name "utils_for_test.py" \ | ||
| || true) | ||
|
|
||
| if [ -n "$invalid_unit" ]; then | ||
| echo "❌ Invalid Unit Test Filenames:" | ||
| echo "$invalid_unit" | ||
| exit 1 | ||
| fi | ||
| echo "✔️ Unit test names are valid." | ||
|
|
||
| - name: Check Integration Test Naming (must end with _test.py) | ||
| run: | | ||
| echo "Checking integration test naming…" | ||
|
|
||
| invalid_integration=$(find tests/integration -type f -name "*.py" \ | ||
| ! -name "*_test.py" \ | ||
| ! -name "__init__.py" \ | ||
| ! -name "utils_for_test.py" \ | ||
| || true) | ||
|
|
||
| if [ -n "$invalid_integration" ]; then | ||
| echo "❌ Invalid Integration Test Filenames:" | ||
| echo "$invalid_integration" | ||
| exit 1 | ||
| fi | ||
| echo "✔️ Integration test names are valid." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import pytest | ||
|
|
||
| from hiero_sdk_python.query.account_balance_query import CryptoGetAccountBalanceQuery | ||
| from tests.integration.utils_for_test import IntegrationTestEnv | ||
|
|
||
|
|
||
| @pytest.mark.integration | ||
| def test_integration_account_balance_query_can_execute(): | ||
| env = IntegrationTestEnv() | ||
|
|
||
| try: | ||
| CryptoGetAccountBalanceQuery(account_id=env.operator_id).execute(env.client) | ||
| finally: | ||
| env.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| def dummy_test(): pass |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
only the integration tests end with test
the unit tests start with test