build/devenv/tests/e2e: add CheckPrerequisites to TestCase#1166
Open
makramkd wants to merge 2 commits into
Open
build/devenv/tests/e2e: add CheckPrerequisites to TestCase#1166makramkd wants to merge 2 commits into
makramkd wants to merge 2 commits into
Conversation
- Rename HavePrerequisites → CheckPrerequisites on TestCase interface
- Return ([]MissingPrerequisite, error) instead of bool so callers
can distinguish expected skips from infra failures
- Add MissingPrerequisite{Name, Err} struct implementing error,
enabling errors.Join and testify assertions on the missing list
- Hydrate closures now fail-fast on infra errors and gather-all
on contract lookup failures
- loadV3Env returns (v3Env, error) with descriptive messages
- Update smoke_test.go call sites to t.Fatalf on error and
t.Logf the missing list on skip
|
Code coverage report:
|
4 tasks
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.
Description
TestCase.HavePrerequisites(ctx) boolgave callers no way to distinguish"this environment doesn't have the contract deployed" from "the data store
is unreachable". Both silently skipped the test with the same log line,
making it impossible to tell whether a skip was expected or a sign of
misconfiguration.
This PR replaces the method with
CheckPrerequisites(ctx) ([]MissingPrerequisite, error)and introducesMissingPrerequisite{Name string, Err error}as a first-class type. The two return channels encode two different semantics:[]MissingPrerequisite— the environment is simply missing an expectedcomponent (contract not deployed, verifier not registered). The caller
should skip gracefully and log what was missing.
error— the check itself could not complete (data store unavailable,unknown chain selector, missing registry). The caller should fail loudly.
MissingPrerequisiteimplementserrorso thaterrors.Joinworks inRunand testify assertions produce readable output without extraformatting.
Testing
Existing smoke test suite.
Checklist
changelogdirectory)just lint fix- no new lint errorsjust generate- mocks and protobufs are up to date