Skip to content

build/devenv/tests/e2e: add CheckPrerequisites to TestCase#1166

Open
makramkd wants to merge 2 commits into
mainfrom
mk/CCIP-11636
Open

build/devenv/tests/e2e: add CheckPrerequisites to TestCase#1166
makramkd wants to merge 2 commits into
mainfrom
mk/CCIP-11636

Conversation

@makramkd

@makramkd makramkd commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Description

TestCase.HavePrerequisites(ctx) bool gave 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 introduces MissingPrerequisite{Name string, Err error} as a first-class type. The two return channels encode two different semantics:

  • []MissingPrerequisite — the environment is simply missing an expected
    component (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.

MissingPrerequisite implements error so that errors.Join works in
Run and testify assertions produce readable output without extra
formatting.

Testing

Existing smoke test suite.

Checklist

  • Breaking changes documented in changelog (see changelog directory)
  • Cross link related PRs (in this or other repositories)
  • just lint fix - no new lint errors
  • just generate - mocks and protobufs are up to date

makramkd added 2 commits June 9, 2026 17:53
- 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
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code coverage report:

Package main mk/CCIP-11636 Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 49.48% 49.45% -0.03%
github.com/smartcontractkit/chainlink-ccv/bootstrap 54.14% 54.14% +0.00%
github.com/smartcontractkit/chainlink-ccv/cli 65.13% 65.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 15.54% 15.54% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 54.76% 54.76% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 45.97% 45.97% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 37.44% 37.40% -0.04%
github.com/smartcontractkit/chainlink-ccv/integration 46.13% 46.23% +0.10%
github.com/smartcontractkit/chainlink-ccv/pkg 84.62% 84.62% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 63.06% 63.06% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 34.48% 34.49% +0.01%
Total 46.50% 46.50% +0.00%

@makramkd makramkd marked this pull request as ready for review June 9, 2026 15:26
@makramkd makramkd requested review from a team as code owners June 9, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant