-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Change tests to not modify Core_Root #23470
Conversation
…re_Root folder to a subfolder named Local_Core_Root and run from there.
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
In general I am not opposed to this, but I did some reworking to avoid modifying Core_Root for COM tests. What is the current reason this is needed? |
|
The hostpolicy mock needs to be placed next to |
See https://github.com/dotnet/coreclr/tree/master/tests/src/Interop/COM/Activator for an example of a test using the mocked out |
|
The gist here is we shouldn't be modifying Core_Root in any way because it will break any chance we have for the possibility of running tests in parallel. Making a copy is a reasonable compromise, but that should be an absolute last resort. |
|
So based on @AaronRobinsonMSFT's feedback, we don't need a local Core_Root for the COM tests. However, I don't believe we can unconditionally enable CoreRun to load hostpolicy.dll if present for a few reasons:
|
|
I've updated the tests to not need to modify Core_Root and load hostpolicy differently to ensure we do everything correct. |
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Test failures are due to #23534 as far as I can tell. |
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@echesakovMSFT test failures in Pri1 Windows x86 look unrelated to this PR and it passed on Linux arm64. |
tests/src/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs
Outdated
Show resolved
Hide resolved
Redesign tests that needed to modify Core_Root to no longer do so. - Loader.FromNativePaths: Use `CORE_LIBRARIES` instead of `COREROOT` - Loader.AssemblyDependencyResolver: Split out the invalid hosting test that needs hostpolicy to not be preloaded. Have `CoreRun` and `CoreShim` preload hostpolicy when a path to a hostpolicy is specified in the `MOCK_HOSTPOLICY` environment variable. - Add a `CLRTest.MockHosting.targets` file that is imported when a test requires hostpolicy. It adds the reference to the mock hostpolicy and ensures that the `MOCK_HOSTPOLICY` environment variable is correctly set in the test scripts. Fixes dotnet/coreclr#23429. Commit migrated from dotnet/coreclr@2516a53
Redesign tests that needed to modify Core_Root to no longer do so.
CORE_LIBRARIESinstead ofCOREROOTCoreRunandCoreShimpreload hostpolicy when a path to a hostpolicy is specified in theMOCK_HOSTPOLICYenvironment variable.CLRTest.MockHosting.targetsfile that is imported when a test requires hostpolicy. It adds the reference to the mock hostpolicy and ensures that theMOCK_HOSTPOLICYenvironment variable is correctly set in the test scripts.Old description:
For tests that need to modify Core_Root during execution, copy the Core_Root folder to a subfolder named Local_Core_Root and run from there. This is to avoid trying to write to Core_Root (which is read-only on some Helix agents) and avoid the possibility of non-determinism between tests.
Fixes #23429.
cc: @AaronRobinsonMSFT