Skip to content
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

Improve the error message shown when Pack CLI is not installed #455

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jul 6, 2022

Before:

---- basic_build stdout ----
thread 'basic_build' panicked at 'Could not spawn external 'pack' process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/emorley/src/libcnb.rs/libcnb-test/src/test_runner.rs:188:14

After:

---- basic_build stdout ----
thread 'basic_build' panicked at 'External `pack` command not found. Install Pack CLI and ensure it is on PATH: https://buildpacks.io/docs/install-pack', /Users/emorley/src/libcnb.rs/libcnb-test/src/test_runner.rs:184:21

No integration test has been added, since writing one would involve manipulating the PATH of the integration test process which would be prone to intermittent test failures given concurrent test execution occurs in threads.

In addition all panic messages that reference "pack" now do so inside backticks rather than single quotes, since the panic error message itself is inside single quotes, so it looked like the quoted section had ended prematurely.

Fixes #296.
GUS-W-11390631.

@edmorley edmorley added enhancement New feature or request libcnb-test labels Jul 6, 2022
@edmorley edmorley self-assigned this Jul 6, 2022
@edmorley edmorley force-pushed the edmorley/handle-pack-not-installed branch from f83b7ef to 984923d Compare July 6, 2022 15:59
@edmorley edmorley marked this pull request as ready for review July 6, 2022 16:04
@edmorley edmorley requested a review from a team as a code owner July 6, 2022 16:04
Before:
```
---- basic_build stdout ----
thread 'basic_build' panicked at 'Could not spawn external 'pack' process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/emorley/src/libcnb.rs/libcnb-test/src/test_runner.rs:188:14
```

After:
```
---- basic_build stdout ----
thread 'basic_build' panicked at 'External `pack` command not found. Install Pack CLI and ensure it is on PATH: https://buildpacks.io/docs/install-pack', /Users/emorley/src/libcnb.rs/libcnb-test/src/test_runner.rs:184:21
```

No integration test has been added, since writing one would
involve manipulating the `PATH` of the integration test process
which would be prone to intermittent test failures given concurrent
execution.

In addition all panic messages that reference "pack" now do so inside
backticks rather than single quotes, since the panic error message itself
is inside single quotes, so it looked like the quoted section had ended
prematurely.

Fixes #296.
GUS-W-11390631.
@edmorley edmorley force-pushed the edmorley/handle-pack-not-installed branch from 984923d to 721a314 Compare July 6, 2022 19:05
@edmorley edmorley enabled auto-merge (squash) July 6, 2022 19:06
@edmorley edmorley merged commit b418425 into main Jul 6, 2022
@edmorley edmorley deleted the edmorley/handle-pack-not-installed branch July 6, 2022 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libcnb-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate pack install before attempting to run it
2 participants