@@ -42,40 +42,30 @@ jobs:
4242 flake8 . --count --exit-zero --max-complexity=18 --max-line-length=127 --statistics
4343
4444 # ------------------------------------------------------------------------
45- # PHASE 3: CUSTOM TESTS (The "Three Pillars" )
45+ # PHASE 3: COMBINED TESTS (Generates both coverage and test results )
4646 # ------------------------------------------------------------------------
47- # We keep these separate so the logs are easy for humans to read
48-
49- - name : Run Test 1 - Auto-Discovery (Smoke Test)
47+ - name : Run All Tests and Generate Reports
5048 run : |
5149 echo "--------------------------------------"
52- echo "GOAL: Verify all GUI modules load without crashing."
53- python -m unittest tests/test_auto_discovery.py
54-
55- - name : Run Test 2 - Deep Simulation (Behavior Test)
56- run : |
57- echo "--------------------------------------"
58- echo "GOAL: Verify SCPI commands and hardware protocols."
59- python -m unittest tests/test_deep_simulation.py
60-
61- - name : Run Test 3 - Full Stack Simulation (Integration Test)
62- run : |
63- echo "--------------------------------------"
64- echo "GOAL: Verify Launcher buttons and GUI-Backend handoff."
65- python -m unittest tests/test_full_stack_simulation.py
50+ echo "GOAL: Generate coverage.xml and junit.xml"
51+
52+ # This command runs all tests, generates XML coverage, and JUnit XML.
53+ pytest --cov=. --cov-report=xml --junitxml=junit.xml -o junit_family=legacy tests/
6654
6755 # ------------------------------------------------------------------------
68- # PHASE 4: COVERAGE & PROOF (For JOSS Reviewers)
56+ # PHASE 4: CODECOV UPLOADS
6957 # ------------------------------------------------------------------------
70- - name : Generate Coverage Report
71- run : |
72- echo "--------------------------------------"
73- echo "GOAL: Calculate Test Coverage %"
74- # We run pytest to generate the XML report needed by Codecov
75- # This re-runs the tests, but captures which lines were hit.
76- pytest --cov=. --cov-report=xml tests/
58+ - name : Upload Coverage Report (XML)
59+ uses : codecov/codecov-action@v3
60+ with :
61+ token : ${{ secrets.CODECOV_TOKEN }}
62+ files : ./coverage.xml
63+ fail_ci_if_error : false
7764
78- - name : Upload coverage reports to Codecov
79- uses : codecov/codecov-action@v5
65+ - name : Upload Test Results to Codecov (JUnit)
66+ if : ${{ !cancelled() }}
67+ uses : codecov/test-results-action@v1
8068 with :
81- token : ${{ secrets.CODECOV_TOKEN }}
69+ token : ${{ secrets.CODECOV_TOKEN }}
70+ files : ./junit.xml
71+ # This step uploads test timing and failure data
0 commit comments