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

.Net: Enable unit tests to build and pass on .NET Framework #6326

Closed
wants to merge 1 commit into from

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented May 18, 2024

@dmytrostruk, in conjunction with #6323 and #6324, this enables all of the tests projects for .NET Framework, gets all of them building, and gets the unit tests passing for me locally.

Contributes to #6063

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels May 18, 2024
@github-actions github-actions bot changed the title Enable unit tests to build and pass on .NET Framework .Net: Enable unit tests to build and pass on .NET Framework May 18, 2024
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CA2007,CA1861,VSTHRD111,SKEXP0001,SKEXP0010,SKEXP0020,SKEXP0040,SKEXP0050,SKEXP0060,SKEXP0070,SKEXP0110</NoWarn>
<UserSecretsId>b7762d10-e29b-4bb1-8b74-b6d69a667dd4</UserSecretsId>
<Nullable>annotations</Nullable>
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is warning at the moment. Do we have to switch down to annotations?

@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

#if NET // TODO: Tests fail with "Unable to load DLL 'duckdb': The specified module could not be found." on .NET Framework
Copy link
Contributor

@westey-m westey-m May 20, 2024

Choose a reason for hiding this comment

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

Could be related to this issue:
Giorgi/DuckDB.NET#151

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, looks like it's the issue, the duckdb tests work for me in net462 when executed using x64.
dotnet test -a x64 -f net462 --filter "SemanticKernel.Connectors.UnitTests.DuckDB.DuckDBMemoryStoreTests.CollectionsCanBeDeletedAsync"

@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

#if NET // TODO: Tests fail with "Library e_sqlite3 not found" on .NET Framework
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems related to this issue and the linked issues:
ericsink/SQLitePCL.raw#252

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it's related to shadow copying and how SQLitePCLRaw.core.DLL is trying to load e_sqlite3.dll.
A workaround is referred to here, i.e. turn off shadow copying: dotnet/efcore#19396.

When shadow copying is enabled for xunit, SQLitePCLRaw.core.DLL tries to load e_sqlite3.dll from a path relative to where the shadow copied SQLitePCLRaw.core.DLL resides, but the shadow copy folder structure doesn't match the build output folder structure, so it fails to load the dll.

@matthewbolanos
Copy link
Member

@stephentoub, bumping this up for you. We are doing a review of PRs and wanted to check if this is something you still wanted to complete or if you think it's something the team should pick up?

@stephentoub
Copy link
Member Author

Thanks, Matthew. I think it's still worth adding in such validation, but I'm not planning on pushing it forward right now. If someone else can spare a few cycles to land it, that'd be great.

@markwallace-microsoft
Copy link
Member

@dmytrostruk is going to continue this work, tracking with #8109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants