Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander Whitestone
a2115398d4 fix: smoke workflow JSON parse + add pytest step (closes #742) (closes #743)
Some checks failed
Smoke Test / smoke (pull_request) Failing after 10m8s
2026-04-15 11:11:25 -04:00
3 changed files with 41 additions and 36 deletions

View File

@@ -11,13 +11,43 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Parse check
- name: Parse YAML
run: |
find . -name '*.yml' -o -name '*.yaml' | grep -v .gitea | xargs -r python3 -c "import sys,yaml; [yaml.safe_load(open(f)) for f in sys.argv[1:]]"
find . -name '*.json' | xargs -r python3 -m json.tool > /dev/null
find . -name '*.py' | xargs -r python3 -m py_compile
find . -name '*.sh' | xargs -r bash -n
echo "PASS: All files parse"
set -euo pipefail
find . -name '*.yml' -o -name '*.yaml' | grep -v '\.gitea' | grep -v node_modules | grep -v __pycache__ | grep -v venv | while read -r f; do
echo "Checking $f"
python3 -c "import yaml; yaml.safe_load(open('$f'))"
done
echo "PASS: YAML files parse"
- name: Parse JSON
run: |
set -euo pipefail
find . -name '*.json' -not -path './.git/*' -not -path '*/node_modules/*' -not -path '*/__pycache__/*' -not -path '*/venv/*' | while read -r f; do
echo "Checking $f"
python3 -m json.tool "$f" > /dev/null
done
echo "PASS: JSON files parse"
- name: Parse Python
run: |
set -euo pipefail
find . -name '*.py' -not -path './.git/*' -not -path '*/node_modules/*' -not -path '*/__pycache__/*' -not -path '*/venv/*' | while read -r f; do
echo "Checking $f"
python3 -m py_compile "$f"
done
echo "PASS: Python files parse"
- name: Parse Shell
run: |
set -euo pipefail
find . -name '*.sh' -not -path './.git/*' -not -path '*/node_modules/*' -not -path '*/__pycache__/*' -not -path '*/venv/*' | while read -r f; do
echo "Checking $f"
bash -n "$f"
done
echo "PASS: Shell files parse"
- name: Pytest
run: |
set -euo pipefail
python3 -m pytest tests/ -q --tb=short
echo "PASS: Tests pass"
- name: Secret scan
run: |
if grep -rE 'sk-or-|sk-ant-|ghp_|AKIA' . --include='*.yml' --include='*.py' --include='*.sh' 2>/dev/null | grep -v '.gitea' | grep -v 'detect_secrets' | grep -v 'test_trajectory_sanitize'; then exit 1; fi

View File

@@ -18,15 +18,7 @@ from pathlib import Path
from dataclasses import dataclass
from enum import Enum
# Import from v2 harness to avoid collision with uni-wizard/harness.py
import importlib.util as _iutil
_v2_dir = Path(__file__).parent
_spec = _iutil.spec_from_file_location("harness", _v2_dir / "harness.py")
_mod = _iutil.module_from_spec(_spec)
_spec.loader.exec_module(_mod)
UniWizardHarness = _mod.UniWizardHarness
House = _mod.House
ExecutionResult = _mod.ExecutionResult
from harness import UniWizardHarness, House, ExecutionResult
class TaskType(Enum):

View File

@@ -12,28 +12,11 @@ from pathlib import Path
from datetime import datetime
from typing import Dict, List, Optional
# Explicit imports from v2 directory to avoid namespace collision
# with uni-wizard/harness.py at the repo root level
import importlib.util as _iutil
_v2_dir = Path(__file__).parent
sys.path.insert(0, str(Path(__file__).parent))
def _load_mod(name):
spec = _iutil.spec_from_file_location(name, _v2_dir / f"{name}.py")
mod = _iutil.module_from_spec(spec)
spec.loader.exec_module(mod)
return mod
_harness = _load_mod("harness")
UniWizardHarness = _harness.UniWizardHarness
House = _harness.House
ExecutionResult = _harness.ExecutionResult
_router = _load_mod("router")
HouseRouter = _router.HouseRouter
TaskType = _router.TaskType
_whitelist = _load_mod("author_whitelist")
AuthorWhitelist = _whitelist.AuthorWhitelist
from harness import UniWizardHarness, House, ExecutionResult
from router import HouseRouter, TaskType
from author_whitelist import AuthorWhitelist
class ThreeHouseTaskRouter: