Skip to content

Commit 10304fa

Browse files
committed
finalize
1 parent 128b08c commit 10304fa

File tree

12 files changed

+35
-68
lines changed

12 files changed

+35
-68
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [CLI](./framework/cli.md)
1515
- [Configuration](./framework/configuration.md)
1616
- [Test Configuration](./framework/test_configuration_overrides.md)
17+
- [Caching](framework/components/caching.md)
1718
- [Secrets]()
1819
- [Observability Stack](framework/observability/observability_stack.md)
1920
- [Metrics]()

book/src/developing/developing_components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ Each component can define inputs and outputs, following these rules:
4949

5050
### Docker components good practices for [testcontainers-go](https://golang.testcontainers.org/):
5151

52-
An example [simple component](../../../../framework/components/blockchain/anvil.go)
52+
An example [simple component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/blockchain/anvil.go)
5353

54-
An example of [complex component](../../../../framework/components/clnode/clnode.go)
54+
An example of [complex component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/clnode/clnode.go)
5555

56-
An example of [composite component](../../../../framework/components/simple_node_set/node_set.go)
56+
An example of [composite component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/simple_node_set/node_set.go)
5757

5858
- Inputs should include at least `image`, `tag` and `pull_image` field
5959
```golang

book/src/framework/components/caching.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
We use component caching to accelerate test development and enforce idempotent test actions.
44

5-
Each component is designed to be pure with defined inputs/outputs.
5+
Each component is isolated by means of inputs and outputs.
66

7-
You can use an environment variable to skip deployment steps and use cached outputs if your infrastructure is already running (locally or remotely):
7+
If cached config has any outputs with `use_cache = true` it will be used instead of deploying a component again.
88

99
```
1010
export CTF_CONFIGS=smoke-cache.toml
@@ -26,4 +26,4 @@ http_url = 'http://127.0.0.1:33447'
2626
docker_internal_ws_url = 'ws://anvil-3716a:8900'
2727
docker_internal_http_url = 'http://anvil-3716a:8900'
2828
```
29-
Set flag `use_cache = true` on any component output and run your test again
29+
Set flag `use_cache = true` on any component output, change output fields as needed and run your test again.

book/src/framework/getting_started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ go get github.com/smartcontractkit/chainlink-testing-framework/framework
66
```
77

