-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add updated browser spec runner #10293
Conversation
Thanks for the pull request @ggetz!
Reviewers, don't forget to make sure that:
|
@ggetz It's great to have the UI back, but it seems like there's a significant performance regression when it comes to loading the tests. I compared with version
It seems like the time to load a single JS file has increased significantly. For example, |
I would also not mark #10262 as fixed by this PR, since that is related to the karma CLI test command, which still fails on Safari on this branch. |
@sanjeetsuhag I was importing a few cesium helper function a way that included |
After some investigation, I'm pretty sure this is due to the jasmine and the |
@mramato Would you have a bit of time to sanity check the speed of focused specs here? Is it worth rolling back to the older version of jasmine if the new one introduces a such a delay for focused specs? |
@ggetz happy to take a look |
@ggetz I checked out this branch, did a clean
|
@mramato Sorry, run |
@mramato Were you able to get test running? |
@ggetz Sorry, once I had issues I wasn't able to get back to it. Why is build-specs needed? |
Also, are we talking about focused tests (i.e. fit) or "test I click on in the list". Because focused tests seem plenty fast for me. |
I took a look at the "test I click on the list" performance and nothing obvious jumped out at me. One stab in the dark is that our use of HTTP 1.1 instead of HTTP2 is slowing things down because of the massive number of individual JS files Cesium loads on start. Actually using the Overall, I think we are going about this the wrong way in that we are working from top down instead of bottom up. My approach would have been to fix/improve Cesium's overall build infrastructure first and then update how we handle stuff like tests based on that(because it's going to have to be tweaked again anyway). |
No problem, thanks for taking a look!
I noticed the delay for both focused (fit) specs and "test I click on the list". Fair point about the the order of approach. I agree that loading approach will likely change after adjusting the build infrastructure. |
I assumed that was the case. I would recommend doing it in the |
Since the "test I click on the list" performance likely hinges on changes that will likely come with re-assessing the build infrastructure, let's put a pin in that for now. @ebogo1 Could you please give this a final review? |
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 good! Browser runner works as advertised.
- The WebGL tests link on index.html shows a bunch of yellow asterisks and dots for excluded tests. Not sure if there's a way to change this but I think it's making the page run slower.
- Should the release guide should be updated with a link to the web runner once this is merged?
- Probably not in the scope of this PR, but running tests with WebGL validation isn't part of the release process anymore. Should we open an issue to keep track of that option? Quote from @mramato when we discussed offline a little while back:
We should also understand if anyone ever actually uses that testing option (I don't think they do) and if that's because it's slow or because it's not useful?
We should either remove it completely or figure out why it's so slow based on the feedback from other WebGL devs.
I had a couple other comments and questions -
includeName, | ||
excludeName, |
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 includeName
also be removed? The changes in karma-main.js no longer do anything with the argument unless I'm missing something. There's a section in the testing README that we can also delete.
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.
We removed our custom logic in karma-main.js
, however we're now hooking into the --grep
option which exists as part of karma-jasmine
. This option uses the same function under the hood via jasmine-core
as the ?spec=
query does in the browser runner.
Specs/equalsMethodEqualityTester.js
Outdated
@@ -1,4 +1,4 @@ | |||
import { defined } from "../Source/Cesium.js"; | |||
import defined from "../Source/Core/defined.js"; |
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.
Just curious, why was this needed?
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.
Not strictly needed, but this doesn't require all of Cesium.js
until it's needed by the specs. Again, this is something that will likely need to be re-examined as a part of investigating the build process, so I think I'll actually revert this change for the time being, as it doesn't affect performance either way.
Also, some sections about the browser runner were deleted from the testing README in #10184, could those be added back? |
We can't filter by category up front like with we do with the spec name because categories are not a part of the jasmine API, and we don't get access to it until we intercept
As long as there is a way to run the release tests, I don't think it's critical that its using the browser. However I can certainly update to include it as an alternative.
While its alluded to in other issues, it didn't have its own. Opened #10309. |
Thanks @ebogo1, updated! |
Based on my suggestion in #3911, that would mean putting the |
Thanks @ggetz, much appreciated to have this back! |
Fixes #10134
Fixes #10200
This returns the browser spec runner. However, instead of copying the standalone runner into a third party folder and making customizations, this is a bit more minimal version which loads files from
jasmine-core
directly and then configures jasmine as needed through existing API. I ended up not using thejasmine-browser-runner
NPM module since it was mostly just a server wrapper around code which exists in thejasmine-core
package already, and the server did not allow us to serve files other than JS or CSS which are needed for many of our specs.it
,describe
,beforeEach
,afterEach
, etc implementations which checked for a promise and manually calleddone
upon resolution. This is no longer needed with the updated version of jasmine supports returning promises directly.done
toThrowDeveloperError
macther function was not handlinginstanceof
correctly, so I tweaked the conditionxdescribe
instead. (Also note that the jasmine api does not support a third parameter, so no need to pass the category to the original describe function). I don't believe any singular test orit
block had theWebGL
category, so I removed the custom it handler for categories.?spec=
query in the browser runner, as built-in to thekarma-jasmine
package already in use. This removes the--excludeName
option as there is no counterpart in the browser querySpec
folder during theprepare
step which runs afterinstall
. Since we move them to theSpecs
directory, they automatically get deployed along with the rest of that folder and can be accessed via s3, for example http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/jasmine-browser/Specs/SpecRunner.html?category=noneDeveloperErrors
or not. Runningcombine
(no pragmas removed) andcombineRelease
(debug pragmas removed) build to the same location, so whether or not the debug pragmas are removed is from independent from which set of tests you chose to run. So in the end, runningcombineRelease
and then running the tests in browser withbuilt=true&release=false
results in failing specs, but I believe this is consistant with what the behavior was before.