Skip to content

chore(ci): Enable automatic test discovery in pipeline #90

@finxo

Description

@finxo

Summary

Refactor the CI/CD pipeline to use pytest's automatic test discovery, ensuring all tests are executed without manual configuration.

Description

The "Run tests" step in our .github/workflows/ci.yml workflow currently specifies explicit, hardcoded paths for test directories. This manual approach has several drawbacks:

  1. Incomplete Coverage: There is a risk that not all test suites are being executed, as new tests might be added without updating the CI file.
  2. Maintenance Overhead: Whenever a new plugin with tests is added, the ci.yml file must be manually updated. Forgetting this step results in the new plugin's tests not being run in the pipeline.
  3. Scalability Issues: As the number of plugins grows, the list of test paths will become long and difficult to manage.

To resolve this, the workflow should be modified to use pytest's automatic test discovery feature. By running poetry run pytest from the project root, pytest will automatically scan all directories for test files (e.g., test_*.py), ensuring all tests are reliably and automatically executed.

Objectives

  • Improve CI reliability by ensuring all tests are automatically discovered and executed.
  • Reduce maintenance overhead by eliminating the need to manually update test paths for new plugins.
  • Simplify the CI workflow configuration for test execution.

Category

CI/CD configuration

Tasks

  • Modify the ci.yml workflow to replace the multi-line test commands with a single command that leverages pytest's auto-discovery.
  • Confirm that a CI run successfully discovers and executes tests from the main tests/ directory and all plugin subdirectories.
  • Ensure the solution is scalable and automatically includes tests from any new plugins without requiring further changes to ci.yml.

Considerations (Optional)

N/A

Configuration Changes (Optional)

The following change should be made to .github/workflows/ci.yml:

# .github/workflows/ci.yml
- name: Run tests
-  run: |
-    poetry run pytest tests/ plugins/titan-plugin-git/tests/
-    poetry run pytest plugins/titan-plugin-jira/tests/
+ name: Run tests
+  run: poetry run pytest

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance tasks (dependencies, configs, CI/CD)maintenanceGeneral maintenance and housekeeping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions