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

[tests] Add support for running EndToEnd tests on helix with the aspire workload #2534

Merged
merged 49 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9770c7d
testproject: Switch between Project and Package references
radical Feb 29, 2024
f62530d
testproject: Add support for skipping resources
radical Feb 29, 2024
99f6a42
Aspire.EndToEnd.Tests: update
radical Feb 29, 2024
bf1bb7d
Workload testing
radical Feb 29, 2024
116f4d0
Add common infrastructure code for workload testing
radical Feb 29, 2024
ce61861
Add bits to support preparing tests for helix
radical Feb 29, 2024
39472c8
remaining tidbits
radical Feb 29, 2024
949294f
CI: Build sdk+workload for sending to helix
radical Feb 29, 2024
ef410ff
testproject.AppHost: use Debug logging
radical Feb 29, 2024
9aaf1ec
cleanup
radical Feb 29, 2024
8649005
Use the version property in Directory.Packages.props
radical Mar 1, 2024
a976089
address review feedback from @ eerhardt
radical Mar 1, 2024
94a50c4
Rename TestsRunningOutOfTree -> TestsRunningOutsideOfRepo
radical Mar 1, 2024
56c4f2d
Bump Microsoft.NET.Runtime.WorkloadTesting.Internal to latest(9.0.0-p…
radical Mar 1, 2024
800ed52
address review feedback from @ eerhardt
radical Mar 1, 2024
28430fd
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 1, 2024
e5afe1b
fix merge
radical Mar 1, 2024
a2116d8
address review feedback from @ joperezr
radical Mar 1, 2024
a57a478
Move more workload testing bits into Aspire.Workload.Testing.*
radical Mar 2, 2024
149b6ff
dashboardpack.csproj: Remove a stale change which is not required now as
radical Mar 2, 2024
2705b8c
Add clarifying comment
radical Mar 2, 2024
c1b2b68
fix build
radical Mar 2, 2024
4199746
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 4, 2024
c6b9e56
dashboardpack.csproj - use just publish again
radical Mar 5, 2024
3f8cd92
Use build.sh instead of dotnet.sh to run InstallWorkloadUsingArtifact…
radical Mar 5, 2024
af1e0de
fix build
radical Mar 5, 2024
8dfe316
ensure helix.props gets patched before zip is generated for the tests
radical Mar 5, 2024
8072559
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 5, 2024
548a340
Set TEST_LOG_PATH so binlog from the testproject can be accessed
radical Mar 5, 2024
94e1d29
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 5, 2024
57bc07b
address review feedback from @ eerhardt
radical Mar 5, 2024
5be48e0
CI: Try adding back oracledb
radical Mar 5, 2024
a600106
address review feedback from @ eerhardt
radical Mar 5, 2024
ffa8b33
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 6, 2024
8434d15
address review feedback from @ eerhardt
radical Mar 6, 2024
d951135
Revert "CI: Try adding back oracledb"
radical Mar 6, 2024
64a9eb7
dcppack.csproj: Use intended targets for adding package files
radical Mar 6, 2024
e3e1a65
dashboardpack.csproj: avoid depending on private targets, addresses r…
radical Mar 6, 2024
f49215a
Aspire.csproj: Use the PackageType='' workaround only for CI when run…
radical Mar 6, 2024
bdb4081
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 6, 2024
0e79ba0
Use -pack with build step only on linux as it is needed only for e2e …
radical Mar 6, 2024
59085f9
[ci] helix: clean up docker containers before, and after a test run
radical Mar 6, 2024
5e4943b
[tests] increase e2e tests timeout from 5mins to 10mins
radical Mar 6, 2024
aff6eb7
Disable E2E tests for Pomelo : https://github.com/dotnet/aspire/issue…
radical Mar 7, 2024
02f5cf0
Skip pomelo resource, so VerifyHealthyOnIntegrationServiceA doesn't g…
radical Mar 7, 2024
4a0ea34
Merge remote-tracking branch 'origin/main' into e2e-testing-helix
radical Mar 7, 2024
c40da44
fix build
radical Mar 7, 2024
b390a0c
fix timeout typo
radical Mar 7, 2024
56b7c61
Correctly disable pomelo
radical Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Set RunSettingsFilePath property which is read by VSTest. -->
<RunSettingsFilePath>$(RepositoryEngineeringDir).runsettings</RunSettingsFilePath>
<RunSettingsFilePath Condition="'$(RunSettingsFilePath)' == ''">$(RepositoryEngineeringDir).runsettings</RunSettingsFilePath>
<!-- We don't want to use the workload for AppHost projects in this repo -->
<SkipAspireWorkloadManifest>true</SkipAspireWorkloadManifest>

<DashboardPublishedArtifactsOutputDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'DashboardArtifacts', '$(Configuration)'))</DashboardPublishedArtifactsOutputDir>
<WorkloadsPackageSource>$(ArtifactsShippingPackagesDir)</WorkloadsPackageSource>
</PropertyGroup>

<!-- OS/Architecture properties for local development resources -->
Expand All @@ -42,6 +43,7 @@
<DcpDir>$(NuGetPackageRoot)microsoft.developercontrolplane.$(BuildOs)-$(BuildArch)/$(MicrosoftDeveloperControlPlanedarwinamd64PackageVersion)/tools/</DcpDir>

<TestArchiveTestsDir>$([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'helix', 'tests'))</TestArchiveTestsDir>
<TestArchiveTestsDirForWorkloadTests Condition="'$(TestArchiveTestsDirForWorkloadTests)' == ''">$([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'helix', 'workload-tests'))</TestArchiveTestsDirForWorkloadTests>
<!-- TODO: Need to figure out we can automatically detect target framework here. This property
is specified to support dashboard path metadata generation on the inner loop. -->
<AspireDashboardDir>$(MSBuildThisFileDirectory)/artifacts/bin/Aspire.Dashboard/$(Configuration)/net8.0/</AspireDashboardDir>
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<ReadMePath>$(MSBuildProjectDirectory)\README.md</ReadMePath>
<ReadMeExists Condition="Exists('$(ReadMePath)')">true</ReadMeExists>
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' And '$(ReadMeExists)' == 'true'">README.md</PackageReadmeFile>

<TestArchiveTestsDir Condition="'$(IsWorkloadTestProject)' == 'true'">$(TestArchiveTestsDirForWorkloadTests)</TestArchiveTestsDir>
</PropertyGroup>

<PropertyGroup>
Expand Down
5 changes: 4 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project>
<!-- Workaround https://github.com/dependabot/dependabot-core/issues/8490 -->
<Import Project="eng/Versions.props" Condition="'$(MajorVersion)' == ''"/>
<!-- This file gets imported for out-of-tree test runs also where eng/Versions.props isn't
available -->
<Import Project="eng/Versions.props" Condition="'$(MajorVersion)' == '' and Exists('eng/Versions.props')"/>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
Expand Down Expand Up @@ -126,6 +128,7 @@
<!-- unit test dependencies -->
<PackageVersion Include="bUnit" Version="1.26.64" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Testing" Version="$(MicrosoftExtensionsDiagnosticsTestingPackageVersion)" />
<PackageVersion Include="Microsoft.NET.Runtime.WorkloadTesting.Internal" Version="$(MicrosoftNETRuntimeWorkloadTestingInternalVersion)" />
<PackageVersion Include="Testcontainers.RabbitMq" Version="3.7.0" />
<!-- Pinned version for Component Governance - Remove when root dependencies are updated -->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
9 changes: 9 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@
<!-- Begin: Package sources from dotnet-runtime -->
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<!-- TEST_RESTORE_SOURCES_INSERTION_LINE -->
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<add key="orleans-nightly" value="https://orleans.pkgs.visualstudio.com/orleans-public/_packaging/orleans-nightly/nuget/v3/index.json" />
<add key="dotnet9-transport" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet9-transport/nuget/v3/index.json" />
<add key="azure-sdk-for-net-dev" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<!-- used for installing test workloads for resolving aspire workload manifest -->
<packageSource key="nuget-local">
Copy link
Member

