Cursor unit-test-runner rule
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d152047fe1
commit
9e1b8f4570
37
.cursor/rules/unit-test-runner.mdc
Normal file
37
.cursor/rules/unit-test-runner.mdc
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
description: Unit test runner definition and run-tests-on-commit instruction
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Unit Test Runner and Commit Workflow
|
||||
|
||||
## Unit Test Runner
|
||||
|
||||
This project uses **Maven** to run unit tests (JUnit 5).
|
||||
|
||||
- **Command**: `mvn test`
|
||||
- **Scope**: Runs all tests in `src/test/java` (and `src/main/java` test sources as configured in pom.xml). Excludes integration tests unless a profile is used.
|
||||
- **Integration tests** (optional): `mvn test -P integration` when you need to run integration tests.
|
||||
|
||||
When the agent runs tests, it must use:
|
||||
|
||||
```bash
|
||||
mvn test
|
||||
```
|
||||
|
||||
from the project root (`Renderer`). Ensure Maven is available and the project builds before running tests.
|
||||
|
||||
## Run Tests on Every Commit
|
||||
|
||||
Whenever the agent **commits code** (via git commit, or when the user asks to commit):
|
||||
|
||||
1. **Before committing**: Run the unit test runner (`mvn test`) from the project root.
|
||||
2. If tests **fail**, do not commit. Report the failures and fix or revert the changes.
|
||||
3. If tests **pass**, proceed with the commit.
|
||||
|
||||
If the user explicitly asks to commit without running tests (e.g. "commit anyway" or "skip tests"), you may skip this step only when they clearly request it.
|
||||
|
||||
## Summary
|
||||
|
||||
- **Test command**: `mvn test` (project root)
|
||||
- **Rule**: Run `mvn test` before every commit; block commit on failure unless the user asks to skip.
|
||||
Loading…
Reference in New Issue
Block a user