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

Refactor host rid tests. #303

Merged
merged 4 commits into from
Oct 11, 2023
Merged

Refactor host rid tests. #303

merged 4 commits into from
Oct 11, 2023

Conversation

tmds
Copy link
Member

@tmds tmds commented Sep 29, 2023

Extend host-probes-rid-assets and add a variant that uses the legacy graph for probing with .NET 8+.

Remove the runtime-fallback-graph test in favor of these tests.

Extend host-probes-rid-assets and add a variant that uses the
legacy graph for probing with .NET 8+.

Remove the runtime-fallback-graph test in favor of these tests.
@tmds tmds requested a review from omajid September 29, 2023 14:05
@omajid
Copy link
Member

omajid commented Sep 29, 2023

Looks like the test runner doesn't patch TargetFramework in nested test directories.

@tmds
Copy link
Member Author

tmds commented Sep 30, 2023

Looks like the test runner doesn't patch TargetFramework in nested test directories.

I'll look into changing the test runner for this.

@tmds
Copy link
Member Author

tmds commented Oct 3, 2023

I'll look into changing the test runner for this.

Rather than extending the patching of csproj files, I've made a PR that makes available the target framework from the test runner as an envvar: redhat-developer/dotnet-bunny#84. It can then be used in the project files as:

<TargetFramework>$(TestTargetFramework)</TargetFramework>

A default value for the property is set in Directory.Build.props.

@omajid
Copy link
Member

omajid commented Oct 3, 2023

Hm, any reason why we can't go further and just set an TargetFramework env var directly?

@tmds
Copy link
Member Author

tmds commented Oct 3, 2023

Hm, any reason why we can't go further and just set an TargetFramework env var directly?

To avoid setting a property that is understood by the SDK which can cause it to behave different.

@omajid
Copy link
Member

omajid commented Oct 4, 2023

CI says portable RIDs are being computed incorrectly:

 ++ ../../runtime-id --portable
+ runtime_id=fedora.37-x64

@omajid
Copy link
Member

omajid commented Oct 4, 2023

Hm, any reason why we can't go further and just set an TargetFramework env var directly?

To avoid setting a property that is understood by the SDK which can cause it to behave different.

Okay. I ask because we override TargetFramework directly in existing .csproj files. I would have thought that has a similar set of concerns.

I am also a bit hesitant about two different approaches to setting TargetFramework in .csproj files - overriding some and relying on environment variables for others.

Anyway, if you like this approach we can go ahead with it.

@tmds
Copy link
Member Author

tmds commented Oct 4, 2023

CI says portable RIDs are being computed incorrectly:

oops... fixed it.

Okay. I ask because we override TargetFramework directly in existing .csproj files. I would have thought that has a similar set of concerns.

The difference is that we're replacing the value only when the project already has a TargetFramework.

If we'd set an envvar, it would be implied for all projects.

I am also a bit hesitant about two different approaches to setting TargetFramework in .csproj files - overriding some and relying on environment variables for others.

I think we should consider applying this to all tests.

@tmds tmds closed this Oct 10, 2023
@tmds tmds reopened this Oct 10, 2023
@tmds
Copy link
Member Author

tmds commented Oct 10, 2023

Close and re-open to trigger a CI run with the updated testrunner.

@tmds
Copy link
Member Author

tmds commented Oct 10, 2023

The test is failing on Alpine 6.0 and 7.0:

host-probes-rid-assets                                      [FAIL]	(11s)

The log shows it fails to load unix assets:

+ dotnet run --project app
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'mylib-unix' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libmylib-unix: No such file or directory
   at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError)
   at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
   at Program.<Main>$(String[] args) in /__w/dotnet-regular-tests/dotnet-regular-tests/host-probes-rid-assets/app/Program.cs:line 4
Process Exit Code: 134

It may have to do with the VERSION_ID on alpine:edge:

# cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.19_alpha20230901
PRETTY_NAME="Alpine Linux edge"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

On the alpine:latest image the test passes.

I'm going to configure the test to skip on Alpine.

cc @ayakael

@tmds tmds merged commit b062861 into redhat-developer:main Oct 11, 2023
18 checks passed
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.

2 participants