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

Make mono runtime tests stop using patching #43952

Closed
naricc opened this issue Oct 28, 2020 · 24 comments · Fixed by #62652
Closed

Make mono runtime tests stop using patching #43952

naricc opened this issue Oct 28, 2020 · 24 comments · Fixed by #62652
Assignees
Labels
area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' test-enhancement Improvements of test source code
Milestone

Comments

@naricc
Copy link
Contributor

naricc commented Oct 28, 2020

Runtime tests on mono still rely on using the PatchCoreCLRCoreRoot target, for architectures other than Android and Wasm:

<Target Name="PatchCoreClrCoreRoot">

This step is confusing when running the tests locally, time consuming, and brittle. It was necessary when the tests were first extended to work on mono, but work since should make it possible to use use a corerun build with mono.

Before actually removing the target we also need to make sure that the automated performance runs do not use it. @DrewScoggins

@naricc naricc added test-enhancement Improvements of test source code area-Infrastructure-mono labels Oct 28, 2020
@naricc naricc self-assigned this Oct 28, 2020
@ghost
Copy link

ghost commented Oct 28, 2020

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Oct 28, 2020
@naricc
Copy link
Contributor Author

naricc commented Dec 1, 2020

Also do we need this dependency?

- job: mono_common_test_build_p0_AnyOS_AnyCPU_release
   condition: >-
   and(succeeded(), and(succeeded(), or(
   eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
  eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true),
  eq(variables['isFullMatrix'], true))))
 container:
 alias: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-359e48e-20200313130914
 continueOnError: false
 dependsOn:
  - checkout
  - coreclr__product_build_Linux_x64_release
  - libraries_build_Linux_x64_Release

@naricc naricc changed the title Make runtime tests stop using patching Make mono runtime tests stop using patching Dec 1, 2020
@naricc
Copy link
Contributor Author

naricc commented Dec 1, 2020

I also checked with @DrewScoggins; performance runs are not using that target.

@safern safern added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Dec 2, 2020
@safern
Copy link
Member

safern commented Dec 2, 2020

@naricc I added blocking-clean-ci as this manifests as:

Artifact CoreCLRProduct__Linux_arm64_release not found for build

Whenever the Mono runtime tests start running before CoreCLR build is done.

@naricc naricc removed the untriaged New issue has not been triaged by the area owner label Dec 4, 2020
@naricc
Copy link
Contributor Author

naricc commented Dec 4, 2020

@akoeplinger @steveisok I think the easiest way to do this is to use the test host the libraries tests are currently using, instead of corerun (which currently requires building coreclr). Is there any issue if the runtime tests depend on that test host?

@steveisok
Copy link
Member

Not that I know of.

@marek-safar
Copy link
Contributor

Is there any issue if the runtime tests depend on that test host?

This sounds to me like a painful path for runtime developers. I think we want to keep runtime/VM tests runner simple to make tracking any problems less painful. What is blocking us from moving corerun to shared location?

/cc @vargaz @lambdageek

@naricc
Copy link
Contributor Author

naricc commented Dec 4, 2020

@jkoritzinsky Is there anything blocking us from moving corerun to a shared location and building it independently of coreclr, as per @marek-safar's comment?

@safern
Copy link
Member

safern commented Dec 4, 2020

Didn't runtime tests depend on libraries anyways? At least on CI they download libraries assets. cc: @trylek

@trylek
Copy link
Member

trylek commented Dec 4, 2020

Runtime tests do depend on libraries, these are used to populate the CORE_ROOT folder which is subsequently used as a "test-specific framework drop". That by itself shouldn't prevent moving corerun to a location shared between CoreCLR and Mono as the tool is usable for both. For the test host, I was under the impression that it by itself was also using the libraries build (to populate its version of the "test-specific framework drop") so I guess all the paths lead in a similar direction.

@marek-safar
Copy link
Contributor

Runtime tests do depend on libraries

