Repository navigation
Screenshots from long attempts for Tester: attempt getScreenshot writes a JPEG file - #1741
Draft
Matt Kleinsmith (MattKleinsmith) wants to merge 1 commit into
Draft
Matt Kleinsmith (MattKleinsmith) wants to merge 1 commit into
Matt Kleinsmith (MattKleinsmith) wants to merge 1 commit into
Conversation
Bump @qawolf/api-contracts to 0.160.0, the version qawolf/platform#39736 is predicted to publish, which generates `qawolf attempt getScreenshot`. That call reads one recorded frame from an attempt's trace by byte range, so it works on traces too large for `qawolf attempt inspect`. Any generated command whose answer carries `imageJpegBase64` now takes `--output-file <path>`: it writes the JPEG there, refusing to overwrite, and prints the rest of the answer without the base64. bun.lock is left at 0.154.0 until 0.160.0 is on the registry.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview of Problem
Tester can't get a screenshot from a long test:
qawolf attempt inspectrefuses traces over 75 MiB.Overview of Changes
Important
CI fails at install until
@qawolf/api-contracts0.160.0 is on npm. This PR pins it ahead of time, and 0.160.0 is a prediction: it is the version qawolf/platform#39736 sets today. If the published version differs, the pin changes to match.To unblock: qawolf/platform#39736 merges and ships, the contracts package publishes, then
bun.lockhere is refreshed (left at 0.154.0 for now) and the checks rerun.qawolf attempt getScreenshot --output-file <path>writes one recorded frame of any attempt as a JPEG file.attempt.getScreenshotcall in qawolf/platform#39736, which reads one frame from the trace by byte range on the server. The CLI downloads no trace.imageJpegBase64gets--output-file, so the next call that returns an image needs no CLI change. Today that is onlyattempt getScreenshot. A hand-written command would have repeated the generated flags and validation.attempt inspect --screenshot --output-file: it refuses an existing file before calling the API and writes with mode 600. It also refuses an image that does not start like a JPEG, reusing the runner screenshot check. Without--output-file, the answer prints whole.--output-filerather than read or decode the base64.Also in the 0.154.0 to 0.160.0 bump
deployment findLastDeployedCommitandbuild create --app-id;build requestUploadlists Windows.msiand Mac.zipbuilds;promotion askQuestionandpromotion reportDecisionare marked deprecated.build upload's local file check comes from the contract, so it now names.msiand Mac.ziptoo;upload.test.tsmatches the longer list.publicApi/index.tstopublicApi/specOptions.ts, to keepindex.tsunder the 150-line limit.Testing
bun run typecheck bun run lint bun run format:check bun run knip bun run testAll pass locally (3,023 tests) against 0.160.0 built from the head of qawolf/platform#39736 and placed in
node_modules; nothing local is committed.handle.imageOutputFile.test.ts, with faked API answers: writes the decoded bytes and prints the answer without the base64; refuses an existing file before any API call; writes nothing for an image that is not a JPEG; prints the whole answer when no file is asked for.index.imageOutputFile.test.ts: only commands whose answer carries an image get the flag.{"attemptId": …, "index": -1}, wrote a 68,136-byte, 1280x1280 JPEG byte-identical to the served one with mode 600, and on a second run refused the existing file without calling the API.Not proven yet: a call to a real deployment of the new endpoint. The next check is to run the command on a long attempt once qawolf/platform#39736 is in production.
Checklist