Repository navigation
Add devices (DEVICE header lines) to the cases response - #5
Merged
Merged
Conversation
Each case maps to the raw values of the DEVICE lines in its INSTRUCTION.txt header, read as blobs from the branch tree in parallel and cached by blob sha. Left out when a file can't be read. POST /builds skips the read.
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.
What changed
GET /repos/<owner>/<repo>/cases?ref=<branch>now returns an optionaldevicesfield, as the simulators/emulators spec asks:DEVICE:on every DEVICE line in the header ofmt-tests/<case>/INSTRUCTION.txt, in file order, trimmed. A case with no DEVICE line maps to[]. The plugin does not interpret the values.sources.device_lines) copies the runner's_parse_instruction_header_keys: the key is case-insensitive, blank and#lines are allowed, and the header ends at the first line that isn'tMODE/CLEAR_DATA/REINSTALL_APP/DEVICE: value.GET .../git/blobs/<sha>), fetches identical files only once, and caches the parsed result by blob sha in memory. A later listing only fetches files that changed. If the GitHub tree is truncated, the contents-API answers the fallback already gets include the file, so it makes no extra request.devicesout of the response. The contract treats a missingdevicesas "unknown". The cases list still comes back.POST /buildsalso callslist_cases(to check recipes). It now passesdevices=False, so starting a build doesn't fetch these files.Verified
python3 -m unittest discover -s tests -v(the CI command):Ran 109 tests ... OKdeviceson the cases route, check that a second listing makes no extra blob requests, check thatdevicesis left out when blob reads fail, check{}for a branch with no cases, check that the truncated-tree fallback makes no blob requests, and check thatPOST /buildsreads no blobs. Both code hosts are covered: the Gitea path and the GitHub path.Not verified
devicesis a separate PR in MonkeyTester.