Experiment using Test containers#175
Open
markusrt wants to merge 4 commits into
Open
Conversation
Test containers might be a better solution for integration tests compared to an in-memory DB
|
|
||
| private static readonly MsSqlContainer _dbContainer = new MsSqlBuilder() | ||
| .WithImage("mcr.microsoft.com/mssql/server:2022-latest") | ||
| .WithPassword("Strong_password_123!") |
Check failure
Code scanning / CodeQL
Hard-coded credentials
| { | ||
| _dbContainer.StartAsync().Wait(); | ||
|
|
||
| _factory = new WebApplicationFactory<Program>().WithWebHostBuilder(builder => |
Check warning
Code scanning / CodeQL
Missing Dispose call on local IDisposable
Comment on lines
+67
to
+71
| catch (Exception ex) | ||
| { | ||
| var logger = loggerFactory.CreateLogger<Program>(); | ||
| logger.LogError(ex, "An error occurred seeding the DB."); | ||
| } |
Check notice
Code scanning / CodeQL
Generic catch clause
|
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.



Test containers might be a better solution for integration
tests compared to an in-memory DB