sadpandajoe opened a new pull request, #38591:
URL: https://github.com/apache/superset/pull/38591
### SUMMARY
Adds comprehensive test coverage for alert/report code paths that were
previously untested. This is a test-only PR — no production code changes.
**Backend (pytest):**
- `execute.py` state machine: success/error/grace-period transitions,
`AlertCommand` error branch, `send()` error branch, working-state timeout
- `execute.py` notification content: PNG, CSV, TEXT, and PDF format
branches, empty-screenshot fallback, notification name resolution
- `execute.py` URL generation: dashboard permalink with filters+tabs,
no-state fallback to standard URL, tab URL construction
- `execute.py` internals: `_update_query_context` screenshot error wrapping,
`create_log` stale-data rollback
- `create`/`update` commands: `_validate_report_extra` tab validation
(valid, invalid, null), database field enforcement, ownership checks,
deactivation state reset
- Report model: `get_native_filters_params` (single, multiple, empty, null,
invalid, rison escaping), `_generate_native_filter` for all filter types
(select, time, timegrain, timecolumn, range)
- Schemas: `custom_width` boundary values, `working_timeout` POST vs PUT,
`log_retention` parity, report-type database rejection
**Frontend (Jest + RTL):**
- `AlertReportModal`: dashboard/chart switching, tab selector
enable/disable, filter/tab state reset on dashboard change, cron scheduler
interaction, report format selection, working-timeout field rendering,
invalid-anchor error handling
- `AlertReportCronScheduler`: timezone display, preset selection
- `NumberInput`: value changes, min/max enforcement
- `ReportModal`: report creation/editing flows, error handling
- `actions.ts`: all async action creators with success/error paths
- `reducer.ts`: state transitions for all action types
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — test-only changes
### TESTING INSTRUCTIONS
```bash
# Backend
pytest tests/unit_tests/commands/report/ tests/unit_tests/reports/ -v
# Frontend
npx jest --config superset-frontend/jest.config.ts \
superset-frontend/src/features/alerts/AlertReportModal.test.tsx \
superset-frontend/src/features/reports/ReportModal/
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]