Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
chore(deps): update for .NET 8.0.200 release (#625)
Browse files Browse the repository at this point in the history
The package versions for `Microsoft.AspNetCore.Mvc.Testing`,
`Microsoft.EntityFrameworkCore.Design`, and
`Microsoft.EntityFrameworkCore.SqlServer` were updated to `8.0.2`. Also,
the .NET SDK version was updated in `global.json`.

In addition, the base image for the database container used in the
integration tests has been switched to `azure-sql-edge` and the setup no
longer contains a manually assigned password.
  • Loading branch information
ThorstenSauter committed Feb 13, 2024
1 parent 581d01e commit 7a7112e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageVersion Include="FastEndpoints" Version="5.22.0"/>
<PackageVersion Include="FastEndpoints.Generator" Version="5.22.0"/>
<PackageVersion Include="FluentAssertions" Version="6.12.0"/>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.1"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1"/>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.2"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.2"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2"/>
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1"/>
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.59.0"/>
<PackageVersion Include="Microsoft.Identity.Web" Version="2.17.0"/>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0.101"
"version": "8.0.200"
}
}
35 changes: 19 additions & 16 deletions tests/NoPlan.Api.Tests.Integration/NoPlanApiFactory.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -18,7 +17,7 @@ namespace NoPlan.Api.Tests.Integration;
public class NoPlanApiFactory : WebApplicationFactory<IApiMarker>, IAsyncLifetime
{
private readonly MsSqlContainer _dbContainer = new MsSqlBuilder()
.WithPassword("ReallyComplicated01!")
.WithImage("mcr.microsoft.com/azure-sql-edge:latest")
.Build();

private readonly UserAuthenticationSettings _userAuthenticationSettings = new();
Expand Down Expand Up @@ -48,16 +47,18 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.ConfigureLogging(logging => logging.ClearProviders());

var connectionString = new SqlConnectionStringBuilder(_dbContainer.GetConnectionString()) { Encrypt = false, InitialCatalog = "noplan" }
.ToString();
var connectionString = _dbContainer.GetConnectionString();

builder.ConfigureAppConfiguration(
configBuilder =>
{
Environment.SetEnvironmentVariable(
"APPLICATIONINSIGHTS_CONNECTION_STRING",
"InstrumentationKey=00000000-0000-0000-0000-000000000000;");
configBuilder.AddInMemoryCollection(new Dictionary<string, string?> { { "ConnectionStrings:Default", connectionString } });
configBuilder.AddInMemoryCollection(
new Dictionary<string, string?> { { "ConnectionStrings:Default", connectionString } });
configBuilder.AddUserSecrets<NoPlanApiFactory>();
configBuilder.AddEnvironmentVariables();
Expand Down Expand Up @@ -108,17 +109,19 @@ private async Task AuthenticateClientAsUserAsync(HttpClient client)

private async Task<IPublicClientApplication> CreatePublicClientApplicationAsync()
{
var storageCreationProperties = new StorageCreationPropertiesBuilder(TokenCacheConfiguration.CacheFileName, TokenCacheConfiguration.CacheDir)
.WithLinuxKeyring(
TokenCacheConfiguration.LinuxKeyRingSchema,
TokenCacheConfiguration.LinuxKeyRingCollection,
TokenCacheConfiguration.LinuxKeyRingLabel,
TokenCacheConfiguration.LinuxKeyRingAttr1,
TokenCacheConfiguration.LinuxKeyRingAttr2)
.WithMacKeyChain(
TokenCacheConfiguration.KeyChainServiceName,
TokenCacheConfiguration.KeyChainAccountName)
.Build();
var storageCreationProperties =
new StorageCreationPropertiesBuilder(TokenCacheConfiguration.CacheFileName,
TokenCacheConfiguration.CacheDir)
.WithLinuxKeyring(
TokenCacheConfiguration.LinuxKeyRingSchema,
TokenCacheConfiguration.LinuxKeyRingCollection,
TokenCacheConfiguration.LinuxKeyRingLabel,
TokenCacheConfiguration.LinuxKeyRingAttr1,
TokenCacheConfiguration.LinuxKeyRingAttr2)
.WithMacKeyChain(
TokenCacheConfiguration.KeyChainServiceName,
TokenCacheConfiguration.KeyChainAccountName)
.Build();

var publicClientApplication = PublicClientApplicationBuilder.CreateWithApplicationOptions(
new()
Expand Down

0 comments on commit 7a7112e

Please sign in to comment.