Skip to content
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

[DI-1321] Fix build errors #48

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataImport.Common/DataImport.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.1" />
<PackageReference Include="Microsoft.Azure.KeyVault.Core" Version="3.0.5" />
<PackageReference Include="Microsoft.Data.Services.Client" Version="5.8.4" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.23" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.19" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.41.0.50478">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 3 additions & 0 deletions DataImport.Models.Tests/SetUpFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public void GlobalSetUp()
// Migrations MUST run first, before any logging attempts,
// so that database logging can be properly initialized.
using (var context = new SqlDataImportDbContext(dbContextLogger, optionsBuilder.Options))
{
context.Database.EnsureDeleted();
context.Database.Migrate();
}

logger.LogInformation("{assembly} Starting", Assembly.GetExecutingAssembly().GetName().Name);
}
Expand Down
1 change: 1 addition & 0 deletions DataImport.Server.TransformLoad.Tests/SetUpFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void GlobalSetUp()
{
using (var context = scope.ServiceProvider.GetRequiredService<DataImportDbContext>())
{
context.Database.EnsureDeleted();
context.Database.Migrate();

//Populate data for tests.
Expand Down
10 changes: 3 additions & 7 deletions DataImport.Web.Tests/SetUpFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
// See the LICENSE and NOTICES files in the project root for more information.

using System;
using DataImport.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;
using System;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Serilog;
using static DataImport.Web.Tests.Testing;

Expand All @@ -32,18 +33,13 @@ public async Task GlobalSetUp()

using (var context = Testing.Services.GetRequiredService<SqlDataImportDbContext>())
{
if (RunningUnderTeamCity())
context.Database.EnsureDeleted();

context.Database.EnsureDeleted();
context.Database.Migrate();
}

Log.Information(Assembly.GetExecutingAssembly().GetName().Name + " Starting");

await ConfigureForOdsApiV311();
}

private static bool RunningUnderTeamCity()
=> Environment.GetEnvironmentVariable("TEAMCITY_PROJECT_NAME") != null;
}
}
2 changes: 1 addition & 1 deletion DataImport.Web/DataImport.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<PackageReference Include="FontAwesome" Version="4.7.0" />
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
<PackageReference Include="jQuery" Version="3.6.0" />
<PackageReference Include="jQuery.Validation" Version="1.19.3" />
<PackageReference Include="jQuery.Validation" Version="1.19.5" />
<PackageReference Include="LigerShark.WebOptimizer.Core" Version="3.0.348" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion DataImport.Web/Helpers/JsonValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public bool IsValidJson(string data)
}
catch (Exception ex)
{
_logger.LogError("Cannot parse text as JSON.", ex);
_logger.LogError(ex, "Cannot parse text as JSON.");
return false;
}
}
Expand Down
Loading