Skip to content

Conversation

@pavelacamposp
Copy link
Owner

This PR splits the ci_workflow job in the CI workflow into code_quality_unit_tests, integration_tests, and coverage_report to reduce the overall CI workflow execution time.

Key changes:

  • Refactored ci_workflow.yml to define the following jobs:
    • code_quality_unit_tests: Executes static typing and linting checks, and unit tests.
    • integration_tests: Executes integration tests with a matrix strategy.
    • coverage_report: Creates the coverage report after test jobs finish their execution.
  • Marked integration tests using pytest markers.

- Add the `lti_integration` and `nonlinear_integration` markers to
  `tool.pytest.ini_options` in `pyproject.toml`.
- Mark the LTI controller integration test with `lti_integration`
  in `test_lti_dd_mpc_integration.py`.
- Mark the nonlinear controller integration test with
  `nonlinear_integration` in `test_nonlinear_dd_mpc_integration.py`.
- Remove mypy ignore comment in
  `nonlinear_data_driven_mpc_controller.py` to prevent mypy
  [unused-ignore] error.
- Move `test_nonlinear_system_model` from
  `test_nonlinear_dd_mpc_integration.py` to `tests/conftest.py` and
  define it as a pytest fixture.
- Update `test_nonlinear_dd_mpc_integration` to use
  `test_nonlinear_system_model` as a fixture.

This prevents pytest from considering `test_nonlinear_system_model`
as a test function when running unmarked tests (unit tests), causing
the error "Failed: Expected None, but test returned..."
- Split `ci_workflow` job into `code_quality_unit_tests`,
  `integration_tests`, and `coverage_report` to reduce the overall
  CI execution time.
- Reintroduce `# type: ignore[assignment]` comment in
  `nonlinear_data_driven_mpc_controller.py` to prevent mypy
  `[assignment]` errors during CI workflow executions. This was
  previously removed in 1d09f0a after mypy reported it as
  unnecessary, raising an `[unused-ignore]` error.
- Remove `warn_unused_ignores = true` from `pyproject.toml`
  to avoid false positives in local static checks.
Add `include-hidden-files: true` to coverage file upload steps that
use the `upload-artifact` action to ensure `.coverage.*` files
(hidden by default) are correctly uploaded during test executions.
Add a checkout step to the `coverage_report` job to avoid coverage
errors related to missing source code for tests during coverage
report generation.
@pavelacamposp
Copy link
Owner Author

All checks have passed and the CI workflow execution time has improved. Merging now.

@pavelacamposp pavelacamposp merged commit 1cfc511 into main Jun 4, 2025
4 checks passed
@pavelacamposp pavelacamposp deleted the chore/parallelize-ci-testing branch June 4, 2025 12:20
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