-
Notifications
You must be signed in to change notification settings - Fork 114
[WIP] Check Results API #997
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
Closed
Closed
Conversation
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
it will not exit with EXIT_ERROR_CHECK_FAILURES when needed. however, it the main function in pyret.arr will return an appropriate error code, if we can leverage that also: this commit fails on no-diff-standalone
doing this mainly to investigate timeouts on travis ci
This reverts commit b9a6e04.
This reverts commit 5b020fa.
each of the 4 phaseX scripts is a symlink to run-phase, which uses the basename command to get the name of the symlink file and go from there
(I was going to just use the json lib, but there were annoying module cycles arising)
Manually resolved conflicts in pyret.arr. --run-full-report will not work as of this commit
(at least in spirit)
notes: - maybe-surface-parse has output type Either<{exn: ParseError, message: String}, AST> - surface-parse either returns the ast, or console.error's the message and raises the exn - test-parse.arr was mostly auto-generated from tests/parse/parse.js
This reverts commit c1236f6. Reverting on this branch to instead opt for merging in the maybe-surface-parse branch, which has an open PR into horizon
notes: - make phaseA fails at this commit. - this should make merging easier
With manual conflict resolution for the following: Conflicts: src/arr/compiler/cli-module-loader.arr src/arr/compiler/pyret.arr src/js/base/handalone.js src/js/trove/load-lib.js
- adds a 'capture-output' field to the options - render(Check|Error)Report will propagate the captured output to the report json
There were technically merge conflicts, but they were very easy to resolve.
@jswrenn I'm curious if this design is useful to you, or if your recent work on doing lots of testing automation supersedes this in useful ways. |
I'm not coming back to this |
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.
This PR adds a
--run-full-report
command-line flag whose usage is as follows:This will parse, compile, and run
file.arr
, and write JSON data to standard out.No matter what happens in
file.arr
(and any Pyret dependencies it has), I claimthis API is robust enough to not allow stray messages to be written to stdout.
This is important, because this API will be used by grading scripts to collect
data: a grading script may want to redirect stdout to a
file.arr.json
file,and then do its remaining "business logic" outside of Pyret, in the language
of its author's choice.
For examples of input programs and their resulting JSON data, see
TM030 Check Results API
Some notes about the PR and its changeset:
This is marked work-in-progress (WIP) because I haven't added tests of the
proposed functionality. Before I put effort into writing said tests, I would
like us to agree upon the new interface and expected behavior.
The diff on
checker.arr
is a bit messy: the gist there is that thefunctionallity of
results-summary
was expanded and moved into the newresults-report
function; now,
results-summary
depends onresults-report
.The added
toJSON
inffi.js
has been robust enough for this use case, butI do not claim it can cleanly convert any Pyret data structure into JSON.
Its cases mirror those in
json-structs.arr:tojson
, but it does not handlestring-dicts.
load-lib.js
has some repeated logic:renderCheckResults
andrenderCheckReport
are similar, and
renderErrorMessage
andrenderErrorReport
are also similar.In theory, the
renderCheckResults
andrenderErrorMessage
may be able to dependon the
render*Report
functions, but (I believe) it would require messy stackmanagement and thus might not be worth the trouble.