Skip to content

Add comprehensive CI workflow and fix all tests#14

Merged
PaulHax merged 3 commits intomainfrom
fix-tests
Jul 14, 2025
Merged

Add comprehensive CI workflow and fix all tests#14
PaulHax merged 3 commits intomainfrom
fix-tests

Conversation

@PaulHax
Copy link
Collaborator

@PaulHax PaulHax commented Jul 13, 2025

Summary

  • Add comprehensive GitHub Actions workflow for lint and tests
  • Fix all failing tests and improve test performance
  • Add Playwright browser testing with screenshots
  • Implement parallel test execution for faster CI

Changes Made

CI/CD Infrastructure

  • New workflow: .github/workflows/lint-tests.yml
  • Matrix testing: Python 3.10, 3.11, 3.12
  • Comprehensive checks: ruff linting, formatting, all tests
  • Playwright integration: Frontend testing with screenshot capture
  • Build verification: Package build and artifact upload
  • Local script: scripts/test-ci.sh for development

Test Infrastructure Improvements

  • Refactored fixtures: Reuse build system in dev mode
  • Performance optimized: Reduced test runtime from ~22s to ~9s
  • Parallel execution: Added pytest-xdist for concurrent testing
  • Headless browser: Faster Playwright execution
  • Smart waits: Replaced fixed timeouts with conditional waits

Test Fixes

  • All 43 tests passing: Fixed timeout and compatibility issues
  • Dynamic test data: Tests adapt to available ADM options
  • Real data support: Graceful handling when experiment data unavailable
  • Cross-browser ready: Playwright setup for multiple browsers

Code Quality

  • Ruff compliance: Fixed all linting issues
  • Proper formatting: Applied consistent code style
  • Removed unused code: Cleaned up commented and dead code
  • Pydantic updates: Fixed deprecation warnings

Test Coverage

  • Unit tests: Core functionality and data models
  • Integration tests: Build system and experiment parsing
  • Frontend tests: UI interactions and browser automation
  • Real data tests: Integration with actual experiment data

Performance Improvements

  • 9 seconds: Sequential test execution (down from 22s)
  • 4 seconds: Parallel test execution with -n auto
  • Optimized waits: Smart element detection instead of fixed delays
  • Cached fixtures: Reuse test data generation across tests

Quality Assurance

  • Zero warnings: Clean pytest and ruff output
  • All browsers: Tested with Chromium, ready for Firefox/Safari
  • Responsive testing: Mobile and tablet viewport validation
  • Error capture: Screenshots saved on test failures

PaulHax added 2 commits July 13, 2025 16:19
- Extract reusable build_frontend() function from main()
- Refactor test fixtures to use build system instead of duplicating logic
- Fix test data generation to match Pydantic model expectations
- Add gitignore for test data directory
- Rename built_frontend fixture to frontend_with_test_data for clarity
- Eliminate 40+ lines of duplicated build logic in tests
- Maintain dev mode approach (no build step required for tests)
- All core functionality tests now pass (29/49 total)

Tests now use the same build process as production, ensuring consistency
and maintainability while running much faster without build requirements.
- Add lint-tests.yml workflow for GitHub Actions
- Run on all branches with Python 3.10, 3.11, 3.12 matrix
- Include ruff linting, formatting checks, and all tests
- Add Playwright frontend testing with screenshot capture
- Add build verification and artifact upload
- Include local test-ci.sh script for development
- Use fixed temp directory path instead of random mkdtemp()
- Use deterministic timestamp during tests (PYTEST_CURRENT_TEST env var)
- Fix test_scenario_based_kdma_filtering to use dynamic ADM selection
- Clean existing test data to ensure fresh, consistent state

This eliminates all sources of randomness that caused CI failures
when tests passed locally but failed in different environments.
All 43 tests now pass consistently with identical test data.
@PaulHax PaulHax merged commit e72fff3 into main Jul 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant