-
Notifications
You must be signed in to change notification settings - Fork 268
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
Blueprints: Throw on failure #982
Merged
Merged
Conversation
This file contains 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
adamziel
added
[Type] Enhancement
New feature or request
[Type] Developer Experience
[Focus] Developer Tools
[Package][@wp-playground] Blueprints
labels
Jan 30, 2024
E2E failures come from #985. This PR merely surfaces the error that's already in there. |
This commit ensures the Blueprint steps will throw an error when they fail. For now, the error is merely reported in the console. In the future, there may be a nice UI for this. Detecting a runPHP failure required adjusting the php_wasm.c code to return the correct exit code. The previous method of inferring the exit code was replaced by simply returning `EG(exit_status)` which is populated by the zend engine. Furthermore, this PR ships additional unit tests for some Blueprint steps to ensure they indeed throw as expected. ## Testing instructions This PR comes with test coverage so confirm all the tests pass in CI. Also, apply this PR locally and visit the following URL: http://localhost:5400/website-server/#{%22steps%22:[{%22step%22:%22runPHP%22,%20%22code%22:%22%3C?php%20no_such_fn();%22}]} It should reveal useful error information in the console.
…ooks as priviliged users
Also, rebuild more PHP versions
adamziel
force-pushed
the
surface-blueprint-failures
branch
from
January 30, 2024 17:37
da44dd9
to
4b112c5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Focus] Developer Tools
[Package][@wp-playground] Blueprints
[Type] Developer Experience
[Type] Enhancement
New feature or request
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.
Description
Ensures the Blueprint steps throw an error on failure. For now, the error is merely reported in the console. In the future, there may be a nice UI for this.
This PR is an addition to #605 as it prepares the Blueprint steps for the changes in the Blueprint compilation engine.
Detecting a runPHP failure required adjusting the php_wasm.c code to return the correct exit code. The previous method of inferring the exit code was replaced by simply returning
EG(exit_status)
which is populated by the zend engine.Furthermore, this PR ships additional unit tests for some Blueprint steps to ensure they indeed throw as expected.
Changes description
throwOnError
optionBasePHP.run()
now accepts athrowOnError
option that throws an error whenever PHP returns an exit code different than0
:This happens in the following cases:
exit(1)
This option is set to
true
by all the Blueprint steps.Remaining work
Testing instructions
This PR comes with test coverage so confirm all the tests pass in CI.
Also, apply this PR locally and visit the following URL:
http://localhost:5400/website-server/#{%22steps%22:[{%22step%22:%22runPHP%22,%20%22code%22:%22%3C?php%20no_such_fn();%22}]}
It should reveal useful error information in the console.