Skip to content

tcapi: simplified interface#1092

Draft
makramkd wants to merge 1 commit into
mainfrom
mk/simplify-tcapi
Draft

tcapi: simplified interface#1092
makramkd wants to merge 1 commit into
mainfrom
mk/simplify-tcapi

Conversation

@makramkd
Copy link
Copy Markdown
Collaborator

@makramkd makramkd commented May 9, 2026

Description

The tcapi.TestCase interface's methods were depending on ccv.Cfg and TestHarness, both of which make it difficult to run test cases on non-ephemeral environments like CLD environments.

This is the first step in making the test cases environment-agnostic:

  • tcapi.TestCase methods now only take a context.Context, typically the test context.
  • The construction of test cases will take a deployment.Environment and functional options that specify things like aggregator and indexer clients. This is because in CLD such clients are constructed from URLs that are retrieved from outside the datastore, compared to the URLs being in the ccv.Cfg in ephemeral envs.
  • The basic test cases now make the aggregator and indexer guards optional; i.e. if aggregator and indexer clients are made available via the requisite functional options, the guards are enabled, else they are disabled. This kind of behaviour should probably be applied to all future TestCase implementations.

The next steps will be:

  1. [P0] Migrate tcapi basic + token_transfer send path off SendMessage to BuildChainMessage + SendChainMessage. Aligns with the deprecation on Chain; same behavior, future-proof surface.
  2. [P1] Refactor remaining e2e helpers that still center Lib + Cfg where tcapi-style env wiring is preferred, e.g. token verification / extra-args v2 tests: same explicit lane + NewCLDFOperationsEnvironment + optional clients pattern as smoke, where it reduces duplication without rewriting full v2 chaos/load.
  3. [P1] Evaluate an optional TestEnvironment façade (DataStore + CLDFEnvironment). Single adapter + NewTestEnvironmentFromCfg would narrow what tcapi (and tests) depend on if CLDF churn is a concern.
  4. [P2] Reconcile composable scenarios (MessageV3TestScenario, v2/v3 helpers) with tcapi.
  5. [P2] After (4): revisit typing src / dst as ChainAsSource / ChainAsDestination (or a composed test-facing interface)

Testing

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

* Run/HavePrerequisites only take context
* Decouple ccv.Cfg from tcapi interface
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Code coverage report:

Package main mk/simplify-tcapi Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 49.34% 49.35% +0.01%
github.com/smartcontractkit/chainlink-ccv/bootstrap 47.23% 47.23% +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 56.54% 56.54% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 45.97% 45.97% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 37.69% 37.68% -0.01%
github.com/smartcontractkit/chainlink-ccv/integration 46.09% 46.09% +0.00%
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.75% 63.75% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 34.47% 34.47% +0.00%
Total 46.20% 46.20% +0.00%

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