Choose a reason for hiding this comment

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

Where is this package source defined?

Copy link
Member Author

Choose a reason for hiding this comment

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

https://github.com/dotnet/runtime/blob/f135699310bccfa83b3b441d2f4f1571fe8df480/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs#L262

I agree that it does seem odd that you can't directly see what this links up to in the repo. I can have the package source name be passed to the task, which would be in aspire repo.

Copy link
Member

Choose a reason for hiding this comment

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

Does this throw a warning at all on the initial restore before the task has a chance to replace the source? Did we also consider manually passing in -s <path> to a manual invocation of restore instead of having this in the config?

Copy link
Member Author

Choose a reason for hiding this comment

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

No warnings. Wouldn't -s path only add a package source but not the mapping, and because of that restoring from the source would fail. That is what I hit when I removed this mapping.

Copy link
Member Author

Choose a reason for hiding this comment

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

Once dotnet/runtime#99277 is merged this entry can be removed, and it would be added at build time.

<package pattern="*Aspire*" />
</packageSource>
<packageSource key="dotnet9-transport">
<package pattern="*WorkloadBuildTasks*" />
</packageSource>
<packageSource key="azure-sdk-for-net-dev">
<package pattern="Azure.Provisioning" />
<package pattern="Azure.ResourceManager" />
Expand Down
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>5535e31a712343a63f5d7d796cd874e563e5ac14</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.WorkloadTesting.Internal" Version="9.0.0-preview.3.24151.4">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>50d6e5d5ffd05dd4034cffd222ea610baedcc326</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.OpenApi" Version="8.0.2">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>
<Sha>da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644</Sha>
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
<MicrosoftEntityFrameworkCoreDesignPackageVersion>8.0.2</MicrosoftEntityFrameworkCoreDesignPackageVersion>
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>8.0.2</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreToolsPackageVersion>8.0.2</MicrosoftEntityFrameworkCoreToolsPackageVersion>
<MicrosoftNETRuntimeWorkloadTestingInternalVersion>9.0.0-preview.3.24151.4</MicrosoftNETRuntimeWorkloadTestingInternalVersion>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions eng/dashboardpack/dashboardpack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<Target Name="Build" />

<Target Name="BeforeBuild" BeforeTargets="Build">
<Target Name="BeforeBuild" BeforeTargets="_GetPackageFiles">
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this change? In general, it's best to avoid depending on "private" tragets (Targets that start with an underscore)

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to limit this target to only when we are generating a nuget.

Is this target needed only for generating the zip file? Is the zip file used for the dashboard docker image?

Copy link
Member

Choose a reason for hiding this comment

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

This target mainly accomplishes two things:

  • Adds the right content to the each of the dashboard packs (which actually may no longer be needed now that we have the dashboard as a tool) cc: @danegsta
  • Zips up the published output as that will be uploaded as a blob so that it can then be used to build the docker image for the dashboard.

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted.

<MSBuild Projects="../../src/Aspire.Dashboard/Aspire.Dashboard.csproj" Targets="publish" Properties="Configuration=$(Configuration);Platform=$(Platform);TargetFramework=$(TargetFramework);RuntimeIdentifier=$(DashboardRuntime)" />

<!-- After publishing the project, we ensure that the published assets get packed in the nuspec. -->
Expand All @@ -36,7 +36,7 @@
</ItemGroup>

<MakeDir Directories="$(DashboardPublishedArtifactsOutputDir)/$(DashboardRuntime)" />
<ZipDirectory SourceDirectory="$(DotNetOutputPath)Aspire.Dashboard/$(Configuration)/$(TargetFramework)/$(DashboardRuntime)/publish" DestinationFile="$(DashboardPublishedArtifactsOutputDir)/$(DashboardRuntime)/aspire-dashboard-$(DashboardRuntime).zip" />
<ZipDirectory SourceDirectory="$(DotNetOutputPath)Aspire.Dashboard/$(Configuration)/$(TargetFramework)/$(DashboardRuntime)/publish" DestinationFile="$(DashboardPublishedArtifactsOutputDir)/$(DashboardRuntime)/aspire-dashboard-$(DashboardRuntime).zip" Overwrite="true" />

<!-- Throw an error if _PublishItems is empty. -->
<Error Condition="'@(_PublishItems)' == ''" Text="No files were found to pack. Ensure that the project being packed has a publish target defined." />
Expand All @@ -48,4 +48,4 @@
<None Include="UnixFilePermissions.xml" Pack="true" PackagePath="data/" Condition=" '$(DashboardPlatformType)' == 'Unix' " />
</ItemGroup>

</Project>
</Project>
12 changes: 10 additions & 2 deletions eng/dcppack/dcppack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@

<Target Name="Build" />

<Target Name="AddPackageFiles" BeforeTargets="_GetPackageFiles">
<ItemGroup>
<DcpFiles Include="$(NuGetPackageRoot)microsoft.developercontrolplane.$(DcpPlatform)/$(MicrosoftDeveloperControlPlanedarwinamd64PackageVersion)/tools/**/*" />
<None Include="@(DcpFiles)" Pack="true" PackagePath="tools/" />
</ItemGroup>

<Error Condition="@(DcpFiles->Count()) == 0" Text="No dcp files found in :$(NuGetPackageRoot)microsoft.developercontrolplane.$(DcpPlatform)/$(MicrosoftDeveloperControlPlanedarwinamd64PackageVersion)/tools" />
</Target>

<ItemGroup>
<None Include="$(NuGetPackageRoot)Microsoft.DeveloperControlPlane.$(DcpPlatform)/$(MicrosoftDeveloperControlPlanedarwinamd64PackageVersion)/tools/**/*" Pack="true" PackagePath="tools/" />
<None Include="Sdk.props" Pack="true" PackagePath="Sdk/" />
<None Include="Sdk.in.targets" PerformTextReplacement="True" Pack="true" PackagePath="Sdk/" />
<None Include="Aspire.Hosting.Orchestration.props" pack="true" PackagePath="build/$(PackageId).props" />
Expand All @@ -52,4 +60,4 @@
<TextReplacementValue Include="RUNTIME" NewValue="$(DcpRuntime)" />
</ItemGroup>

</Project>
</Project>
13 changes: 12 additions & 1 deletion eng/pipelines/templates/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ parameters:
steps:
- script: ${{ parameters.buildScript }}
-restore -build
-pack
Copy link
Member

Choose a reason for hiding this comment

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

We are already running pack as a separate step (check line 98 in this file). Can we either change the ordering so that happens before the steps that run the tests, or alternatively just remove that whole step if it is no longer needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. This pack could conflict with the subsequent pack, since that one is signed. I will investigate this in a separate PR. And it will really be needed only when we have this running on windows again.
For now, I will add -pack only for linux, where the separate pack step is not defined at all.

-configuration ${{ parameters.buildConfig }}
/p:ArchiveTests=true
/bl:${{ parameters.repoLogPath }}/build.binlog
Expand All @@ -42,10 +43,20 @@ steps:
displayName: Publish non-helix TestResults
condition: always()

- ${{ if ne(parameters.isWindows, 'true') }}:
# E2E tests are disabled on windows for now
- script: ${{ parameters.buildScript }}
-p:ContinuousIntegrationBuild=true
-p:Configuration=${{ parameters.buildConfig }}
-p:TriggerInstallWorkloadForTesting=true
-bl:${{ parameters.repoLogPath }}/WorkloadInstallForTesting.binlog
--projects $(Build.SourcesDirectory)/tests/Aspire.EndToEnd.Tests/Aspire.EndToEnd.Tests.csproj
displayName: Install sdk+workload for testing

- template: /eng/pipelines/templates/send-to-helix.yml
parameters:
HelixProjectPath: '$(Build.SourcesDirectory)/tests/send-to-helix.proj'
HelixProjectArguments: /p:RunWithCodeCoverage=true /p:RepoTestResultsPath=${{ parameters.repoTestResultsPath }}
HelixProjectArguments: /p:Configuration=${{ parameters.buildConfig }} /p:RunWithCodeCoverage=true /p:RepoTestResultsPath=${{ parameters.repoTestResultsPath }}

${{ if eq(parameters.isWindows, 'true') }}:
${{ if eq(variables['System.TeamProject'], 'public') }}:
Expand Down
10 changes: 4 additions & 6 deletions eng/workloads/workloads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<VSTemp>$(WorkloadIntermediateOutputPath)VS/</VSTemp>
<WorkloadOutputPath>$(ArtifactsBinDir)workloads/</WorkloadOutputPath>
<WorkloadOutputPath Condition="'$(workloadArtifactsPath)' != ''">$(workloadArtifactsPath)/</WorkloadOutputPath>
<PackageSource>$(ArtifactsShippingPackagesDir)</PackageSource>
<PackageSource Condition="'$(workloadPackagesPath)' != ''">$(workloadPackagesPath)/</PackageSource>
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that this cannot get overriden any longer? cc: @danegsta in case he is aware if we depend on this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Where does $(workloadPackagesPath) get set? I didn't find any reference to it in the repo.

Copy link
Member

Choose a reason for hiding this comment

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

Should be fine as long as the workload still builds correctly

<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>

Expand Down Expand Up @@ -75,11 +73,11 @@
</ShortNames>
</ItemGroup>

<MSBuild Projects="../dashboardpack/dashboardpack.csproj" Targets="restore;build" Properties="DashboardRuntime=%(_PackRuntimes.Identity);PackageOutputPath=$(PackageSource)" />
<MSBuild Projects="../dcppack/dcppack.csproj" Targets="restore;build" Properties="DcpRuntime=%(_PackRuntimes.Identity);PackageOutputPath=$(PackageSource)" />
<MSBuild Projects="../dashboardpack/dashboardpack.csproj" Targets="restore;build" Properties="DashboardRuntime=%(_PackRuntimes.Identity);PackageOutputPath=$(WorkloadsPackageSource)" />
<MSBuild Projects="../dcppack/dcppack.csproj" Targets="restore;build" Properties="DcpRuntime=%(_PackRuntimes.Identity);PackageOutputPath=$(WorkloadsPackageSource)" />

<ItemGroup>
<ManifestPackages Include="$(PackageSource)Microsoft.NET.Sdk.Aspire.Manifest*.nupkg"
<ManifestPackages Include="$(WorkloadsPackageSource)Microsoft.NET.Sdk.Aspire.Manifest*.nupkg"
MsiVersion="$(MsiVersion)"
SupportsMachineArch="true" />
</ItemGroup>
Expand All @@ -89,7 +87,7 @@
BaseOutputPath="$(WorkloadOutputPath)"
EnableSideBySideManifests="true"
ComponentResources="@(ComponentResources)"
PackageSource="$(PackageSource)"
PackageSource="$(WorkloadsPackageSource)"
ShortNames="@(ShortNames)"
WorkloadManifestPackageFiles="@(ManifestPackages)"
WixToolsetPath="$(WixToolsetPath)"
Expand Down
3 changes: 3 additions & 0 deletions src/Microsoft.NET.Sdk.Aspire/Microsoft.NET.Sdk.Aspire.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<PropertyGroup>
<PackageId>$(PackageId).Manifest-$(DotNetAspireManifestVersionBand)</PackageId>
<Description>.NET Aspire workload manifest</Description>

