As a developer, I want a Git pre-push hook installed to ensure that all tests pass and the code meets the minimum test coverage threshold before pushing changes to the repository. This will help maintain code quality and prevent the integration of untested or poorly tested code.
Acceptance Criteria:
- Pre-Push Hook Installation:
- A Git pre-push hook is installed in the repository that automatically runs before any push action.
- Test Execution:
- The pre-push hook executes the test suite and verifies that all tests pass (i.e., "green" status).
- Coverage Check:
- The pre-push hook checks that the test coverage meets or exceeds a predefined minimum threshold (e.g., 80%).
- Push Prevention:
- If any test fails or the coverage is below the minimum threshold, the push is blocked, and an error message is displayed to the developer.
- Configuration:
- The minimum test coverage threshold should be configurable to allow adjustments as needed.
Tasks:
- Identify the tools and libraries needed for test execution and coverage analysis.
- Write the script for the Git pre-push hook to execute tests and check coverage.
- Configure the script to output meaningful error messages when tests fail or coverage is insufficient.
- Document the setup process for the pre-push hook in the project's README or developer documentation.
- Test the pre-push hook locally and in a shared development environment to ensure reliability
As a developer, I want a Git pre-push hook installed to ensure that all tests pass and the code meets the minimum test coverage threshold before pushing changes to the repository. This will help maintain code quality and prevent the integration of untested or poorly tested code.
Acceptance Criteria:
Tasks: