-
Notifications
You must be signed in to change notification settings - Fork 563
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
[CI] Enable Workload tests for PR validation #7939
Conversation
67059c6
to
779d04c
Compare
Can you rename these tests while you’re at it |
.. and use independent jobs to get list of tests for Windows, and Linux.
.. and disable tests that need that, on windows/ci.
ec89e29
to
9e765f4
Compare
I'll have a separate PR for that. There are a whole bunch of places with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR enables Workload tests for PR validation by adding SSL certificate requirements to tests and updating the CI workflows and test project configurations. The key changes include:
- New SSL certificate attribute and trait discoverer to gate tests on proper environment support.
- Updates to composite GitHub actions and workflows to generate test matrices for both template and general tests.
- Modifications to several test projects, including renaming a base test class and adding the new SSL requirement attribute.
Reviewed Changes
File | Description |
---|---|
tests/Aspire.Components.Common.Tests/RequiresSSLCertificateAttribute.cs | Adds attribute to require SSL certificate for tests. |
tests/Aspire.Components.Common.Tests/RequiresSSLCertificateDiscoverer.cs | Implements trait discovery based on SSL certificate support. |
.github/actions/enumerate-template-tests/action.yml | Defines composite action for enumerating workload tests. |
.github/actions/enumerate-tests/action.yml | Defines composite action for enumerating test projects. |
.github/workflows/template-tests.yml & .github/workflows/run-tests.yml | Updates workflows to incorporate test matrix generation and execution. |
tests/Aspire.Workload.Tests/StarterTemplateProjectNamesTests.cs | Refactors the test class to be abstract and updates test data generation. |
tests/Aspire.Workload.Tests/StarterTemplateWithRedisCacheTests.cs & related PreviousTFM file | Adds SSL certificate requirement; note potential naming duplication. |
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
tests/Aspire.Workload.Tests/StarterTemplateWithRedisCacheTests.cs:9
- [nitpick] The class name 'StarterTemplateWithWithRedisCacheTests' contains a duplicated 'With'. Consider renaming it to 'StarterTemplateWithRedisCacheTests' for clarity.
[RequiresDocker("Needs docker to start redis cache")]
[RequiresSSLCertificate]
public class StarterTemplateWithWithRedisCacheTests : StarterTemplateRunTestsBase<StarterTemplateWithRedisCacheFixture>
tests/Aspire.Workload.Tests/StarterTemplateWithWithRedisCacheTests_PreviousTFM.cs:9
- [nitpick] The class name 'StarterTemplateWithWithRedisCacheTests_PreviousTFM' includes a duplicated 'With'. Consider renaming it to 'StarterTemplateWithRedisCacheTests_PreviousTFM' to eliminate redundancy.
[RequiresDocker("Needs docker to start redis cache")]
[RequiresSSLCertificate]
public class StarterTemplateWithWithRedisCacheTests_PreviousTFM : StarterTemplateRunTestsBase<StarterTemplateWithRedisCacheFixture_PreviousTFM>
tests/Aspire.Workload.Tests/StarterTemplateProjectNamesTests.cs
Outdated
Show resolved
Hide resolved
@eerhardt The |
Currently, we build the packages on each of the template test jobs to save time, instead of building once and uploading+downloading in the test jobs. |
We can explore using https://github.com/actions/cache in a follow-up. |
tests/Aspire.Workload.Tests/StarterTemplateProjectNamesTests.cs
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
// Individual class for each test framework so the tests can run in separate helix jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these split, but BuildAndRunTemplateTests aren't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These had a natural split based on the template argument for the test type. I can split the others in a follow up based on how long they take to run. But that timing will be affected once we start using the actions/cache
.
testSessionTimeoutMs: 1200000 | ||
testHangTimeout: 12m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a 20 minute session timeout, is having 12 minute timeout for each test too much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests do multiple builds, and runs of the project. I was using a 7m timeout earlier, but because of those tests I had to bump it.
# Duplicated jobs so their dependencies are not blocked on both the | ||
# setup jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do the setup jobs take long enough to justify this duplication? how long are we talking about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On some runs (yesterday for example) it was 40s vs 4m.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 minutes to gather which tests to run??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was nuget restore taking time essentially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I wonder if splitting this is actually going to help or hurt, since now it is 2 machines doing the restore instead of 1.
The failing test is unrelated - #8013 . Re-running that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in so these tests are protected. We can make fix ups if necessary afterwards.
enumerate-template-tests
Integration
, andTemplate
workflows.With this PR the
setup
jobs run independently for each OS, thus allowing their test jobs to start running immediately. This helps because Windows job can be a little slower, and doesn't block the Linux test jobs.Fixes #7583 .