Skip to content
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

JetStream2 driver should be able to specify individual subtests/test groups to run #6046

Merged
merged 1 commit into from
Nov 3, 2022
Merged

JetStream2 driver should be able to specify individual subtests/test groups to run #6046

merged 1 commit into from
Nov 3, 2022

Conversation

xw
Copy link
Contributor

@xw xw commented Nov 2, 2022

c770d8f

JetStream2 driver should be able to specify individual subtests/test groups to run
https://bugs.webkit.org/show_bug.cgi?id=247301
rdar://101783726

Reviewed by Alexey Shvayka.

- Refactor existing `report` argument parsing to use URLSearchParams
- Add a new URL parameter, `test`, that runs a given list of tests and/or test groups.

Eventually, we'd like to be able to add profiling/ARTrace support to JetStream2, and being able to measure individual subtests would be useful as measuring the whole test may be too long and costly.

* PerformanceTests/JetStream2/JetStreamDriver.js:
(Driver.prototype.async initialize):
(Driver.prototype.async reportScoreToRunBenchmarkRunner):
(prototype.else):
* PerformanceTests/JetStream3/JetStreamDriver.js:
(Driver.prototype.async initialize):
(Driver.prototype.async reportScoreToRunBenchmarkRunner):
(prototype.else):

Canonical link: https://commits.webkit.org/256264@main

3cca236

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios   πŸ›  mac βœ… πŸ›  wpe
βœ… πŸ›  ios-sim   πŸ›  mac-debug βœ… πŸ›  gtk   πŸ›  wincairo
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug   πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios   πŸ§ͺ api-mac   πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim   πŸ§ͺ mac-wk2
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch-sim   πŸ§ͺ mac-wk2-stress

@xw xw self-assigned this Nov 2, 2022
@xw xw added Other Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases labels Nov 2, 2022
@xw xw requested a review from Constellation November 2, 2022 20:08
@@ -494,7 +496,7 @@ class Driver {
if (!isInBrowser)
return;

if (window.location.search !== '?report=true')
if (!urlParameters.get('report'))
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
if (!urlParameters.get('report'))
if (!urlParameters.has('report'))

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this will not work as expected if I have ?report=false.

@@ -494,7 +496,7 @@ class Driver {
if (!isInBrowser)
return;

if (window.location.search !== '?report=true')
if (!urlParameters.has('report'))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep using urlParameters.get('report') as ?report=false is a valid case and in that case we want the early return in next line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, urlParameters.get('report') gives "false" string, which will be evaluated true.
If we only allow report key to have "true" or "false" as input, then, we should do
if (urlParameters.get('report') != 'true') instead.

@@ -494,7 +496,7 @@ class Driver {
if (!isInBrowser)
return;

if (window.location.search !== '?report=true')
if (!urlParameters.has('report'))
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -494,7 +496,7 @@ class Driver {
if (!isInBrowser)
return;

if (window.location.search !== '?report=true')
if (!urlParameters.has('report'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, urlParameters.get('report') gives "false" string, which will be evaluated true.
If we only allow report key to have "true" or "false" as input, then, we should do
if (urlParameters.get('report') != 'true') instead.

@@ -404,7 +406,7 @@ class Driver {
await this.prefetchResourcesForBrowser();
await this.fetchResources();
this.prepareToRun();
if (isInBrowser && window.location.search == '?report=true') {
if (isInBrowser && urlParameters.get('report')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same condition check issue mentioned below.

@xw xw added the merge-queue Applied to send a pull request to merge-queue label Nov 3, 2022
…groups to run

https://bugs.webkit.org/show_bug.cgi?id=247301
rdar://101783726

Reviewed by Alexey Shvayka.

- Refactor existing `report` argument parsing to use URLSearchParams
- Add a new URL parameter, `test`, that runs a given list of tests and/or test groups.

Eventually, we'd like to be able to add profiling/ARTrace support to JetStream2, and being able to measure individual subtests would be useful as measuring the whole test may be too long and costly.

* PerformanceTests/JetStream2/JetStreamDriver.js:
(Driver.prototype.async initialize):
(Driver.prototype.async reportScoreToRunBenchmarkRunner):
(prototype.else):
* PerformanceTests/JetStream3/JetStreamDriver.js:
(Driver.prototype.async initialize):
(Driver.prototype.async reportScoreToRunBenchmarkRunner):
(prototype.else):

Canonical link: https://commits.webkit.org/256264@main
@webkit-commit-queue
Copy link
Collaborator

Committed 256264@main (c770d8f): https://commits.webkit.org/256264@main

Reviewed commits have been landed. Closing PR #6046 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit c770d8f into WebKit:main Nov 3, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 3, 2022
@mikhailramalho
Copy link
Contributor

hi @xw, this patch broke JetStream2 on linux (tested on 32 and 64 bits):

$ ~/tools/WebKit/WebKitBuild/Release/bin/jsc watch-cli.js 
Exception: ReferenceError: Can't find variable: URLSearchParams
global code@/home/mgadelha/tools/WebKit/PerformanceTests/JetStream2/JetStreamDriver.js:45:42
load@[native code]
global code@/home/mgadelha/tools/WebKit/PerformanceTests/JetStream2/cli.js:46:5
load@[native code]
global code@watch-cli.js:65:5

@xw
Copy link
Contributor Author

xw commented Nov 3, 2022

Looks like URLSearchParams exists only in the browser and not jsc. These arguments aren't relevant when running tests inside the jsc shell, so it should be fine to disable in that case.

Fix for this incoming shortly.

@xw
Copy link
Contributor Author

xw commented Nov 3, 2022

#6109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases
Projects
None yet
6 participants