Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

ci(test): add Swagger endpoint tests workflow & runner; integrate into `test.sh`; refine OpenAPI request annotations

Open Ludy87 opened this issue 2 months ago • 1 comments

Description of Changes

  • CI workflow: Introduces Swagger Endpoint Tests GitHub 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.py to 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-commit from v0.12.7v0.13.3
    • pre-commit-hooks from v5.0.0v6.0.0
  • Local test pipeline: Extends testing/test.sh to run Swagger endpoint tests against a local instance.
  • OpenAPI accuracy & DX:
    • Adds/updates request body metadata (e.g., contentMediaType, format, explicit application/pdf) for CBZ/CBR and PDF converters.
    • Sets a default value for redaction padding for clearer docs and generated clients.
    • Expands ConvertWebsiteToPDF controller consumes to also accept application/x-www-form-urlencoded.
    • Documents 500 response for Admin Settings retrieval endpoint.

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

Documentation

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.

Ludy87 avatar Oct 05 '25 10:10 Ludy87

will merge after build passes again, prob need to add to our docs somewhere about this needing to get updated for new endpoints etc

Frooodle avatar Nov 12 '25 12:11 Frooodle

/prdeploy

Ludy87 avatar Nov 28 '25 19:11 Ludy87

🚀 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.

stirlingbot[bot] avatar Nov 28 '25 20:11 stirlingbot[bot]