test: add test fixtures with sample payloads and config #195

Merged
fuzzy merged 2 commits from test/add-test-fixtures into main 2026-07-06 10:27:59 +00:00
Owner

What

Add test fixtures in test/testdata/:

  • 5 sample Forgejo webhook payloads (#122):
    • payload-push.json — push event with commits, repository, pusher
    • payload-issues.json — issue opened event
    • payload-pull_request.json — PR opened event
    • payload-release.json — release published event
    • payload-check_suite.json — CI workflow completed event
  • Test config config-all-rules.yaml exercising (#124):
    • All 5 condition operators: eq, ne, contains, matches, exists
    • All 3 template functions: json, timestamp, quote
    • Timeout configuration
    • Retry configuration
    • Multiple actions per rule

Why

Realistic test data for manual testing, integration tests, and the rule testing CLI. Payloads match actual Forgejo webhook structure.

Testing

  • Unit tests pass — all existing tests pass
  • Integration tests pass — N/A
  • Manual testing performed — go test ./... and pre-commit pass
  • New tests added for new functionality — N/A (fixtures only)

Breaking Changes

None.

Closes #125
Closes #122
Closes #123
Closes #124

## What Add test fixtures in `test/testdata/`: - 5 sample Forgejo webhook payloads (#122): - `payload-push.json` — push event with commits, repository, pusher - `payload-issues.json` — issue opened event - `payload-pull_request.json` — PR opened event - `payload-release.json` — release published event - `payload-check_suite.json` — CI workflow completed event - Test config `config-all-rules.yaml` exercising (#124): - All 5 condition operators: eq, ne, contains, matches, exists - All 3 template functions: json, timestamp, quote - Timeout configuration - Retry configuration - Multiple actions per rule ## Why Realistic test data for manual testing, integration tests, and the rule testing CLI. Payloads match actual Forgejo webhook structure. ## Testing - [x] Unit tests pass — all existing tests pass - [ ] Integration tests pass — N/A - [x] Manual testing performed — `go test ./...` and pre-commit pass - [ ] New tests added for new functionality — N/A (fixtures only) ## Breaking Changes None. Closes #125 Closes #122 Closes #123 Closes #124
Sample Forgejo webhook payloads for:
- push events
- issues events
- pull_request events
- release events
- check_suite events

Test config exercises all rule types:
- All 5 condition operators (eq, ne, contains, matches, exists)
- All 3 template functions (json, timestamp, quote)
- Timeout and retry configuration
- Multiple actions per rule

Closes #122
Closes #123
Closes #124
docs: mark Add test fixtures tasks as complete
Some checks failed
CI / Lint (golangci-lint) (pull_request) Successful in 1m35s
CI / Test (pull_request) Successful in 1m37s
CI / Pre-commit Hooks (pull_request) Successful in 4m45s
CI / Test (push) Successful in 1m41s
CI / Lint (golangci-lint) (push) Successful in 1m46s
CI / Pre-commit Hooks (push) Has been cancelled
cee6af782b
Closes #125
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-06 10:23:59 +00:00
the.auditor left a comment

Review

Clean test fixtures. All JSON and YAML valid.

Payloads: 5 realistic Forgejo webhook payloads covering push, issues, pull_request, release, check_suite events. Each includes proper repository, sender, and event-specific fields matching actual Forgejo format.

Test config (config-all-rules.yaml): 6 rules exercising all 5 condition operators (eq, ne, contains, matches, exists), all 3 template functions (json, timestamp, quote), timeout configuration, retry, and multiple actions per rule.

ROADMAP.md: Updated.

No blocking issues.

APPROVED

## Review Clean test fixtures. All JSON and YAML valid. **Payloads**: 5 realistic Forgejo webhook payloads covering push, issues, pull_request, release, check_suite events. Each includes proper `repository`, `sender`, and event-specific fields matching actual Forgejo format. **Test config** (`config-all-rules.yaml`): 6 rules exercising all 5 condition operators (eq, ne, contains, matches, exists), all 3 template functions (json, timestamp, quote), timeout configuration, retry, and multiple actions per rule. **ROADMAP.md**: Updated. **No blocking issues.** **APPROVED**
fuzzy merged commit cee6af782b into main 2026-07-06 10:27:59 +00:00
fuzzy deleted branch test/add-test-fixtures 2026-07-06 10:28:00 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/ttheart!195
No description provided.