Which libraries are needed? I thought System.Private.Corelib should be enough for runtime tests and the remaining tests are in libraries tests so can take any dependency.

@trylek
Copy link
Member

trylek commented Dec 4, 2020

I don't know how to produce an exhaustive list but it's definitely more than System.Private.CoreLib, I'm not aware of any hard definition of a "set of assemblies usable in runtime tests". A random text search for "using" statements under src\tests shows e.g. System.IO, System.Linq, System.ComponentModel, System.Numerics, System.Reflection.Emit, System.Security.Cryptography, System.Text.RegularExpressions, System.Net.Http or System.Globalization. Perhaps there are actually not that many but we'd have to find out; in general, I think the rule of thumb for test placement in the runtime repo has been "focusing on exercising / stressing some runtime feature", not necessarily needing just System.Private.CoreLib. We may be able to clean this up or at least put some order in the dependencies but for the 10K tests it's probably going to take some time.

@safern
Copy link
Member

safern commented Dec 4, 2020

You need a shared framework to run the tests as they run as XUnit .NET tests and I believe they use the live built shared framework, right? Or do we just use the live libraries to build the tests?

@jkoritzinsky
Copy link
Member

The XUnit harness doesn’t use the live built runtime any more. We moved to pulling down a copy of the runtime bundled with the SDK we build with for running xunit a while ago.

@trylek
Copy link
Member

trylek commented Dec 4, 2020

I think it's actually even more convoluted - the XUnit wrappers and XUnit console use the bundled framework as Jeremy says, however the tests themselves (running out-of-proc) use the framework in CORE_ROOT. This is one of the reasons why a couple of weeks back @nattress had to move xunit out of the CORE_ROOT folder exactly due to incompability between the two SDK versions.

@jkoritzinsky
Copy link
Member

Yep. The harness uses the downloaded framework, but the tests themselves use CORE_ROOT.

Additionally, for some of the tests, (at least for CoreCLR runs) we use the additional tools available in CORE_ROOT that we don't ship in the shared framework. I think having two different ways to form CORE_ROOT is reasonable, but I don't think sharing a test host layout with libraries would work well.

@naricc
Copy link
Contributor Author

naricc commented Dec 4, 2020

Ok, so my conclusion from this is that I should not use the libraries test host, but instead should make core_run build independently of coreclr, move the source for it to a new location, and then use corerun to as normal for the runtime tests. I will proceed with that approach.

@naricc
Copy link
Contributor Author

naricc commented Dec 7, 2020

Using this issue to continue to document my findings, it seems like there are actually two coreruns, one in coreclr/src/hosts/corerun and another in coreclr/src/hosts/unixcorerun. One unixcorerun is used on unix paltforms, and the other is used one Windows.

It seems like two seperate tasks to move them, so I will do the unixcorerun first, since it seems a little simpler, and it is the one we need to remove the patch step.

Also, does any one have any preference on the location I move it to? I was thinking /src/hosts.

@trylek
Copy link
Member

trylek commented Dec 7, 2020

I would initially suggest the already existing src/native - I actually have a vague recollection @jkotas recently suggested that as a location we could move the various hosts to as well.

@jkoritzinsky
Copy link
Member

I think it should go in src/tests since it’s a test only host. Or into the new shared folder that the shared event pipe source is going into.

@SamMonoRT
Copy link
Member

Moving the test enhancement issues to 7.0.0

@lambdageek
Copy link
Member

I started a checklist #58266 for some cleanup work to make working with runtime tests easier for folks primarily building Mono - ideally only building corerun and not the rest of coreclr and its CoreLib, etc. Removing this "patching" behavior will be one of the steps along the way.

@krwq
Copy link
Member

krwq commented Sep 30, 2021

Is this a dup of #51584 ? Per @safern's comment the message on both issues seems the same

@naricc
Copy link
Contributor Author

naricc commented Sep 30, 2021

@krwq This is a necessary thing to do for #51584. I am not sure if it is the whole thing.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Dec 11, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jan 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants