feat: report test run results as a structured value - #795
Open
Quenty wants to merge 2 commits into
Open
Conversation
An executed script's return value had nowhere to go: the plugin discarded everything pcall handed back, and a caller could only learn what a run produced by reading its printed output. Anything a caller must read back exactly — test counts, for instance — had to be scraped out of log text. The plugin's execute action now marshals every returned value onto scriptComplete's payload.returnValues, and it surfaces on both ExecResult and StudioBridgeResult. Tables are walked recursively (array-like tables stay arrays), Roblox datatypes reuse the SerializedValue shapes, and cycles, over-deep nesting and non-finite numbers are marked rather than producing JSON the server cannot decode. The field stays absent whenever no scriptComplete arrived, which keeps "we never learned what it returned" distinct from "it returned nothing". Nothing consumes the new field yet.
…sult
Test runs learn everything about themselves by scraping the engine's log
output, and Open Cloud truncates those logs on a long run — a script
printing 20,001 lines came back with 7,627 of them, and the window size
varies, so there is no threshold to stay under. Results have to travel as
a value instead of as text.
ScriptRunResult gains returnValues, filled in by both transports: the
cloud context reads the task's output.results, the local context takes
what the Studio bridge marshalled. LuauTask.output was typed as an array
of { value?: string } wrappers, which does not exist — the results are a
flat array of natively typed values, so a returned Lua table is real
nested JSON. Nothing read it, so nothing noticed.
returnValues is absent, not empty, when a transport delivered no result
at all: an oversize return value fails a cloud task outright rather than
truncating it (~4MB fails, ~2MB arrives intact), leaving no output and no
error message, and a later consumer needs to tell that apart from a
script that returned nothing so it knows when falling back to the logs is
worth it.
Nothing consumes the new field yet.
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.
Test runs can now hand back a structured result instead of only printed output: a script's return value travels on ScriptRunResult.returnValues, filled in by the Open Cloud transport from the task's output.results and by the local transport from what the Studio bridge plugin marshals off the executed script. The field is absent rather than empty when a transport delivered no result at all, so a later consumer can tell "nothing came back" apart from "the script returned nothing" and fall back to log parsing only in the first case. Nothing reads the new field yet — this is the transport only, and it also corrects LuauTask.output, which claimed a { value?: string } wrapper that Open Cloud never sends.