Skip to content

Update test_full_stack_simulation.py #31

Update test_full_stack_simulation.py

Update test_full_stack_simulation.py #31

Workflow file for this run

name: Run PICA JOSS Tests
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------------------
# PHASE 1: SETUP
# ------------------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
# Install PICA in editable mode so tests can find your source code
pip install -e .
# Install Testing & Linting tools
pip install pytest flake8
# ------------------------------------------------------------------------
# PHASE 2: READYMADE TESTS (Standard Industry Checks)
# ------------------------------------------------------------------------
- name: Run Style & Syntax Check (Flake8)
run: |
echo "STEP 1: Checking for critical syntax errors..."
# This stops the build if there are actual Python syntax errors (E9, F63, etc.)
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
echo "STEP 2: Checking for code style warnings..."
# This just warns you about messy code (long lines, unused imports) but won't fail the build
# 'exit-zero' ensures your test passes even if your style isn't perfect
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# ------------------------------------------------------------------------
# PHASE 3: YOUR CUSTOM TESTS (The "Three Pillars")
# ------------------------------------------------------------------------
# Test 1: Does the code exist and import correctly?
- name: Run Test 1 - Auto-Discovery (Smoke Test)
run: |
echo "--------------------------------------"
echo "GOAL: Verify all GUI modules load without crashing."
echo "--------------------------------------"
python -m unittest tests/test_auto_discovery.py
# Test 2: Does the physics logic work?
- name: Run Test 2 - Deep Simulation (Behavior Test)
run: |
echo ""
echo "--------------------------------------"
echo "GOAL: Verify SCPI commands and hardware protocols."
echo "--------------------------------------"
python -m unittest tests/test_deep_simulation.py
# Test 3: Do the buttons connect to the scripts?
- name: Run Test 3 - Full Stack Simulation (Integration Test)
run: |
echo ""
echo "--------------------------------------"
echo "GOAL: Verify Launcher buttons and GUI-Backend handoff."
echo "--------------------------------------"
python -m unittest tests/test_full_stack_simulation.py