Skip to content

Do not validate queues unless Test target is called - #4107

Closed
krwq wants to merge 1 commit into
masterfrom
krwq-patch-1
Closed

krwq wants to merge 1 commit into
masterfrom
krwq-patch-1

Conversation

@krwq

@krwq krwq commented Oct 11, 2019

Copy link
Copy Markdown
Member

This allows us running different test projects on different queues in IoT repo (i.e. hardware dependent tests on ARM32 and hardware independent on AMD64 which are faster)

@krwq
krwq requested a review from safern October 11, 2019 22:57
@safern

safern commented Oct 11, 2019

Copy link
Copy Markdown
Member

cc: @alexperovich @jonfortescue

@safern safern left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@alexperovich

Copy link
Copy Markdown
Member

This allows us running different test projects on different queues in IoT repo (i.e. hardware dependent tests on ARM32 and hardware independent on AMD64 which are faster)

How exactly does this change allow you to do this? This check needs to be where it is because none of the other targets are tested with empty target queues. It also makes no sense to run anything if there are no target queues.

@krwq

krwq commented Oct 14, 2019 •

Copy link
Copy Markdown
Member Author

@alexperovich, example scenario:

We have two subsets of tests:

U - unit tests - they should run on faster setup, i.e. ADM64
H - hardware tests - they need to run on ARM32

Inside of our project we create property: RunHardwareTests which runs H when set to true or U when set to anything else.
In our project we have a target RunAllTests which runs our project twice (calling msbuild task): 1. RunHardwareTests=true; RunHardwareTests=false.

You'd expect above to work but it turns out that even though the Test target is not called the build fails because RunAllTests fails the check I fixed in here because ValidateTargetQueues is run regardless if Test is being run or not. The fix here moves this target to run only when tests are being run.

@alexperovich

Copy link
Copy Markdown
Member

Why do you need to build the project twice with different properties. And one of these invocations isn't expected to do anything?

Just have the project figure out what queue to send to based on if it is a hardware test or not.

@krwq

krwq commented Oct 14, 2019

Copy link
Copy Markdown
Member Author

@alexperovich currently there is no way to assign some projects to some queues. You have to assign all projects to all queues which won't work here correctly

@alexperovich

Copy link
Copy Markdown
Member

What do you mean? Assign some projects to some queues? The HelixTargetQueue items are per project.

@krwq

krwq commented Oct 15, 2019 •

Copy link
Copy Markdown
Member Author

I.e. here https://github.com/dotnet/iot/blob/master/eng/sendToHelix.proj#L42 doesn't seem HelixTargetQueue is in any way related to XUnitProject - could you show an example on how would you achieve what you described? It seems to relate whole XunitProject item group with the HelixTargetQueue item group and can't see any per project properties

@alexperovich

Copy link
Copy Markdown
Member

So, you have a set of XUnit projects, and some of them need to run on ARM64 and some on ARM32 right? I would put both target queues in the sendToHelix.proj, then condition the XUnitProject includes on "Should this project run on this queue" e.g.

<HelixTargetQueue Include="Windows.10.Arm32.Iot"/>
<HelixTargetQueue Include="Windows.10.Arm64.Iot"/>

... later ...

<XUnitProject Condition=" '$(HelixTargetQueue)' == 'Windows.10.Arm32.Iot'" Include="HardwareTests.csproj"/>
<XUnitProject Condition=" '$(HelixTargetQueue)' == 'Windows.10.Arm64.Iot'" Include="NonHardwareTests.csproj"/>

You could also condition both items on a $(RunHardwareTests) property if that works better for you.

@krwq

krwq commented Oct 15, 2019

Copy link
Copy Markdown
Member Author

Thanks @alexperovich! I still think this validation regardless of the target is incorrect so I'll leave the PR open

@alexperovich

Copy link
Copy Markdown
Member

The issue is that a Helix SDK project is malformed if it has no target queues set, it will not do anything useful. This validation is important to catch this error before trying to build/restore anything. That operation can take time. Validating the queues as an InitialTarget makes the error happen as soon as it can possibly happen.

@JohnTortugo

Copy link
Copy Markdown
Contributor

Ping. Is this something that we want to merge?

@alexperovich

Copy link
Copy Markdown
Member

I still agree with my past self. A helix project is not well formed if it doesn't have target queues set. None of the targets have been tested with this case and it will error with strange messages if this validation isn't here.

@safern

safern commented Jan 31, 2020

Copy link
Copy Markdown
Member

We can close and keep discussion open. If we agree that this is needed we can re-open.

@safern safern closed this Jan 31, 2020
@ghost
ghost deleted the krwq-patch-1 branch June 15, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants