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

New tests workflow #468

Merged
merged 41 commits into from
Feb 24, 2025
Merged

New tests workflow #468

merged 41 commits into from
Feb 24, 2025

Conversation

aaronpowell
Copy link
Member

@aaronpowell aaronpowell commented Feb 12, 2025

This is an overhaul of the runners and makes it more like the Aspire repo approach - https://github.com/dotnet/aspire/blob/5e270847fda789982de623bd5486f777989bc7cd/.github/workflows/tests.yml

The basic idea is that we use a matrix to run each of the test projects (across each OS), so that rather than having a single long test run, we have multiple shorter runs (it's taking <10 minutes consistently vs the ~20minutes currently).

This improves the visibility of the test runs, especially if there are fails, since we don't need to scroll through the whole test list, we can see exactly which workflow the failure was on.

  • Refactor CI test job to call new workflow.
  • Verify tests pass.
  • Verify coverage is reported.
  • Update main and release workflows.
  • Remove obsolete workflows.
  • Create way to generate test list.
  • Include workflow to verify all test projects are included in CI job

Here's what we see now in the summary of the job:
image

There is a summary of each individual test run (for each OS), which means that we get more fine grain details on the test runs.

It also gives us better insights into test failures. Here's an artificial failure I have added:

image

@aaronpowell aaronpowell force-pushed the test-runner-improvement branch from f4d16ca to be8d402 Compare February 18, 2025 06:08
@aaronpowell
Copy link
Member Author

@ErikEJ @jmezach I'm trying to do some tweaks to the CI pipeline and it looks like there's an assumption on the GetDacpackPath that results in it wanting to get the dacpack from the Debug folder, despite the CI job running in Release.

You can see that in this test failure: https://github.com/CommunityToolkit/Aspire/actions/runs/13384342116/job/37378295078?pr=468#step:7:46

I'm unfamiliar with how it does the resolution for the dacpack, but I'd have thought it would use the configuration that is being used to run the tests/app.

Can you have a look at what might be wrong here?

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 18, 2025

@aaronpowell Maybe the project here https://github.com/CommunityToolkit/Aspire/blob/main/examples/sql-database-projects/SdkProject/SdkProject.csproj must be built in order to produce a .dacpac? (still odd why it is looking in the debug folder)

@jmezach
Copy link
Contributor

jmezach commented Feb 18, 2025

We are essentially loading the referenced project file using the MSBuild API's. We aren't explicitly passing a configuration or anything, so I guess it defaults to Debug. Not sure if there's much we can do about that. Perhaps we should pass the same configuration at the one used to build the AppHost? Not sure if we can get to that though.

@aaronpowell
Copy link
Member Author

Looking at the build log we can see the dacpack is being generated, so there's obviously something that the MSBuild API isn't doing that we need.

I'll debug and see if I can find how it generates that path

@aaronpowell
Copy link
Member Author

Figured it out - 8889523

@jmezach
Copy link
Contributor

jmezach commented Feb 18, 2025

@aaronpowell Nice!

@aaronpowell aaronpowell changed the title [WIP] New tests workflow New tests workflow Feb 18, 2025
@aaronpowell aaronpowell force-pushed the test-runner-improvement branch from 8a4ba57 to 7cb7dd8 Compare February 19, 2025 01:17
@aaronpowell
Copy link
Member Author

@CommunityToolkit/aspire-contributors anyone want to have a review of this?

Here's an example of a failing test run if you want to see what that looks like: https://github.com/CommunityToolkit/Aspire/actions/runs/13403676338

@aaronpowell aaronpowell force-pushed the test-runner-improvement branch from faf217a to 19c6217 Compare February 19, 2025 22:31
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.EventStore 100% 100% 46
CommunityToolkit.Aspire.GoFeatureFlag 100% 97% 74
CommunityToolkit.Aspire.Hosting.ActiveMQ 70% 27% 144
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 100% 100% 22
CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps 100% 100% 28
CommunityToolkit.Aspire.Hosting.Bun 81% 71% 54
CommunityToolkit.Aspire.Hosting.Dapr 60% 51% 560
CommunityToolkit.Aspire.Hosting.Dapr.AzureRedis 93% 71% 54
CommunityToolkit.Aspire.Hosting.DbGate 63% 11% 62
CommunityToolkit.Aspire.Hosting.Deno 84% 75% 72
CommunityToolkit.Aspire.Hosting.EventStore 90% 71% 62
CommunityToolkit.Aspire.Hosting.GoFeatureFlag 59% 11% 62
CommunityToolkit.Aspire.Hosting.Golang 94% 50% 16
CommunityToolkit.Aspire.Hosting.Java 69% 72% 120
CommunityToolkit.Aspire.Hosting.LavinMQ 78% 50% 18
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.MailPit 89% 50% 14
CommunityToolkit.Aspire.Hosting.Meilisearch 61% 27% 94
CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 65% 38% 80
CommunityToolkit.Aspire.Hosting.Ngrok 52% 35% 82
CommunityToolkit.Aspire.Hosting.NodeJS.Extensions 90% 68% 92
CommunityToolkit.Aspire.Hosting.Ollama 65% 64% 198
CommunityToolkit.Aspire.Hosting.PapercutSmtp 92% 50% 10
CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions 70% 45% 88
CommunityToolkit.Aspire.Hosting.Python.Extensions 68% 53% 86
CommunityToolkit.Aspire.Hosting.RavenDB 64% 49% 176
CommunityToolkit.Aspire.Hosting.Redis.Extensions 68% 38% 80
CommunityToolkit.Aspire.Hosting.Rust 94% 83% 16
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 74% 62% 118
CommunityToolkit.Aspire.Hosting.Sqlite 96% 96% 50
CommunityToolkit.Aspire.MassTransit.RabbitMQ 100% 100% 30
CommunityToolkit.Aspire.Meilisearch 97% 92% 68
CommunityToolkit.Aspire.Microsoft.Data.Sqlite 37% 27% 194
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite 51% 50% 92
CommunityToolkit.Aspire.OllamaSharp 72% 69% 98
CommunityToolkit.Aspire.RavenDB.Client 60% 53% 237
Summary 69% (4975 / 7177) 53% (1478 / 2802) 3325

Minimum allowed line rate is 60%

@aaronpowell aaronpowell merged commit 943dcc1 into main Feb 24, 2025
82 checks passed
@aaronpowell aaronpowell deleted the test-runner-improvement branch February 24, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants