From 6b4e9015744ab8c9f17a6b8e23387cd676b1d827 Mon Sep 17 00:00:00 2001 From: roberto berto Date: Sun, 2 Nov 2025 22:54:44 +0000 Subject: feat: v0.4.0 - Architecture refactor, bug fixes, and quality improvements - Fixed #25: config_file_save/load now include path: [] in payload - Added exception hierarchy (SDKError, HttpError, ApiError, ValidationError) - Added utility functions (json, ids, paths) - Added structured logging with request ID tracking - Added optional Pydantic validation models - Refactored to pyvyos.core.* structure with backward compatibility shims - Moved JSON specs to docs/development/vyos_api/ - Added comprehensive test suite (19 shim tests, 16 utils tests, 6 exception tests) - Updated pyproject.toml for uv sync editable installation - Added development documentation (architecture, roadmap, quality guidelines) Maintains 100% backward compatibility with 0.3.0 --- run_tests.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 run_tests.py (limited to 'run_tests.py') diff --git a/run_tests.py b/run_tests.py new file mode 100644 index 0000000..e09886e --- /dev/null +++ b/run_tests.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +"""Script para executar todos os testes e validar a instalação.""" + +import subprocess +import sys + + +def run_command(cmd, description): + """Executa um comando e mostra o resultado.""" + print(f"\n{'='*60}") + print(f"{description}") + print(f"{'='*60}") + try: + result = subprocess.run( + cmd, shell=True, check=True, capture_output=True, text=True + ) + print(result.stdout) + if result.stderr: + print("STDERR:", result.stderr) + return True + except subprocess.CalledProcessError as e: + print(f"ERRO: {e}") + print("STDOUT:", e.stdout) + print("STDERR:", e.stderr) + return False + + +def main(): + """Executa todos os testes.""" + print("=== PyVyOS Test Suite ===\n") + + steps = [ + ("uv sync", "1. Sincronizando dependências"), + ("uv run python test_quick.py", "2. Verificação rápida de imports"), + ("uv run pytest tests/test_shims.py -v", "3. Testes de shims"), + ("uv run pytest tests/utils/ -v", "4. Testes de utils"), + ("uv run pytest tests/test_exceptions.py -v", "5. Testes de exceptions"), + ( + "uv run pytest tests/modules/test_vy_device.py::test_shim_compatibility -v", + "6. Teste de compatibilidade", + ), + ("uv run pytest tests/ -v --tb=short", "7. TODOS os testes"), + ] + + results = [] + for cmd, desc in steps: + success = run_command(cmd, desc) + results.append((desc, success)) + if not success: + print(f"\n❌ Falha em: {desc}") + sys.exit(1) + + print(f"\n{'='*60}") + print("✅ TODOS OS TESTES PASSARAM!") + print(f"{'='*60}\n") + + for desc, success in results: + status = "✅" if success else "❌" + print(f"{status} {desc}") + + +if __name__ == "__main__": + main() + -- cgit v1.2.3