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 host tests for asset resolution behaviour without fallback graph #83434

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

elinor-fung
Copy link
Member

  • Add host tests for asset resolution behaviour without fallback graph
    • Also merged the ComponentOnSelfContainedApp with/without a fallback graph into one test class
  • Refactor probe_config_t to hopefully make it clearer what each instance is for
  • Update tests to validate that a framework probe was used or not used

Slightly tweaked probe config logging:

before
-- Probe configurations:
probe_config_t: probe=[] deps-dir-probe=[1]
probe_config_t: probe=[C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8] deps-dir-probe=[0]

Processing TPA for deps entry [helloworld, 1.0.0, helloworld.dll]
  Considering entry [helloworld/1.0.0/helloworld.dll], probe dir [], probe fx level:0, entry fx level:0
    Local path query C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll (skipped file existence check)
    Probed deps dir and matched 'C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll'
Processing TPA for deps entry [Microsoft.NETCore.App.Runtime.win-x64, 8.0.0-preview.1.23110.8, System.Private.CoreLib.dll]
  Considering entry [Microsoft.NETCore.App.Runtime.win-x64/8.0.0-preview.1.23110.8/System.Private.CoreLib.dll], probe dir [], probe fx level:0, entry fx level:1
    Skipping... not found in deps dir 'C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8'
    Skipping... not found in probe dir ''
  Considering entry [Microsoft.NETCore.App.Runtime.win-x64/8.0.0-preview.1.23110.8/System.Private.CoreLib.dll], probe dir [C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8], probe fx level:1, entry fx level:1
    Local path query C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll (skipped file existence check)
    Probed deps json and matched 'C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll'
after
-- Probe configurations:
  probe type=app
  probe type=framework dir=[C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8] fx_level=1

Processing TPA for deps entry [helloworld, 1.0.0, helloworld.dll] with fx level: 0
  Using probe config: type=app
    Local path query C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll (skipped file existence check)
    Probed deps dir and matched 'C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll'
Processing TPA for deps entry [Microsoft.NETCore.App.Runtime.win-x64, 8.0.0-preview.1.23110.8, System.Private.CoreLib.dll] with fx level: 1
  Using probe config: type=app
    Skipping... not app asset
  Using probe config: type=framework dir=[C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8] fx_level=1
    Local path query C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll (skipped file existence check)
    Probed deps json and matched 'C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll'

@ghost
Copy link

ghost commented Mar 15, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Add host tests for asset resolution behaviour without fallback graph
    • Also merged the ComponentOnSelfContainedApp with/without a fallback graph into one test class
  • Refactor probe_config_t to hopefully make it clearer what each instance is for
  • Update tests to validate that a framework probe was used or not used

Slightly tweaked probe config logging:

before
-- Probe configurations:
probe_config_t: probe=[] deps-dir-probe=[1]
probe_config_t: probe=[C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8] deps-dir-probe=[0]

Processing TPA for deps entry [helloworld, 1.0.0, helloworld.dll]
  Considering entry [helloworld/1.0.0/helloworld.dll], probe dir [], probe fx level:0, entry fx level:0
    Local path query C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll (skipped file existence check)
    Probed deps dir and matched 'C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll'
Processing TPA for deps entry [Microsoft.NETCore.App.Runtime.win-x64, 8.0.0-preview.1.23110.8, System.Private.CoreLib.dll]
  Considering entry [Microsoft.NETCore.App.Runtime.win-x64/8.0.0-preview.1.23110.8/System.Private.CoreLib.dll], probe dir [], probe fx level:0, entry fx level:1
    Skipping... not found in deps dir 'C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8'
    Skipping... not found in probe dir ''
  Considering entry [Microsoft.NETCore.App.Runtime.win-x64/8.0.0-preview.1.23110.8/System.Private.CoreLib.dll], probe dir [C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8], probe fx level:1, entry fx level:1
    Local path query C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll (skipped file existence check)
    Probed deps json and matched 'C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll'
after
-- Probe configurations:
  probe type=app
  probe type=framework dir=[C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8] fx_level=1

Processing TPA for deps entry [helloworld, 1.0.0, helloworld.dll] with fx level: 0
  Using probe config: type=app
    Local path query C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll (skipped file existence check)
    Probed deps dir and matched 'C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll'
Processing TPA for deps entry [Microsoft.NETCore.App.Runtime.win-x64, 8.0.0-preview.1.23110.8, System.Private.CoreLib.dll] with fx level: 1
  Using probe config: type=app
    Skipping... not app asset
  Using probe config: type=framework dir=[C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8] fx_level=1
    Local path query C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll (skipped file existence check)
    Probed deps json and matched 'C:\dotnet-8\shared\Microsoft.NETCore.App\8.0.0-preview.1.23110.8\System.Private.CoreLib.dll'
Author: elinor-fung
Assignees: -
Labels:

area-Host

Milestone: -

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

@@ -40,102 +34,113 @@ protected RidAssetResolutionBase(SharedTestState sharedState)
[InlineData("win10-x64", WindowsAssembly, $"{LinuxAssembly};{MacOSAssembly}")]
[InlineData("linux-x64", LinuxAssembly, $"{MacOSAssembly};{WindowsAssembly}")]
[InlineData("osx-x64", MacOSAssembly, $"{LinuxAssembly};{WindowsAssembly}")]
public void RidSpecificAssembly(string rid, string includedPath, string excludedPath)
public void RidSpecificAssembly(string rid, string includedPath, string excludedPath, bool hasRuntimeFallbacks = true)
Copy link
Member

Choose a reason for hiding this comment

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

Subjective - Presonally I would prefer to add a new method overload and call the "private" one from other places. I just don't like that a method is both a test and also called from another test.

@elinor-fung elinor-fung merged commit 7a3b4f6 into dotnet:main Mar 16, 2023
@elinor-fung elinor-fung deleted the noFallbackTests branch March 16, 2023 00:15
@ghost ghost locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants