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

[ci] Fix codeql build #5739

Merged
merged 6 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<!-- Used for running one helix job per test class -->
<Target Name="_ExtractTestClassNames"
Condition="'$(ExtractTestClassNamesForHelix)' == 'true'"
Condition="'$(ExtractTestClassNamesForHelix)' == 'true' and '$(ArchiveTests)' == 'true'"
Copy link
Member

Choose a reason for hiding this comment

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

Why are we building anything in the tests directory in this build configuration? If we don't want to do "test things", do we need to build the test assemblies?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good question. AFAICS, even if we have -p:Tests=false like used for the codeql build, it still builds the test assemblies because they are referenced from the sln.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't think it uses the sln, but instead uses:

<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true' and '$(DotNetBuild)' != 'true'">
<ProjectToBuild Include="$(RepoRoot)src\**\*.csproj" Exclude="$(RepoRoot)src\Aspire.ProjectTemplates\templates\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)eng\dcppack\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)eng\dashboardpack\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)playground\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)tests\**\*.csproj" />
</ItemGroup>

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh then we should definitely make building the tests conditional. I'll open an issue to track that work.

BeforeTargets="ZipTestArchive">

<Error Condition="'$(ExtractTestClassNamesPrefix)' == ''"
Expand Down
2 changes: 1 addition & 1 deletion tests/Shared/Playwright/Playwright.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.Playwright" />
</ItemGroup>

<Target Name="ProvisionBrowsersForPlaywright" AfterTargets="Build" Condition="'$(InstallBrowsersForPlaywright)' == 'true' and @(BrowsersForPlaywrightToInstall->Count()) > 0">
<Target Name="ProvisionBrowsersForPlaywright" AfterTargets="Build" Condition="'$(InstallBrowsersForPlaywright)' == 'true' and @(BrowsersForPlaywrightToInstall->Count()) > 0 and ('$(ArchiveTests)' == 'true' or '$(Test)' != 'false')">
<PropertyGroup>
<_MicrosoftPlaywrightDllPath>$(OutputPath)/Microsoft.Playwright.dll</_MicrosoftPlaywrightDllPath>
</PropertyGroup>
Expand Down
Loading