dotnet / dotnet/msbuild

Add two unit-tests for skipped targets with inputs but no outputs

Open
#7,362 2 comments 0 reactions 1 assignee Claimed by @edvilme View on GitHub
Area: Engine Area: Logging Area: Tests triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 6h
Merged PRs (30d)
139

Description

Building this project results in logging a `TaskParameterEventArgs` with `kind == SkippedTargetInputs`, where `itemType == null` and `Items == null`:
```xml


<_CodesignItems Include="foo" />


```

![image](https://user-images.githubusercontent.com/679326/152252832-37bd0c44-1e40-45bb-8df7-3f6150401484.png)

This other case results in a friendlier message:
```xml


```
![image](https://user-images.githubusercontent.com/679326/152252755-ae79c9d8-3062-4125-a391-bfd3b152103e.png)

The `TaskParameterEventArgs` is logged here:
https://github.com/dotnet/msbuild/blob/de1d7a295d709c3a748cc46cd5dc9bddd624ea46/src/Build/BackEnd/Components/RequestBuilder/TargetUpToDateChecker.cs#L357

The friendlier message is logged here:
https://github.com/dotnet/msbuild/blob/de1d7a295d709c3a748cc46cd5dc9bddd624ea46/src/Build/BackEnd/Components/RequestBuilder/TargetUpToDateChecker.cs#L483-L484

We should add a couple of tests for the above scenarios and perhaps avoid logging both `TaskParameterEventArgs` if the item array is empty.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.