Repository navigation
Say why no container runtime was found - #1621
Open
tahmidbintaslim wants to merge 1 commit into
Open
tahmidbintaslim wants to merge 1 commit into
tahmidbintaslim wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Closes #1571
Summary
When no container runtime works, the error now lists every strategy that was tried and why it was skipped or failed, then links to the supported runtimes docs. For example, on Linux where the socket exists but isn't readable:
Strategies used to return
undefinedfor "not applicable". They now return{ notApplicable: reason }. Errors from strategies that applied but failed are attached ascause, wrapped in anAggregateError. The first line of the message is unchanged, so anything matching on it keeps working. I kept this a plainErrorso it can move onto the typed errors from #1532 without conflict.Verification
main, the 7 new "should not apply" strategy tests fail (they getundefinedinstead of a reason).npx vitest run packages/testcontainers/src/container-runtime/strategies packages/testcontainers/src/container-runtime/clients/no-working-strategy-error.test.ts: 7 files, 30 tests passed.npx biome check .,npm run knipandnpm run check-compiles: pass.Not breaking
The strategy classes aren't exported from
index.ts, so their return type is internal. The error's first line is the same as before.