-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix error messages for buildpack packaging failures #720
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
After #666, incorrect error messages were shown for failures that occurred during buildpack compilation packaging, since the handling in `TestRunner::build_internal` used the wrong message text, plus didn't include the error struct in the `panic!` string. These have been fixed, plus display representations added to all of the new error variants. In addition, the usages of `assert!` and `.unwrap()` in functions that return `Result` have been replaced with new error enum variants. The change in output can be seen in the new tests added by #717. There is one last scenario that doesn't yet have a test - the testing of the cross-compilation output itself. However, I'll add that separately, since it's going to be more complex to test / there are a few different options that we'll need to choose between. Fixes #704. Fixes #709. Fixes #710. GUS-W-14395170.
edmorley
force-pushed
the
edmorley/fix-libcnb-test-error-handling
branch
from
November 6, 2023 17:27
693e2e9
to
9504a2c
Compare
colincasey
reviewed
Nov 6, 2023
colincasey
reviewed
Nov 6, 2023
Malax
approved these changes
Nov 7, 2023
edmorley
added a commit
that referenced
this pull request
Nov 7, 2023
* Use contractions per Simplified Technical English guidelines (e.g. "Couldn't" instead of "Could not"). * Prefer using past tense for potentially transient failures (e.g. "Couldn't read buildpack.toml" rather than "Can't"). * Prefer using actual filenames rather than their spec names (e.g. "Couldn't read buildpack.toml" rather than "Couldn't read buildpack descriptor"). * Use "I/O error" instead of "IO error" or "IOError" * Use display representations when including underlying error messages in the current error message where possible (ie: For most errors apart from `io::Error`). This also means preferring `panic!` over `.expect()`, since the latter uses the debug representation instead of display. * Use "Error ..." as the prefix for all top level error message (i.e. at the `panic!` or `.expect()` call sites). * Use `#[error(transparent)]` instead of `#[error("{0}")]` per: #720 (comment) GUS-W-14445374.
edmorley
added a commit
that referenced
this pull request
Nov 17, 2023
Since the lint errors were fixed by #720.
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.
After #666, incorrect error messages are shown for failures that occur during buildpack compilation packaging, since the handling in
TestRunner::build_internal
uses the wrong message text, plus doesn't include the error struct in thepanic!
string.These have been fixed, plus display representations added to all of the new error variants.
In addition, the usages of
assert!
and.unwrap()
in functions that returnResult
have been replaced with new error enum variants.The change in output can be seen in the new tests added by #717.
There is one last scenario that doesn't yet have a test - the testing of the cross-compilation output itself. However, I'll add that separately, since it's going to be more complex to test / there are a few different options that we'll need to choose between.
Fixes #704.
Fixes #709.
Fixes #710.
GUS-W-14395170.