<!-- this allows installing the manifest as a nuget, which is useful for testing -->
<PackageType />
Copy link
Member

Choose a reason for hiding this comment

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

Just Curious, does this change anything in the nuspec?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this removes:

    <packageTypes>
      <packageType name="DotnetPlatform" />
    </packageTypes>

.. from the nuspec. I checked other manifest nugets and they do have this specified, but I skipped this for the mono/wasm manifests, and it hasn't been an issue.

In a follow up for dotnet/runtime, I can change the way the nuget is installed which would remove the need for PackageType to be ''.

Copy link
Member

Choose a reason for hiding this comment

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

mmm, I suppose this property is set via Arcade. It would be good to check what the implications of that are with someone from coreeng team.

</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions src/Shared/Workload.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<VersionBand Condition=" '$(VersionBand)' == '' ">$([System.Text.RegularExpressions.Regex]::Match($(MicrosoftDotnetSdkInternalPackageVersion), `^\d+\.\d+\.\d`))00</VersionBand>
<!-- When we are ready to produce Workloads targeting the stable SDK band, set UseStableSdkBand to true. Otherwise, it will match the SDK preview band. -->
<UseStableSdkBand>true</UseStableSdkBand>
<DotNetVersionBand Condition=" '$(UseStableSdkBand)' != 'true' ">$(VersionBand)$([System.Text.RegularExpressions.Regex]::Match($(MicrosoftDotnetSdkInternalPackageVersion), `\-(preview|rc|alpha|rtm).\d+`))</DotNetVersionBand>
<DotNetVersionBand Condition="'$(UseStableSdkBand)' == 'true'">$(VersionBand)</DotNetVersionBand>
<DotNetAspireManifestVersionBand>$(DotNetVersionBand)</DotNetAspireManifestVersionBand>
</PropertyGroup>
</Project>
8 changes: 2 additions & 6 deletions src/Shared/Workload.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project>
<Import Project="Workload.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageType>DotnetPlatform</PackageType>
Expand All @@ -12,13 +14,7 @@
<DotNetOutputPath>$(RepoRoot)artifacts/bin/</DotNetOutputPath>
<DotNetDirectory>$(DotNetOutputPath)dotnet/</DotNetDirectory>
<DotNetPacksDirectory>$(DotNetDirectory)packs/</DotNetPacksDirectory>
<VersionBand Condition=" '$(VersionBand)' == '' ">$([System.Text.RegularExpressions.Regex]::Match($(MicrosoftDotnetSdkInternalPackageVersion), `^\d+\.\d+\.\d`))00</VersionBand>
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, why extract only those properties and not the rest?

Copy link
Member Author

Choose a reason for hiding this comment

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

The extracted properties define the version, and band used for the workload. The remaining properties are relevant to the various projects that import it for building packages. Some of these common properties could still be moved to the props file, but not all.

