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 tests for templates #47

Closed
DamianEdwards opened this issue Oct 3, 2023 · 3 comments · Fixed by #4168
Closed

Add tests for templates #47

DamianEdwards opened this issue Oct 3, 2023 · 3 comments · Fixed by #4168

Comments

@DamianEdwards
Copy link
Member

The templates currently have no unit test coverage. We should look at porting some of the template testing infrastructure from dotnet/aspnetcore to enable us to get some template test coverage.

@danmoseley danmoseley added this to the some time after preview milestone Oct 16, 2023
@danmoseley danmoseley removed this from the needs milestone (for GA) milestone Nov 13, 2023
@danmoseley
Copy link
Member

@DamianEdwards we have some tests now, how would you describe the gap (or should we close this now)

@DamianEdwards
Copy link
Member Author

Happy for engineering to decide as I haven't looked at the tests added. If we have basic coverage now of project create, build, run, publish from all our templates we can close and open specific issues to add missing coverage when necessary.

@joperezr
Copy link
Member

joperezr commented May 6, 2024

@radical has been working on the infrastructure to support these types of tests. I believe he is close to getting those changes in, but IMO this is not something that should be blocking the release and the change will likely not be backported given the timing now, So I'm moving the milestone to 8.1.

@joperezr joperezr modified the milestones: GA, 8.1 May 6, 2024
radical added a commit that referenced this issue May 21, 2024
This adds `Aspire.Workload.Tests` which are meant to exercise the `aspire` workload. The individual tests create projects from templates just like a user would, and then run, and validate them.

It uses the existing infrastructure from `Aspire.EndToEnd.Tests` to install sdk+workload for testing.

- Enables tests on Linux, and Windows
- Because we don't have docker support on helix/Windows yet, the docker dependent tests are skipped on windows

## Tests

Two kinds of tests are being added here:

1. Tests that create+build a `aspire-starter` template project, and then some tests interact with that running app to validate it
2. Individual tests exercise the various templates, for example to create `aspire-starter` with [xunit,nunit,mstest] options

- The tests also connect to the dashboard and validate that the expected services show up as expected using `Playwright`.
- Some tests also connect to the webapp in `aspire-starter` template to validate some parts of it.

Fixes #47 .

Follow up work is tracked in #4222

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants