Skip to content

Commit 1b4534e

Browse files
Update joss_tests.yml
added a readymade tests for syntax errors
1 parent e6b1de9 commit 1b4534e

1 file changed

Lines changed: 37 additions & 12 deletions

File tree

.github/workflows/joss_tests.yml

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,65 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
# 1. Checkout the code
14+
# ------------------------------------------------------------------------
15+
# PHASE 1: SETUP
16+
# ------------------------------------------------------------------------
1517
- name: Checkout repository
1618
uses: actions/checkout@v3
1719

18-
# 2. Install Python 3.10 (Standard for scientific packages)
1920
- name: Set up Python 3.10
2021
uses: actions/setup-python@v4
2122
with:
2223
python-version: "3.10"
2324

24-
# 3. Install your project and dependencies
2525
- name: Install Dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
# Install the package in editable mode so tests can find folders like 'Keithley_2400'
28+
# Install PICA in editable mode so tests can find your source code
2929
pip install -e .
30-
# Install testing tools
31-
pip install pytest
30+
# Install Testing & Linting tools
31+
pip install pytest flake8
3232
33-
# 4. Run the Test Suite
34-
- name: Run All Tests
33+
# ------------------------------------------------------------------------
34+
# PHASE 2: READYMADE TESTS (Standard Industry Checks)
35+
# ------------------------------------------------------------------------
36+
- name: Run Style & Syntax Check (Flake8)
37+
run: |
38+
echo "STEP 1: Checking for critical syntax errors..."
39+
# This stops the build if there are actual Python syntax errors (E9, F63, etc.)
40+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
41+
42+
echo "STEP 2: Checking for code style warnings..."
43+
# This just warns you about messy code (long lines, unused imports) but won't fail the build
44+
# 'exit-zero' ensures your test passes even if your style isn't perfect
45+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
46+
47+
# ------------------------------------------------------------------------
48+
# PHASE 3: YOUR CUSTOM TESTS (The "Three Pillars")
49+
# ------------------------------------------------------------------------
50+
51+
# Test 1: Does the code exist and import correctly?
52+
- name: Run Test 1 - Auto-Discovery (Smoke Test)
3553
run: |
3654
echo "--------------------------------------"
37-
echo "RUNNING TEST 1: Auto-Discovery (Smoke Test)"
55+
echo "GOAL: Verify all GUI modules load without crashing."
3856
echo "--------------------------------------"
3957
python -m unittest tests/test_auto_discovery.py
40-
58+
59+
# Test 2: Does the physics logic work?
60+
- name: Run Test 2 - Deep Simulation (Behavior Test)
61+
run: |
4162
echo ""
4263
echo "--------------------------------------"
43-
echo "RUNNING TEST 2: Deep Simulation (Behavior Test)"
64+
echo "GOAL: Verify SCPI commands and hardware protocols."
4465
echo "--------------------------------------"
4566
python -m unittest tests/test_deep_simulation.py
67+
68+
# Test 3: Do the buttons connect to the scripts?
69+
- name: Run Test 3 - Full Stack Simulation (Integration Test)
70+
run: |
4671
echo ""
4772
echo "--------------------------------------"
48-
echo "RUNNING TEST 3: Full Stack Simulation"
73+
echo "GOAL: Verify Launcher buttons and GUI-Backend handoff."
4974
echo "--------------------------------------"
5075
python -m unittest tests/test_full_stack_simulation.py

0 commit comments

Comments
 (0)