Skip to content

Update E2ETest requirements #11634

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

Closed
wants to merge 1 commit into from
Closed

Update E2ETest requirements #11634

wants to merge 1 commit into from

Conversation

JunTaoLuo
Copy link
Contributor

Updating the default behaviour.

  • Do not enforce prerequisites by default
  • Warn if prerequistes are not met unless explicitly enforced
  • Run yarn install by default if Java is available

Addresses #11342.

- Do not enforce prerequisites by default
- Warn if prerequistes are not met unless explicitly enforced
- Run yarn install by default if Java is available
<SeleniumE2ETestsSupported Condition="'$(SeleniumE2ETestsSupported)' == '' and '$(TargetArchitecture)' != 'arm' and '$(OS)' == 'Windows_NT' and '$(BuildJava)' == 'true'">true</SeleniumE2ETestsSupported>
<EnforcePrerequisites Condition="'$(SeleniumE2ETestsSupported)' == 'true' and '$(EnforcePrerequisites)' == ''">true</EnforcePrerequisites>
<SeleniumE2ETestsSupported Condition="'$(SeleniumE2ETestsSupported)' == '' and '$(TargetArchitecture)' != 'arm' and '$(OS)' == 'Windows_NT'">true</SeleniumE2ETestsSupported>
<EnforcePrerequisites Condition="'$(SeleniumE2ETestsSupported)' == 'true' and '$(EnforcePrerequisites)' == ''">false</EnforcePrerequisites>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm of the opinion that we can remove this property and just go with the default behaviour. We'll never enforce prereqs and you will need to install java for tests to work. The difference is that instead of errors at build time, you'll see errors during test instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then why aren't you removing the property?

But, the current $(EnforcePrerequisites) default is correct and keeping the property allows users to disable the checks once they have everything set up.

Condition="'$(ErrorCode)' == '0'"
Importance="High"
Text="JAVA is available on the PATH" />
<Message
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could consider making this a warning instead, applies in a few places.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I said above, get rid of the '$(EnforcePrerequisites)' == 'false' cases entirely. If a user passes /p:EnforcePrerequisites=false on the command line, assume they know Java is where it should be.

@JunTaoLuo JunTaoLuo requested a review from dougbu June 27, 2019 02:25
<SeleniumE2ETestsSupported Condition="'$(SeleniumE2ETestsSupported)' == '' and '$(TargetArchitecture)' != 'arm' and '$(OS)' == 'Windows_NT' and '$(BuildJava)' == 'true'">true</SeleniumE2ETestsSupported>
<EnforcePrerequisites Condition="'$(SeleniumE2ETestsSupported)' == 'true' and '$(EnforcePrerequisites)' == ''">true</EnforcePrerequisites>
<SeleniumE2ETestsSupported Condition="'$(SeleniumE2ETestsSupported)' == '' and '$(TargetArchitecture)' != 'arm' and '$(OS)' == 'Windows_NT'">true</SeleniumE2ETestsSupported>
<EnforcePrerequisites Condition="'$(SeleniumE2ETestsSupported)' == 'true' and '$(EnforcePrerequisites)' == ''">false</EnforcePrerequisites>
Copy link
Contributor

Choose a reason for hiding this comment

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

Then why aren't you removing the property?

But, the current $(EnforcePrerequisites) default is correct and keeping the property allows users to disable the checks once they have everything set up.

@@ -23,19 +19,46 @@

<!-- Running prerequisites -->

<Target Name="EnsurePrerequisites" Condition="'$(EnforcePrerequisites)' == 'true'" BeforeTargets="EnsureNodeJSRestored">
<Target Name="EnsurePrerequisites">
Copy link
Contributor

Choose a reason for hiding this comment

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

Much preferred the previous approach of only executing this target when $(EnforcePrerequisites) is enabled. As-is, the property only slightly changes the messages but doesn't make a real difference. There's a message already about $(EnforcePrerequsites) being disabled in EnsureNodeJSRestored. And, doubling all the messages makes the target harder to read.

Condition="'$(ErrorCode)' == '0'"
Importance="High"
Text="JAVA is available on the PATH" />
<Message
Copy link
Contributor

Choose a reason for hiding this comment

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

As I said above, get rid of the '$(EnforcePrerequisites)' == 'false' cases entirely. If a user passes /p:EnforcePrerequisites=false on the command line, assume they know Java is where it should be.

@analogrelay analogrelay added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jun 27, 2019
@javiercn
Copy link
Member

I wasn't sure how to explain my thoughts properly, so I made a PR. I think this would be easier, wouldn't it? #11642

It makes sure the prerequisites are enforced when building from VS or on the CI in supported platforms and enforces them when building from the command-line for projects that have E2E tests.

Shouldn't that be enough?

@dougbu
Copy link
Contributor

dougbu commented Jun 27, 2019

Shouldn't that be enough?

Perhaps. This PR does have a couple of advantages over #11642:

  • enforces prerequisites by default when Selenium tests are requested
  • runs Yarn installations more often
  • doesn't require changes to build.* files
  • after reverting some parts I don't see as helpful, simpler

@javiercn
Copy link
Member

This PR has a way bigger scope than the one I sent out.

  • enforces prerequisites by default when Selenium tests are requested

Mine does too.

  • runs Yarn installations more often

How is this an advantage? I would see it as a disadvantage. It only adds time and potential flakiness

  • doesn't require changes to build.* files

Don't think that is a problem at all. Specially given that it literally does it in two places.

  • After reverting some parts I don't see as helpful, simpler

I don't even know how to answer this because its not even clear what you are suggesting, but perceive this comment largely as a personal opinion, and I'm not sure I agree with it. Alternatively the changes I suggested:

  • Don't fundamentally change the way things work.
  • Are very limited in scope (have reduced risk).
  • Achieve our goal, which is to run this in the correct set of environments.

I'm open to revisit how things work in this area in the future, but right now the priority is to make the least risky think that makes things work/run again as this blocks any candidate build.

Hope this helps.

@JunTaoLuo
Copy link
Contributor Author

Sure go for it @javiercn

@JunTaoLuo JunTaoLuo closed this Jun 27, 2019
@JunTaoLuo JunTaoLuo deleted the johluo/e2e branch June 28, 2019 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants