-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Templating][Components] Unify and improve E2E testing infrastructure #8188
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
Conversation
javiercn
commented
Mar 4, 2019
- Unify the Templating and Components testing infrastructure.
- Enable test project discovery in the components E2E tests.
@@ -1,10 +1,10 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
|
|||
<!-- Shared testing infrastructure for running E2E tests using selenium --> | |||
<Import Project="$(SharedSourceRoot)E2ETesting\E2ETesting.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import and the targets import below is all that's needed to bring in Selenium E2E tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes seem fine. You had talked about improving error detection and spiting tests into parts, I assume that's coming at a later date?
7462f4b
to
47e0624
Compare
c47ef93
to
6c96b8a
Compare
@@ -42,9 +47,12 @@ private void TestApplication(bool publish) | |||
|
|||
private void TestBasicNavigation() | |||
{ | |||
// Give components.server enough time to load so that it can replace | |||
// the prerendered content before we start making assertions. | |||
Thread.Sleep(5000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit sketchy. It might be OK temporarily, but maybe we should extend the connected/disconnected APIs that @pranavkm was working on to provide a connection status value so it can be determined directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, ideally what I need is some API to know that components.server.js finished initializing so that I can do ((IJavasScriptExecutor)Browser).Execute("snippet") and determine it's done initializing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could register a circuitHandler
and wait for onConnectionUp
to complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a crazy amount of work for these tests, and wouldn't work for Blazor in the future. We should let people know when we are done initializing stuff by for example, simply saving the boot promise inside the window[Blazor] object.
src/Shared/E2ETesting/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! I'd be interested to know about whether this can now run cross-platform.
I'm looking to see if I can make it run on OS X (and potentially linux) |
@@ -42,9 +47,12 @@ private void TestApplication(bool publish) | |||
|
|||
private void TestBasicNavigation() | |||
{ | |||
// Give components.server enough time to load so that it can replace | |||
// the prerendered content before we start making assertions. | |||
Thread.Sleep(5000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could register a circuitHandler
and wait for onConnectionUp
to complete.
|
||
<!-- JAVA --> | ||
<Message Importance="High" Text="Ensuring JAVA is available" /> | ||
<Exec Command="java -version" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we capture the exit code and print a message that says what needs to be done resolve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not <Exec Command="${JAVA_HOME}/bin/java.exe -version"/>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this needs to run cross-platform and needs to be on the PATH for https://github.com/aspnet/AspNetCore/pull/8188/files?utf8=%E2%9C%93&diff=unified#diff-4035093707e8bfd6d9ba2a44912dce70R9 to work
c6a8453
to
79b4480
Compare
@@ -123,6 +123,10 @@ jobs: | |||
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}: | |||
- powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' | |||
displayName: Install JDK 11 | |||
- powershell: Write-Host "##vso[task.prependpath]$env:JAVA_HOME\bin" | |||
displayName: Prepend JAVA bin folder to the PATH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change $env:Path
globally. Java is only needed in a few places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed for https://github.com/aspnet/AspNetCore/pull/8188/files?utf8=%E2%9C%93&diff=unified#diff-4035093707e8bfd6d9ba2a44912dce70R9 to succeed when called as part of yarn install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is super problematic? It's only building on the CI (so local builds aren't affected) and goes away once the build finishes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not "super problematic" but it's a break from how the build currently works and broader than seemed necessary. If we go this route (rather than, say, creating a yarn.bat
script), should clean up the Gradlew script and anything else that updates $env:Path
for Java on Windows.
|
||
<!-- JAVA --> | ||
<Message Importance="High" Text="Ensuring JAVA is available" /> | ||
<Exec Command="java -version" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not <Exec Command="${JAVA_HOME}/bin/java.exe -version"/>
?
f14fb59
to
3772540
Compare
@dougbu This is blocked on you. The requirements have been explained. Can you please withdrawn your request for changes? We want to get this in ASAP as we haven't been running these tests regularly in a long time and has caused us issues. |
@@ -123,6 +123,10 @@ jobs: | |||
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}: | |||
- powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' | |||
displayName: Install JDK 11 | |||
- powershell: Write-Host "##vso[task.prependpath]$env:JAVA_HOME\bin" | |||
displayName: Prepend JAVA bin folder to the PATH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not "super problematic" but it's a break from how the build currently works and broader than seemed necessary. If we go this route (rather than, say, creating a yarn.bat
script), should clean up the Gradlew script and anything else that updates $env:Path
for Java on Windows.
Note
isn't urgent and doesn't need to be included in this PR. If you don't include it, please file an issue. |
Any chance we could get this in today? I'd like to see if it fixes any of the the flakiness for SPA template tests. |
Javier mentioned he preferred to merge this on Monday, so he could be around to watch for any possible flakiness. |
* Unify the Templating and Components testing infrastructure. * Enable test project discovery in the components E2E tests.
3772540
to
c7770a5
Compare