test(cost_report): add wiremock integration coverage for the exported handler#88
Merged
Merged
Conversation
… handler `CostReportHandler` is publicly exported and on the OpenAPI spec, but previously had only crate-internal unit tests for the request builder shape. A type-shape regression on `/cost-report` or its download endpoint would slip past CI. Adds `tests/cost_report_tests.rs` covering: - `generate_cost_report` happy path with body-assertion - `generate_cost_report` with the full filter surface (formats, subscription_ids, database_ids, subscription_type, regions, tag) - `generate_cost_report_raw` returning JSON Value (extra fields preserved) - `generate_cost_report` 400 / 401 / 500 error paths - `download_cost_report` happy path returning the byte stream - `download_cost_report` 404 and 503 error paths Total: 9 new tests, all green. Closes #79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CostReportHandleris publicly exported and on the OpenAPI spec, but previously had only crate-internal unit tests covering the request builder. A type-shape regression on/cost-report(POST) or its download endpoint would slip past CI.Adds
tests/cost_report_tests.rswith 9 tests covering happy + error paths for both endpoints.Coverage matrix added
generate_cost_reportbody_jsongenerate_cost_report_rawdownload_cost_reportTest plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— all pass; 9 new tests greenNo source changes.
Closes #79