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 more example test cases to Project Template #189

Merged
merged 5 commits into from
Jul 12, 2022

Conversation

michael-hawker
Copy link
Member

Fixes #160 - Add a suite of example test cases for different scenarios and patterns.

Blocked testing locally by #188, figured could see at least if they work in the CI as I think they're all good to go basically anyway... we'l see, will leave it as draft for now until #188 is resolved.

@michael-hawker
Copy link
Member Author

Hmm, something's odd with XAML Styler, I ran the command before commit but it didn't fix anything. Will have to investigate later. It's also asking for 'input objects' now, which I'm not sure why.

@niels9001
Copy link
Collaborator

Hmm, something's odd with XAML Styler, I ran the command before commit but it didn't fix anything. Will have to investigate later. It's also asking for 'input objects' now, which I'm not sure why.

I have the same issue! Normally I was able to just run it, now it asks for input.

@michael-hawker michael-hawker marked this pull request as ready for review July 8, 2022 00:32
@michael-hawker
Copy link
Member Author

Was able to piecemeal running the tests locally but not smoothly due to #188. But the examples are complete and seem to be running ok. So, if the CI runs, we should be good.

Still confused as to why this is happening.

…s and patterns.

Blocked testing locally by #188
Copy link
Member

@Arlodotexe Arlodotexe left a comment

Choose a reason for hiding this comment

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

Looks good, except for one small detail.

@michael-hawker
Copy link
Member Author

Discovered an issue with the LabsUITestMethod generator, was even in the last run here:

image

SimpleUIAttributeExampleTest is not run here.

Looked into the generator and seems like it's missing methods that aren't using the control parameter now, was able to add a generic expect generation guard to the test suite to check this:

image

Will add this to the other SG tests (to ensure we haven't missed anything else), and then see if I can resolve the underlying issue and finish with these tests updates.

In the meantime @Arlodotexe let me know if the other test that I was trying to add appears to be inline with what you were thinking around your comment.

@michael-hawker
Copy link
Member Author

I may also be using the roslyn method wrong still, will dig in more after lunch and try and learn more.

…shore up tests to check for specific outputs

Fixes issue with LabsUITestMethod not generating test for tests not using a control parameter.
@michael-hawker
Copy link
Member Author

Error: D:\a\Labs-Windows\Labs-Windows\labs\CiTestExp\tests\CiTestExp.UnitTests.Uwp\CommunityToolkit.Labs.Core.SourceGenerators.LabsUITestMethod\CommunityToolkit.Labs.Core.SourceGenerators.LabsUITestMethod.LabsUITestMethodGenerator\SimpleUIAttributeExampleTest.g.cs(11,42): error CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [D:\a\Labs-Windows\Labs-Windows\labs\CiTestExp\tests\CiTestExp.UnitTests.Uwp\CiTestExp.UnitTests.Uwp.csproj]

@michael-hawker michael-hawker merged commit 440822f into main Jul 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the llama/better-example-tests branch July 12, 2022 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project template is missing minimal UI tests
3 participants