Skip to content

[PM-21079] Add support to integration tests for using sqlserver #5823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented May 15, 2025

🎟️ Tracking

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

📔 Objective

Adds a SqlServerApiApplicationFactory which allows you to run api tests using SqlServer. Currently a new database is create and destroyed for each test. In the future we'd like a more optimized way to do this.

The database logic is abstracted away in a ITestDatabase interface which handles the configuration, migration and teardown.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@Hinton Hinton requested a review from a team as a code owner May 15, 2025 15:39
@Hinton Hinton requested a review from BTreston May 15, 2025 15:39
@Hinton Hinton marked this pull request as draft May 15, 2025 15:43
Copy link
Contributor

github-actions bot commented May 15, 2025

Logo
Checkmarx One – Scan Summary & Details7d2bc155-c190-4cd2-88df-f5d8c0578fdb

New Issues (1)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs: 210
detailsMethod RevokeSponsorship at line 210 of /src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs gets a parameter from a user request fr...
ID: BkM1qiT6IRYGVxsWJH6rlzE9NZo%3D
Attack Vector
Fixed Issues (3)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs: 109
MEDIUM CSRF /src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs: 274
MEDIUM CSRF /src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs: 210

@Hinton Hinton requested a review from eliykat May 26, 2025 14:49
@Hinton Hinton marked this pull request as ready for review May 26, 2025 14:49
Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.59%. Comparing base (828ed74) to head (0a43ae0).
Report is 54 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5823      +/-   ##
==========================================
+ Coverage   47.28%   47.59%   +0.30%     
==========================================
  Files        1645     1663      +18     
  Lines       74703    75260     +557     
  Branches     6724     6764      +40     
==========================================
+ Hits        35325    35819     +494     
- Misses      37921    37976      +55     
- Partials     1457     1465       +8     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

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

Generally looks good, just a few minor questions.

Copy link

@Hinton Hinton requested a review from eliykat May 29, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants