Stirling-PDF
Stirling-PDF copied to clipboard
ci(test): add Swagger endpoint tests workflow & runner; integrate into `test.sh`; refine OpenAPI request annotations
Description of Changes
- CI workflow: Introduces
Swagger Endpoint TestsGitHub Actions workflow with a tag matrix, hardened runner, Java/Gradle/Python setup, app build/start, readiness wait on/v1/api-docs, and test execution via the new runner. - Integration test runner: Adds
testing/swagger_endpoint_test.pyto exercise OpenAPI endpoints with parallelism, retries, strict/lenient mode, tag/path filters, dynamic request generation (JSON, multipart, form, binary), and sensible skips. Includes file-type heuristics for sample uploads (PDF, images, CBZ/CBR, certs). - Sample assets for CI: Adds representative fixtures (
sample.cbz,sample.cbr, chaptered PDF, README PDF, markdown) to support upload endpoints. - Hook maintenance: Bumps pre-commit hooks:
ruff-pre-commitfromv0.12.7→v0.13.3pre-commit-hooksfromv5.0.0→v6.0.0
- Local test pipeline: Extends
testing/test.shto run Swagger endpoint tests against a local instance. - OpenAPI accuracy & DX:
- Adds/updates request body metadata (e.g.,
contentMediaType,format, explicitapplication/pdf) for CBZ/CBR and PDF converters. - Sets a default value for redaction padding for clearer docs and generated clients.
- Expands
ConvertWebsiteToPDFcontrollerconsumesto also acceptapplication/x-www-form-urlencoded. - Documents
500response for Admin Settings retrieval endpoint.
- Adds/updates request body metadata (e.g.,
Why the change was made
- Increase confidence that documented endpoints are live and behave as described (contract tests against the OpenAPI spec).
- Catch regressions early in CI with fast feedback and actionable logs.
- Improve client generation fidelity by enriching schema annotations and defaults.
- Provide deterministic sample data for upload-heavy endpoints.
- Harden CI runners and make the suite reproducible locally and in CI.
Checklist
General
- [x] I have read the Contribution Guidelines
- [x] I have read the Stirling-PDF Developer Guide (if applicable)
- [ ] I have read the How to add new languages to Stirling-PDF (if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings
Documentation
- [ ] I have updated relevant docs on Stirling-PDF's doc repo (if functionality has heavily changed)
- [ ] I have read the section Add New Translation Tags (for new translation tags only)
UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)
Testing (if applicable)
- [ ] I have tested my changes locally. Refer to the Testing Guide for more details.
will merge after build passes again, prob need to add to our docs somewhere about this needing to get updated for new endpoints etc
/prdeploy
🚀 PR Test Deployment
Your PR has been deployed for testing!
🔗 Test URL: http://185.252.234.121:4613 Security Disabled
This deployment will be automatically cleaned up when the PR is closed.