-
Notifications
You must be signed in to change notification settings - Fork 543
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
[tests] Move more tests to helix by overriding dcp path from assembly metadata #5215
Conversation
…ble ASPIRE_DCP_DIR .. and instead of separate values for `DcpCliPath`, `DcpExtensionsPath`, and `DcpBinPath`, use a single `DcpDir` path to compute all of them.
1775a96
to
23e182e
Compare
src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.targets
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting/Dcp/DcpOptions.cs
Outdated
@@ -113,16 +111,22 @@ public void Configure(DcpOptions options) | |||
var dcpPublisherConfiguration = configuration.GetSection(DcpPublisher); | |||
var assemblyMetadata = appOptions.Assembly?.GetCustomAttributes<AssemblyMetadataAttribute>(); | |||
|
|||
if (!string.IsNullOrEmpty(dcpPublisherConfiguration[nameof(options.CliPath)])) |
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.
Are there any backwards compatibility concerns we need to maintain here? For example, if someone used an 8.1
Aspire.Hosting.AppHost package and an 8.2
Aspire.Hosting package, I think this would break. Are we concerned about that level of mismatch?
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.
Yep.
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.
One option would be to retain the 3 paths in the metadata as-is, but when DcpPublisher__CliPath
is set then override the 3 paths based on the cliPath
.
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.
Made the change.
tests/Aspire.Azure.AI.OpenAI.Tests/Aspire.Azure.AI.OpenAI.Tests.csproj
Outdated
Show resolved
Hide resolved
… environment variables instead of introducing a new one
@karolz-ms @danegsta This PR changes the behavior when you specify |
.. props file. This allows project builds where test packages are added by default to work by providing the package versions for those packages.
…g metadata keys to prevent breaking backwards compat
tests/Aspire.Hosting.Milvus.Tests/Aspire.Hosting.Milvus.Tests.csproj
Outdated
Show resolved
Hide resolved
That should be just fine. |
</PropertyGroup> | ||
|
||
<Target Name="BuildHelixWorkItemsForDefaultTests"> | ||
<ItemGroup> | ||
<!-- needed for Aspire.Hosting.Container.Tests --> | ||
<HelixPreCommand Include="$(_EnvVarSetKeyword) DOCKER_BUILDKIT=1" /> |
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.
Is it possible to put this in the Hosting.Container.Tests so it doesn't need to be set everywhere?
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.
Would that be useful? Right now it would have to be by conditionally adding it on the work item itself.
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.
My thinking is that we wouldn't need a comment like <!-- needed for Aspire.Hosting.Container.Tests -->
if it was in the Aspire.Hosting.Container.Tests project.
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.
Agreed. In the follow up I'm generating run scripts which would allow individual test projects to control their own setups directly.
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.
Awesome! Nice work, let's get this in.
Description
AppHost
build embeds metadata with paths forDcpCliPath
,DcpExtensionsPath
, andDcpBinPath
. This ties the apphost to the machine that it was built on.This PR:
DcpPublisher:CliPath
is available from the configuration, set the other two paths based on that.$(RunTestsOnHelix)=true
the default.This allows running most of the tests on helix. The remaining ones depend on being able to run the test projects which doesn't work on helix because the path to the project files is embedded in the assembly metadata.
Also, download helix test result
.trx
files to have all the.trx
files available inartifacts
.Contributes to #2036 .
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow