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

Use dotnet publish instead of ArchiveTests target #37954

Open
ViktorHofer opened this issue Jun 16, 2020 · 7 comments
Open

Use dotnet publish instead of ArchiveTests target #37954

ViktorHofer opened this issue Jun 16, 2020 · 7 comments
Labels
area-Infrastructure-libraries backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity
Milestone

Comments

@ViktorHofer
Copy link
Member

ViktorHofer commented Jun 16, 2020

At the moment we don't publish (framework dependent) our test projects and instead just build them and then zip them up. To make different publish modes possible (ie self-contained for code coverage), we want to use dotnet publish instead and use its output as the test payload.

I don't know if dotnet publish supports creating a zip file but if not, we could do that in sendtohelix.proj.

Relevant code path:

<!-- Archive test binaries. -->
<Target Name="ArchiveTests"
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'"
AfterTargets="PrepareForRun"
DependsOnTargets="GenerateRunScript">
<Error Condition="'$(TestArchiveTestsDir)' == ''" Text="TestArchiveTestsDir property to archive the test folder must be set." />
<MakeDir Directories="$(TestArchiveTestsDir)" />
<ZipDirectory SourceDirectory="$(OutDir)"
DestinationFile="$([MSBuild]::NormalizePath('$(TestArchiveTestsDir)', '$(TestProjectName).zip'))"
Overwrite="true" />
</Target>

In addition to that we could experiment with publishing (and incrementally restoring and building) the test projects inside sendtohelix.proj so that the output paths are known and get rid of the well known publish location.

cc @safern @Anipik

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Jun 16, 2020
@ghost
Copy link

ghost commented Jun 16, 2020

Tagging subscribers to this area: @safern, @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@safern
Copy link
Member

safern commented Jun 16, 2020

We could also do dotnet publish and then zip it up ( similar to what we do for mobile targets) doing the zip in sendtohelix.proj doesn’t seem like the best place but that could work as well.

@ViktorHofer
Copy link
Member Author

The only reason we compress the publish directory, is to send it to helix, right? That's why I played with the idea of doing that in sendtohelix.proj. It sequencing it into the publish target would mean that we would either always compress it (which we shouldn't) or again need a flag to express that (which ideally we wouldn't need).

That said, this sounds like an implementation detail, I'm fine with any solution as long as we use the publish directory instead of the bin directory.

@safern
Copy link
Member

safern commented Jun 16, 2020

The only reason we compress the publish directory, is to send it to helix, right? That's why I played with the idea of doing that in sendtohelix.proj.

Yeah, but sentohelix.proj is already getting complicated enough (after addition to run coreclr stress tests) and I would like those to be decoupled, I think it is better to have that as part of the test vertical. The flag won't go away as we will still need this for wasm, so I don't mind having to pass in an extra flag.

Also, for sending manual helix jobs is helpful as well since I can just do dotnet build /p:ArchiveTests=true in an individual project and then use that for other purposes.

Compressing the testhost directory happens in sendtohelix.proj since that is just executed once and not for every project we have, so that's why I think it makes sense to make it a target that test projects have available and also consistency with wasm and other platforms.

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Jun 16, 2020

Also, for sending manual helix jobs is helpful as well since I can just do dotnet build /p:ArchiveTests=true in an individual project and then use that for other purposes.

Sure, if we want to continue using the extra property then you would do dotnet publish /p:ArchiveTests=true locally.

As said, this is an implementation detail, I'm fine with any solution that makes sense.

@safern
Copy link
Member

safern commented Jun 16, 2020

Sounds good. Just wanted to highlight my opinion there since the issue description mentioned removing the per-test target to generate the archives.

@ViktorHofer ViktorHofer added this to the Future milestone Jul 8, 2020
@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2020
Copy link
Contributor

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-libraries backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity
Projects
None yet
Development

No branches or pull requests

3 participants