Skip to content

Commit e9955b0

Browse files
committed
refactor: remove AI enforcement integration tests and SKIP_AI_ENFORCEMENT env var
Remove the AI enforcement test suite that was attempting to force AI agents to run pre-commit checks. The approach was ineffective because AI agents typically run 'cargo test --lib', which skips integration tests. Changes: - Delete tests/ai_enforcement.rs (entire test module) - Remove SKIP_AI_ENFORCEMENT from .github/workflows/testing.yml - Remove SKIP_AI_ENFORCEMENT from .github/workflows/coverage.yml - Delete docs/contributing/testing/pre-commit-integration.md - Remove pre-commit-integration reference from docs/contributing/testing/README.md - Remove SKIP_AI_ENFORCEMENT section from docs/contributing/testing/coverage.md Alternative approaches like Git hooks should be investigated for enforcing pre-commit checks with remote AI agents.
1 parent b480ed8 commit e9955b0

File tree

6 files changed

+7
-293
lines changed

6 files changed

+7
-293
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,10 @@ jobs:
3636

3737
- id: coverage-text
3838
name: Generate Text Coverage Summary
39-
env:
40-
SKIP_AI_ENFORCEMENT: 1
4139
run: cargo cov
4240

4341
- id: coverage-html
4442
name: Generate HTML Coverage Report
45-
env:
46-
SKIP_AI_ENFORCEMENT: 1
4743
run: cargo cov-html
4844

4945
- id: upload-coverage

.github/workflows/testing.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,4 @@ jobs:
140140

141141
- id: test
142142
name: Run Unit Tests
143-
env:
144-
SKIP_AI_ENFORCEMENT: 1
145143
run: cargo test --tests --benches --examples --workspace --all-targets --all-features

docs/contributing/testing/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ This section provides links to specialized testing documentation organized by to
173173
- **[Resource Management](./resource-management.md)** - TempDir usage, test isolation, cleanup
174174
- **[Testing Commands](./testing-commands.md)** - Command test patterns, builders, mocks, E2E
175175
- **[Clock Service](./clock-service.md)** - MockClock usage for deterministic time tests
176-
- **[Pre-commit Integration](./pre-commit-integration.md)** - AI enforcement tests, SKIP_AI_ENFORCEMENT flag
177176
- **[Coverage](./coverage.md)** - Code coverage targets, tools, CI/CD workflow, and PR guidelines
178177

179178
## 🔗 Related Documentation

docs/contributing/testing/coverage.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ This shows coverage statistics in the terminal without generating files.
176176

177177
All coverage commands use cargo aliases defined in `.cargo/config.toml`:
178178

179-
| Alias | Full Command | Purpose |
180-
|-------|--------------|---------|
181-
| `cargo cov` | `cargo llvm-cov` | Basic coverage report in terminal |
182-
| `cargo cov-check` | `cargo llvm-cov --all-features --workspace --fail-under-lines 85` | Validate 85% threshold |
183-
| `cargo cov-lcov` | `cargo llvm-cov --lcov --output-path=./.coverage/lcov.info` | Generate LCOV format |
184-
| `cargo cov-codecov` | `cargo llvm-cov --codecov --output-path=./.coverage/codecov.json` | Generate Codecov JSON |
185-
| `cargo cov-html` | `cargo llvm-cov --html` | Generate HTML report |
179+
| Alias | Full Command | Purpose |
180+
| ------------------- | ----------------------------------------------------------------- | --------------------------------- |
181+
| `cargo cov` | `cargo llvm-cov` | Basic coverage report in terminal |
182+
| `cargo cov-check` | `cargo llvm-cov --all-features --workspace --fail-under-lines 85` | Validate 85% threshold |
183+
| `cargo cov-lcov` | `cargo llvm-cov --lcov --output-path=./.coverage/lcov.info` | Generate LCOV format |
184+
| `cargo cov-codecov` | `cargo llvm-cov --codecov --output-path=./.coverage/codecov.json` | Generate Codecov JSON |
185+
| `cargo cov-html` | `cargo llvm-cov --html` | Generate HTML report |
186186

187187
## 🚨 Pre-commit Coverage Check
188188

@@ -273,12 +273,6 @@ The workflow generates coverage in multiple formats:
273273
- Upload HTML report as GitHub Actions artifact
274274
```
275275
276-
### Environment Variables
277-
278-
The workflow sets:
279-
280-
- `SKIP_AI_ENFORCEMENT=1` - Disables AI-related test enforcement during coverage runs
281-
282276
### Accessing Coverage Reports
283277
284278
#### From GitHub Actions UI

docs/contributing/testing/pre-commit-integration.md

Lines changed: 0 additions & 69 deletions
This file was deleted.

tests/ai_enforcement.rs

Lines changed: 0 additions & 204 deletions
This file was deleted.

0 commit comments

Comments
 (0)