<!-- When we are ready to produce Workloads targeting the stable SDK band, set UseStableSdkBand to true. Otherwise, it will match the SDK preview band. -->
<UseStableSdkBand>true</UseStableSdkBand>
<DotNetVersionBand Condition=" '$(UseStableSdkBand)' != 'true' ">$(VersionBand)$([System.Text.RegularExpressions.Regex]::Match($(MicrosoftDotnetSdkInternalPackageVersion), `\-(preview|rc|alpha|rtm).\d+`))</DotNetVersionBand>
<DotNetVersionBand Condition="'$(UseStableSdkBand)' == 'true'">$(VersionBand)</DotNetVersionBand>
<DotNetSdkManifestsFolder>$(DotNetVersionBand)</DotNetSdkManifestsFolder>
<DotNetAspireManifestVersionBand>$(DotNetVersionBand)</DotNetAspireManifestVersionBand>
<_AspireDotNetVersionMajor>8</_AspireDotNetVersionMajor>
<_AspireDotNetVersionMinor>0</_AspireDotNetVersionMinor>
<_AspireDotNetVersion>$(_AspireDotNetVersionMajor).$(_AspireDotNetVersionMinor)</_AspireDotNetVersion>
Expand Down
23 changes: 23 additions & 0 deletions tests/Aspire.EndToEnd.Tests/.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<!-- Timeout in ms, 15 minutes -->
<TestSessionTimeout>900000</TestSessionTimeout>
<!-- Filter out failing (wrong framework, platform, runtime or activeissue) tests -->
<TestCaseFilter>category!=failing</TestCaseFilter>
</RunConfiguration>
<LoggerRunSettings>
<Loggers>
<Logger friendlyName="trx">
<Configuration>
<LogFileName>TestResults.trx</LogFileName>
</Configuration>
</Logger>
<Logger friendlyName="console">
<Configuration>
<Verbosity>normal</Verbosity>
</Configuration>
</Logger>
</Loggers>
</LoggerRunSettings>
</RunSettings>
23 changes: 22 additions & 1 deletion tests/Aspire.EndToEnd.Tests/Aspire.EndToEnd.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@

<PropertyGroup>
<TargetFramework>$(NetCurrent)</TargetFramework>

<!-- no docker support on helix/windows yet -->
<RunTestsOnHelix Condition="'$(OS)' != 'Windows_NT'">true</RunTestsOnHelix>
<SkipTests Condition="'$(OS)' == 'Windows_NT'">true</SkipTests>
Comment on lines +6 to +8
Copy link
Member

Choose a reason for hiding this comment

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

Can we just say RunTestsOnHelix=true all the time, and then do these checks inside the tests? Similar to how I did it in RabbitMQ in #2345. It just feels cleaner that way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we can do it like that also. The reason for "also" is that if we don't have any tests that would get run, then not skipping the whole thing would mean:

  1. installing sdk+workload - extra step on CI
  2. sending this work item to helix with the big payload (sdk) for nothing to run, which dnceng kinda frowns upon.

I think we can add the attributes also, and for the specific case (windows) where nothing can run, we skip in the project file too. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

How long until we are able to run these tests on Windows?


<!-- no docker support on helix/windows yet -->
<TestUsingWorkloads Condition="! ('$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT')">true</TestUsingWorkloads>
<InstallWorkloadForTesting>$(TestUsingWorkloads)</InstallWorkloadForTesting>

<BuiltNuGetsDir>$(ArtifactsShippingPackagesDir)</BuiltNuGetsDir>
<PackageVersionForWorkloadManifests>$(PackageVersion)</PackageVersionForWorkloadManifests>
<DefineConstants Condition="'$(TestsRunningOutsideOfRepo)' == 'true'">TESTS_RUNNING_OUTSIDE_OF_REPO;$(DefineConstants)</DefineConstants>

<XunitRunnerJson>xunit.runner.json</XunitRunnerJson>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\testproject\Common\TestResourceNames.cs" />
<Compile Include="..\Shared\WorkloadTesting\*.cs" Link="WorkloadTestingCommon" />

<None Include="..\testproject\**\*" Link="testassets\testproject\%(RecursiveDir)%(FileName)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(PatchedNuGetConfigPath)" Link="testassets\testproject\nuget.config" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(RepoRoot)Directory.Packages.props" Link="testassets\testproject\Directory.Packages.repo.props" CopyToOutputDirectory="PreserveNewest" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions tests/Aspire.EndToEnd.Tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<IsHelixOnlyTestProject>true</IsHelixOnlyTestProject>
<IsWorkloadTestProject>true</IsWorkloadTestProject>
<RunSettingsFilePath>$(MSBuildThisFileDirectory).runsettings</RunSettingsFilePath>
</PropertyGroup>

<Import Project="..\Directory.Build.props" />
</Project>
Loading