Repository navigation
iOS tests: serve WordPress with PHP and start Safari during setup #84585
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0be620e
Log every simulator tap of ten selection test runs
ellatrix 68ccb25
Serve WordPress with native PHP instead of Playground
ellatrix a85ec8b
Print the PHP server log when the editor does not load
ellatrix de67405
Launch Safari once during setup and time each setup step
ellatrix e7a0f77
Remove the touch diagnostics and update the iOS test docs
ellatrix 22f223e
Match the setup-php version comment to its tag
ellatrix 3afd497
Stop when Safari does not open the warm-up page
ellatrix d1718f4
Download WordPress from GitHub, the same as the end to end tests
ellatrix dc0cc72
Block outside requests in the iOS test site and stop the server's wor…
ellatrix fe99e90
Clone WordPress instead of downloading the tarball
ellatrix ed73791
Set up the iOS test site with WP-CLI instead of the blueprint
ellatrix c3e604c
Add the blueprint's two steps to run.sh with WP-CLI
ellatrix e5aefcd
Time the first editor load in CI (temporary)
ellatrix abedec7
Compare the first editor load with and without cron (temporary)
ellatrix 05a6f20
Sample the stuck editor load (temporary)
ellatrix b31b4eb
Sample the first editor load in run.sh (temporary)
ellatrix b3b3757
Turn off the JIT for the iOS test server and remove the probe
ellatrix d9c2275
Turn off the JIT for WP-CLI too
ellatrix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| """Applies the steps of blueprint.json to a WordPress install served by | ||
| native PHP: runPHP code runs with PHP, writeFile writes the file, with | ||
| Playground's /wordpress paths mapped to the install.""" | ||
| import json | ||
| import os | ||
| import subprocess | ||
| import sys | ||
| import tempfile | ||
|
|
||
| blueprint, root = sys.argv[1], sys.argv[2] | ||
| for step in json.load( open( blueprint ) )[ "steps" ]: | ||
| if step[ "step" ] == "runPHP": | ||
| with tempfile.NamedTemporaryFile( "w", suffix=".php", delete=False ) as script: | ||
| script.write( step[ "code" ].replace( "/wordpress/", root + "/" ) ) | ||
| subprocess.run( [ "php", script.name ], check=True ) | ||
| elif step[ "step" ] == "writeFile": | ||
| path = step[ "path" ].replace( "/wordpress/", root + "/", 1 ) | ||
| os.makedirs( os.path.dirname( path ), exist_ok=True ) | ||
| open( path, "w" ).write( step[ "data" ] ) | ||
| else: | ||
| sys.exit( "Unsupported blueprint step: " + step[ "step" ] ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| """Temporary diagnostics: one line per synthesized tap from the simulator's | ||
| touch log (backboardd, TouchEvents), saying whether the tap was lost.""" | ||
| import re | ||
| import sys | ||
| from datetime import datetime | ||
|
|
||
| taps = [] | ||
| for line in open(sys.argv[1], errors="replace"): | ||
| match = re.match(r"(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d+)", line) | ||
| if not match: | ||
| continue | ||
| time = datetime.strptime(match.group(1), "%Y-%m-%d %H:%M:%S.%f") | ||
| if "digitizer attached" in line: | ||
| taps.append({"time": time, "unknown": 0, "skipped": 0, "lost": False}) | ||
| elif not taps: | ||
| continue | ||
| elif "unknown digitizer" in line: | ||
| taps[-1]["unknown"] += 1 | ||
| elif "skipping event" in line: | ||
| taps[-1]["skipped"] += 1 | ||
| elif "canceling paths contacts" in line and "touching" in line: | ||
| taps[-1]["lost"] = True | ||
|
|
||
| previous = None | ||
| for number, tap in enumerate(taps, 1): | ||
| gap = (tap["time"] - previous).total_seconds() if previous else 0 | ||
| previous = tap["time"] | ||
| print( | ||
| "TAP %3d %s gap=%6.1fs unknown=%d skipped=%d %s" | ||
| % (number, tap["time"].strftime("%H:%M:%S.%f")[:-3], gap, tap["unknown"], tap["skipped"], "LOST" if tap["lost"] else "ok") | ||
| ) | ||
| lost = [tap for tap in taps if tap["lost"]] | ||
| print("TAPS %d LOST %d RACED %d" % (len(taps), len(lost), sum(1 for tap in taps if tap["unknown"]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.