88
Then download the CLI (runs from directory where you have `go.mod`)
9+
Make sure you have your GOPATH set: `export GOPATH=$HOME/go && export PATH=$PATH:$GOPATH/bin`
910
```
1011
go get github.com/smartcontractkit/chainlink-testing-framework/framework/cmd && \
1112
go install github.com/smartcontractkit/chainlink-testing-framework/framework/cmd && \

book/src/framework/nodeset_capabilities.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Create a configuration file `smoke.toml`
1616
port = "8545"
1717
type = "anvil"
1818

19-
[contracts]
20-
2119
[data_provider]
2220
port = 9111
2321

book/src/framework/nodeset_compatibility.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,9 @@ package capabilities_test
8585
import (
8686
"fmt"
8787
"github.com/smartcontractkit/chainlink-testing-framework/framework"
88-
"github.com/smartcontractkit/chainlink-testing-framework/framework/clclient"
8988
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
9089
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
9190
ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
92-
"github.com/smartcontractkit/chainlink-testing-framework/seth"
93-
burn_mint_erc677 "github.com/smartcontractkit/chainlink/e2e/capabilities/components/gethwrappers"
94-
"github.com/smartcontractkit/chainlink/e2e/capabilities/components/onchain"
9591
"github.com/stretchr/testify/require"
9692
"os"
9793
"testing"

book/src/framework/nodeset_environment.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
3939
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
4040
ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
41-
"github.com/smartcontractkit/chainlink/e2e/capabilities/components/onchain"
4241
"github.com/stretchr/testify/require"
4342
"testing"
4443
)

book/src/framework/test_configuration_overrides.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,28 @@ To override any test configuration, we merge multiple files into a single struct
44

55
You can specify multiple file paths using `CTF_CONFIGS=path1,path2,path3`.
66

7-
The framework will apply these configurations from right to left.
7+
The framework will apply these configurations from right to left and marshal them to a single test config structure.
88

9-
> [!NOTE]
10-
> When override slices remember that you should replace the full slice, it won't be extended by default!
9+
Use it to structure the variations of your test, ex.:
10+
```
11+
export CTF_CONFIGS=smoke-test-feature-a-simulated-network.toml
12+
export CTF_CONFIGS=smoke-test-feature-a-simulated-network.toml,smoke-test-feature-a-testnet.toml
13+
14+
export CTF_CONFIGS=smoke-test-feature-a.toml
15+
export CTF_CONFIGS=smoke-test-feature-a.toml,smoke-test-feature-b.toml
16+
17+
export CTF_CONFIGS=load-profile-api-service-1.toml
18+
export CTF_CONFIGS=load-profile-api-service-1.toml,load-profile-api-service-2.toml
19+
```
1120

21+
This helps reduce duplication in the configuration.
22+
23+
> [!NOTE]
24+
> We designed overrides to be as simple as possible, as frameworks like [envconfig](https://github.com/kelseyhightower/envconfig) and [viper](https://github.com/spf13/viper) offer extensive flexibility but can lead to inconsistent configurations prone to drift.
25+
>
26+
> This feature is meant to override test setup configurations, not test logic. Avoid using TOML to alter test logic.
27+
>
28+
> Tests should remain straightforward, readable, and perform a single set of actions (potentially across different CI/CD environments). If variations in test logic are required, consider splitting them into separate tests.
29+
30+
> [!WARNING]
31+
> When override slices remember that you should replace the full slice, it won't be extended by default!

book/src/lib/crib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
<div class="warning">
44

5-
`GAPv1` won't be supported, so you can use [this example](https://github.com/smartcontractkit/chainlink/tree/develop/integration-tests/crib), [CI run](https://github.com/smartcontractkit/chainlink/actions/workflows/crib-integration-test.yml)
5+
`GAPv1` won't be supported in the future, you can still use [this example](https://github.com/smartcontractkit/chainlink/tree/develop/integration-tests/crib), [CI run](https://github.com/smartcontractkit/chainlink/actions/workflows/crib-integration-test.yml) but expect this to be changed.
66

77
</div>

framework/README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
1-
## Chainlink Testing Framework Harness
1+
# Framework
22

3-
<!-- TOC -->
4-
* [CLI](./cmd/README.md)
5-
* [Components](./COMPONENTS.md)
6-
* [Configuration](./CONFIGURATION.md)
7-
* [Caching](./CACHING.md)
8-
* [Local Observability Stack](./cmd/observability/README.md)
9-
* [Examples](https://github.com/smartcontractkit/chainlink/tree/8e8597aa14c39c48ed4b3261f6080fa43b5d7cd0/e2e/capabilities)
10-
<!-- TOC -->
3+
Modular and data-driven harness for Chainlink on-chain and off-chain components.
114

12-
This module includes the CTFv2 harness, a lightweight, modular, and data-driven framework designed for combining off-chain and on-chain components while implementing best practices for end-to-end system-level testing:
13-
14-
- **Non-nil configuration**: All test variables must have defaults, automatic validation.
15-
- **Component isolation**: Components are decoupled via input/output structs, without exposing internal details.
16-
- **Modular configuration**: No arcane knowledge of framework settings is required; the config is simply a reflection of the components being used in the test. Components declare their own configuration—'what you see is what you get.'
17-
- **Replaceability and extensibility**: Since components are decoupled via outputs, any deployment component can be swapped with a real service without altering the test code.
18-
- **Caching**: any component can use cached configs to skip environment setup for faster test development
19-
- **Integrated observability stack**: use `ctf obs up` to spin up a local observability stack.
20-
21-
22-
### Environment variables (Tests, when using in Go code)
23-
| Name | Description | Possible values | Default | Required? |
24-
|:----------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|-------------------------:|:-------:|:------------------------:|
25-
| CTF_CONFIGS | Path(s) to test config files. <br/>Can be more than one, ex.: smoke.toml,smoke_1.toml,smoke_2.toml.<br/>First filepath will hold all the merged values | Any valid TOML file path | ||
26-
| CTF_LOG_LEVEL | Harness log level | `info`, `debug`, `trace` | `info` | 🚫 |
27-
| CTF_LOKI_STREAM | Streams all components logs to `Loki`, see params below | `true`, `false` | `false` | 🚫 |
28-
| LOKI_URL | URL to `Loki` push api, should be like`${host}/loki/api/v1/push` | URL | - | If you use `Loki` then ✅ |
29-
| LOKI_TENANT_ID | Streams all components logs to `Loki`, see params below | `true`, `false` | - | If you use `Loki` then ✅ |
30-
| TESTCONTAINERS_RYUK_DISABLED | Testcontainers-Go reaper container, removes all the containers after the test exit | `true`, `false` | `false` | 🚫 |
31-
| RESTY_DEBUG | Log all Resty client HTTP calls | `true`, `false` | `false` | 🚫 |
5+
[![Documentation](https://img.shields.io/badge/Documentation-MDBook-blue?style=for-the-badge)](http://localhost:9999/framework/overview.html)

0 commit comments

Comments
 (0)