forked from hiero-ledger/hiero-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.53 KB
/
pr-check-naming-test.yml
File metadata and controls
56 lines (45 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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."