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

[Mono] Turn Samples into Functional Tests #44016

Closed

Conversation

MaximLipnin
Copy link
Contributor

Related issue: #43865

The idea is to copy existing mono samples to a particular place within runtime/src/libraries/ directory and tune them to re-use library test infra like it's done for other functional tests.

As a first step, I'll try to do it with iOS sample. Any ideas on how to do it better/more correct are appreciated.

@ghost
Copy link

ghost commented Oct 29, 2020

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

@jkotas
Copy link
Member

jkotas commented Oct 29, 2020

  • Could you please add README.md that describes what these samples are for and how to use them?
  • Do we expect customers to make copy of these samples to create their own apps? Do we provide any guarantees that the sample copied this way will continue to work?
  • Would https://github.com/dotnet/runtime/tree/master/src/tests be a more logical place for this?

@MaximLipnin
Copy link
Contributor Author

@jkotas Thank you for a quick look.

  • Could you please add README.md that describes what these samples are for and how to use them?

Do you mean readme for existing samples?

  • Do we expect customers to make copy of these samples to create their own apps? Do we provide any guarantees that the sample copied this way will continue to work?

As far as I know those sample are used for showing off the platforms we support. Also they are useful for some debugging purposes. I don't know if the samples are supposed to be copied to create new apps.

I mostly worked with library tests so that's why I started here. If the location you mentioned is better then I'll consider that option.

MaximLipnin and others added 2 commits October 29, 2020 17:25
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
@steveisok
Copy link
Member

@jkotas These are no longer samples. The intent is to run them through AOT/Interp/JIT to give us a good sense that a barebones app is working.

@marek-safar
Copy link
Contributor

Do we expect customers to make copy of these samples to create their own apps?

No, these are specific tests which verify that MonoVM based runtime packs work as expected. I don't think CoreCLR has any such tests otherwise it'd be nice to share the logic.

Would https://github.com/dotnet/runtime/tree/master/src/tests be a more logical place for this?

Yes but apparently there is no infrastructure yet in place to support having them there.

@jkotas
Copy link
Member

jkotas commented Oct 29, 2020

These are no longer samples. The intent is to run them through AOT/Interp/JIT to give us a good sense that a barebones app is working.

Then the directory should not be called Samples. The best name I can think of is IntegrationTests.

I do not think the name should be Mono-specific. You can imagine having e.g. ASP.NET barebone app inside this set of tests too.

Comment on lines +42 to +51
const string msg = "Hello World!\n.NET 5.0";
for (int i = 0; i < msg.Length; i++)
{
// a kind of an animation
ios_set_text(msg.Substring(0, i + 1));
await Task.Delay(100);
}

Console.WriteLine("Done!");
await Task.Delay(-1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to check some error codes

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a 'tests' directory under 'IntegrationTests' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This follows the structure, which other library directories have, in order to be included in

<ProjectReference Include="$(MSBuildThisFileDirectory)*\tests\**\*.Tests.csproj"

Co-authored-by: Marek Safar <marek.safar@gmail.com>
@runfoapp runfoapp bot mentioned this pull request Oct 29, 2020
@MaximLipnin
Copy link
Contributor Author

Closing it in favor of #44462

@MaximLipnin MaximLipnin deleted the mono_samples_as_func_tests branch November 10, 2020 13:58
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
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.

7 participants