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

Add .NET 8 support; Fix tests #97

Closed
wants to merge 3 commits into from

Conversation

iwedaz
Copy link
Contributor

@iwedaz iwedaz commented Dec 31, 2023

It is huge PR, but it is hard to split it in small pieces.
The main goal of that PR is add .net 8 TFM and restore integration test functionality.

What have been done:

  • update dependencies to the latest version;
  • add net8.0 TFM and adjust references in others projects;
  • rewrite DotNetEd.CoreAdmin.IntegrationTestApp Program.cs to top-level statement;
  • add fixture (TestAppFixture) that can initialize database and seed data properly;
  • use that fixture in integration test;
  • fix integration test to use scoped lifetime area for getting IntegrationTestDbContext;
  • update github action to use .net 8.

@gaetandezeiraud
Copy link
Contributor

Hi and thank you for the PR!
Not sure about tests/DotNetEd.CoreAdmin.IntegrationTestApp/Program.cs and the top-level statement. @edandersen is not a big fan. Me neither. For the rest, it seems good to me. I ping @edandersen to see if he has time to approve the rest of the PR.

@edandersen
Copy link
Owner

This is great, thanks. I'll get to merging it soon.

@edandersen
Copy link
Owner

edandersen commented Jan 29, 2024

.NET 6 build target integration tests fail. I think .NET 7 and 8 are okay.

[xUnit.net 00:00:12.90]     DotNetEd.CoreAdmin.IntegrationTests.SecurityTests.ReturnsUnauthorizedWhenInProductionCustomAuthMethodFails [FAIL]
  Failed DotNetEd.CoreAdmin.IntegrationTests.CrudTests.DeleteHappyPath [1 ms]
  Error Message:
   System.InvalidOperationException : Unable to build IHost
  Stack Trace:
     at Microsoft.Extensions.Hosting.HostFactoryResolver.HostingListener.CreateHost()
   at Microsoft.Extensions.Hosting.HostFactoryResolver.<>c__DisplayClass8_0.<ResolveHostFactory>b__0(String[] args)
   at Microsoft.AspNetCore.Mvc.Testing.DeferredHostBuilder.Build()
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateHost(IHostBuilder builder)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.ConfigureHostBuilder(IHostBuilder hostBuilder)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer()
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.get_Services()
   at DotNetEd.CoreAdmin.IntegrationTests.TestAppFixture.InitializeAsync() in D:\a\core-admin\core-admin\tests\DotNetEd.CoreAdmin.IntegrationTests\TestAppFixture.cs:line 22

@edandersen
Copy link
Owner

Thanks for taking a look at this but I've now released 3.0.0 with .NET 8 support. Cheers!

@edandersen edandersen closed this Mar 11, 2024
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.

3 participants