Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Stripe integration tests#7828

Open
justindbaur wants to merge 4 commits into
mainfrom
stripe-integration-tests
Open

Stripe integration tests#7828
justindbaur wants to merge 4 commits into
mainfrom
stripe-integration-tests

Conversation

@justindbaur

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-36225

📔 Objective

This is a test and documentation only PR that exists to expand (haha) our test coverage on our usage of Expand on Stripe API calls. These tests run flows with those against the genuine Stripe API so it should catch discrepancies between the strings in those Expand call sites and the consumption of that data in C# properties. The tests require a test stripe API key and for that reason they currently do not run in CI and therefore do have a danger of becoming stale but I believe they have an incredible value. I ran these tests against the Stripe update being prepared in #7643 and it found 5 issues already.

📸 Screenshots

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed this test-and-documentation-only PR adding opt-in Stripe integration tests under test/Billing.IntegrationTest/, the supporting application factories/fixtures, the StripeEnabled toggle in WebApplicationFactoryBase, the new AssertExtensions.SuccessResponseAsync helper, and the integration-test docs. The tests are gated behind BillingFactAttribute (run only when RUN_STRIPE_INTEGRATION_TESTS is set), so adding the project to the solution does not affect CI. No security, correctness, or breaking-change concerns were found.

Code Review Details

No findings.

Notes considered and cleared:

  • The webhook secret (whsec_billing_integration_test_secret_value) is a clearly-fake test constant; the Stripe API key is sourced from configuration/user-secrets, not hardcoded.
  • The WebApplicationFactoryBase change is additive and gated — StripeEnabled defaults to false, so existing tests retain the substituted Stripe services and behavior is unchanged.
  • packages.lock.json is the generated lock for the new test project; all references reuse existing version variables, so no new dependencies are introduced.
  • Shared-database parallelism is handled via per-test unique emails and coupon ids.

Comment thread test/Billing.IntegrationTest/AdminApplicationFactory.cs Dismissed
Comment thread test/Billing.IntegrationTest/AdminApplicationFactory.cs Dismissed
Comment thread test/Billing.IntegrationTest/AdminApplicationFactory.cs Dismissed
Comment thread test/Billing.IntegrationTest/BillingApplicationFactory.cs Dismissed
Comment thread test/Billing.IntegrationTest/BillingApplicationFactory.cs Dismissed
Comment thread test/Billing.IntegrationTest/IdentityApplicationFactoryExtensions.cs Dismissed
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.22%. Comparing base (0911d1f) to head (10a159f).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7828      +/-   ##
==========================================
+ Coverage   61.13%   61.22%   +0.08%     
==========================================
  Files        2173     2209      +36     
  Lines       96752    97716     +964     
  Branches     8726     8815      +89     
==========================================
+ Hits        59149    59825     +676     
- Misses      35491    35767     +276     
- Partials     2112     2124      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justindbaur justindbaur requested a review from a team as a code owner June 17, 2026 14:58
@justindbaur justindbaur requested review from a team and sbrown-livefront and removed request for a team June 17, 2026 14:58
@sonarqubecloud

Copy link
Copy Markdown

@eliykat eliykat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving CODEOWNERS change only. Billing Team should still review.
EDIT: applying the hold label in the meantime - please feel free to remove when ready.

@eliykat eliykat added the hold Hold this PR or item until later; DO NOT MERGE label Jun 18, 2026
@theMickster

Copy link
Copy Markdown
Contributor

Hey @justindbaur... Quick 💡, will you please put a CLAUDE.md alongside the README.md in the root of the new test project?
I think that will setup the Billing team for even more success to have Claude Code ready to help them with all the joy misery of Stripe testing 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Hold this PR or item until later; DO NOT MERGE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants