Skip to content

Commit 14b1185

Browse files
authored
Merge branch 'main' into tt-1772-wasp-o1-mini
2 parents babb831 + 0dd918b commit 14b1185

File tree

107 files changed

+2192
-1691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2192
-1691
lines changed

.github/workflows/framework-golden-tests.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,23 @@ jobs:
2222
config: smoke.toml
2323
count: 1
2424
timeout: 10m
25-
- name: TestLoad
26-
config: load.toml
25+
- name: TestUpgrade
26+
config: upgrade.toml
2727
count: 1
2828
timeout: 10m
29-
- name: TestChaos
30-
config: chaos.toml
29+
- name: TestPerformanceBaseline
30+
config: performance_baseline.toml
3131
count: 1
3232
timeout: 10m
33-
- name: TestUpgradeAll
34-
config: upgrade_all.toml
33+
- name: TestChaos
34+
config: chaos.toml
3535
count: 1
3636
timeout: 10m
37-
- name: TestUpgradeSome
38-
config: upgrade_some.toml
37+
- name: TestScalability
38+
config: scalability.toml
3939
count: 1
4040
timeout: 10m
41+
name: ${{ matrix.test.name }}
4142
steps:
4243
- name: Checkout repo
4344
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
@@ -74,7 +75,7 @@ jobs:
7475
go-modules-${{ runner.os }}
7576
- name: Install dependencies
7677
run: go mod download
77-
- name: Run Docker Component Tests
78+
- name: Run System Tests
7879
if: steps.changes.outputs.src == 'true'
7980
env:
8081
CTF_CONFIGS: ${{ matrix.test.config }}

.github/workflows/framework.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ concurrency:
55
group: ${{ github.workflow }}-${{ github.ref }}-framework
66
cancel-in-progress: true
77
jobs:
8-
test:
8+
framework-component-tests:
99
defaults:
1010
run:
1111
working-directory: framework
@@ -51,4 +51,4 @@ jobs:
5151
- name: Run Docker Component Tests
5252
if: steps.changes.outputs.src == 'true'
5353
run: |
54-
go test -timeout 5m -v -count 1 -run TestDocker ./...
54+
go test -timeout 2m -v -count 1 -run TestComponent ./...

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ suite/remote_runner_config.yaml
4646
*.csv
4747

4848
# docs
49-
docs/_site/
50-
docs/.sass-cache/
51-
docs/Gemfile.lock
49+
book/docs/
5250

5351
dist/
5452

@@ -78,4 +76,4 @@ __debug*
7876
.tool-versions
7977

8078
import_keys_test.go
81-
tag.py
79+
tag.py

book/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
## MDBook
2-
Install [mdbook](https://github.com/rust-lang/mdBook)
3-
```
1+
# Chainlink Testing Framework Docs
2+
3+
We use [mdBook](https://github.com/rust-lang/mdBook) for our docs. They can be found [here](https://smartcontractkit.github.io/chainlink-testing-framework/).
4+
5+
## Development
6+
7+
First [install Rust](https://doc.rust-lang.org/cargo/getting-started/installation.html), then [mdbook](https://github.com/rust-lang/mdBook).
8+
9+
```sh
10+
# Install mdBook
411
cargo install mdbook && \
512
cargo install mdbook-alerts && \
613
cargo install mdbook-cmdrun
7-
```
8-
9-
Run it locally
10-
```
14+
# Run the mdBook
1115
make run
1216
```
13-
Open your browser [here](http://localhost:9999/)
1417

15-
GitHub hosted [version](https://smartcontractkit.github.io/chainlink-testing-framework/overview.html)
18+
Visit [localhost:9999](http://localhost:9999) to see your local version.

book/src/SUMMARY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
- [CLI](./framework/cli.md)
1515
- [Configuration](./framework/configuration.md)
1616
- [Test Configuration](./framework/test_configuration_overrides.md)
17-
- [Components Persistence](framework/components/state.md)
17+
- [Exposing Components](framework/components/state.md)
1818
- [Components Cleanup](framework/components/cleanup.md)
1919
- [Components Caching](framework/components/caching.md)
20+
- [Mocking Services](framework/components/mocking.md)
21+
- [Copying Files](framework/copying_files.md)
2022
- [External Environment](framework/components/external.md)
2123
- [Secrets]()
2224
- [Observability Stack](framework/observability/observability_stack.md)
@@ -39,7 +41,7 @@
3941
- [Chainlink]()
4042
- [RPC]()
4143
- [Loki]()
42-
- [Testing](framework/testing.md)
44+
- [Testing Maturity Model](framework/testing.md)
4345
- [Smoke]()
4446
- [Performance]()
4547
- [Chaos]()

book/src/framework/components/chainlink/node.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ Here we provide full configuration reference, if you want to copy and run it, pl
1010
## Configuration
1111
```toml
1212
[cl_node]
13-
# Optional URL for fake data provider URL
14-
# usually set up in test with local mock server
15-
data_provider_url = "http://example.com"
1613

1714
[cl_node.db]
1815
# PostgreSQL image version and tag
1916
image = "postgres:15.6"
2017
# Pulls the image every time if set to 'true', used like that in CI. Can be set to 'false' to speed up local runs
21-
pull_image = true
18+
pull_image = false
2219

2320
[cl_node.node]
21+
# custom ports that plugins may need to expose and map to the host machine
22+
custom_ports = [14000, 14001]
2423
# A list of paths to capability binaries
2524
capabilities = ["./capability_1", "./capability_2"]
2625
# Default capabilities directory inside container
@@ -34,7 +33,7 @@ Here we provide full configuration reference, if you want to copy and run it, pl
3433
# Optional name for image we build, default is "ctftmp"
3534
docker_image_name = "ctftmp"
3635
# Pulls the image every time if set to 'true', used like that in CI. Can be set to 'false' to speed up local runs
37-
pull_image = true
36+
pull_image = false
3837
# Overrides Chainlink node TOML configuration
3938
# can be multiline, see example
4039
user_config_overrides = """
@@ -54,6 +53,10 @@ Here we provide full configuration reference, if you want to copy and run it, pl
5453
use_cache = true
5554
# Describes deployed or external Chainlink node
5655
[cl_node.out.node]
56+
# API user name
57+
api_auth_user = '[email protected]'
58+
# API password
59+
api_auth_password = 'fj293fbBnlQ!f9vNs'
5760
# Host Docker URLs the test uses
5861
# in case of using external component you can replace these URLs with another deployment
5962
p2p_url = "http://127.0.0.1:32812"

book/src/framework/components/chainlink/nodeset.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,20 @@ Then configure NodeSet
5252
http_port_range_start = 10000
5353
# P2P API port range start, each new node get port incremented (host machine)
5454
p2p_port_range_start = 12000
55-
55+
56+
[nodeset.db]
57+
# PostgreSQL image version and tag
58+
image = "postgres:15.6"
59+
# Pulls the image every time if set to 'true', used like that in CI. Can be set to 'false' to speed up local runs
60+
pull_image = false
61+
# PostgreSQL volume name
62+
volume_name = ""
5663

5764
[[nodeset.node_specs]]
58-
# Optional URL for fake data provider URL
59-
# usually set up in test with local mock server
60-
data_provider_url = "http://example.com"
61-
62-
[nodeset.node_specs.db]
63-
# PostgreSQL image version and tag
64-
image = "postgres:15.6"
65-
# Pulls the image every time if set to 'true', used like that in CI. Can be set to 'false' to speed up local runs
66-
pull_image = true
67-
# PostgreSQL volume name
68-
volume_name = ""
6965

7066
[nodeset.node_specs.node]
67+
# custom ports that plugins may need to expose and map to the host machine
68+
custom_ports = [14000, 14001]
7169
# A list of paths to capability binaries
7270
capabilities = ["./capability_1", "./capability_2"]
7371
# Default capabilities directory inside container
@@ -81,7 +79,7 @@ Then configure NodeSet
8179
# Optional name for image we build, default is "ctftmp"
8280
docker_image_name = "ctftmp"
8381
# Pulls the image every time if set to 'true', used like that in CI. Can be set to 'false' to speed up local runs
84-
pull_image = true
82+
pull_image = false
8583
# Overrides Chainlink node TOML configuration
8684
# can be multiline, see example
8785
user_config_overrides = """
@@ -106,6 +104,10 @@ Then configure NodeSet
106104

107105
# Describes deployed or external Chainlink node
108106
[nodeset.out.cl_nodes.node]
107+
# API user name
108+
api_auth_user = '[email protected]'
109+
# API password
110+
api_auth_password = 'fj293fbBnlQ!f9vNs'
109111
# Host Docker URLs the test uses
110112
# in case of using external component you can replace these URLs with another deployment
111113
p2p_url = "http://127.0.0.1:32996"
@@ -130,15 +132,13 @@ package capabilities_test
130132
import (
131133
"github.com/smartcontractkit/chainlink-testing-framework/framework"
132134
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
133-
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
134135
ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
135136
"github.com/stretchr/testify/require"
136137
"testing"
137138
)
138139

139140
type Config struct {
140141
BlockchainA *blockchain.Input `toml:"blockchain_a" validate:"required"`
141-
MockerDataProvider *fake.Input `toml:"data_provider" validate:"required"`
142142
NodeSet *ns.Input `toml:"nodeset" validate:"required"`
143143
}
144144

@@ -148,9 +148,7 @@ func TestMe(t *testing.T) {
148148

149149
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
150150
require.NoError(t, err)
151-
dp, err := fake.NewFakeDataProvider(in.MockerDataProvider)
152-
require.NoError(t, err)
153-
out, err := ns.NewSharedDBNodeSet(in.NodeSet, bc, dp.BaseURLDocker)
151+
out, err := ns.NewSharedDBNodeSet(in.NodeSet, bc)
154152
require.NoError(t, err)
155153

156154
t.Run("test something", func(t *testing.T) {

book/src/framework/components/external.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,10 @@ For example, to integrate with remote `k8s` environment you can use `CTF_CONFIGS
2020
http_url = "http://127.0.0.1:8545"
2121
ws_url = "ws://127.0.0.1:8545"
2222

23-
[contracts]
24-
25-
[contracts.out]
26-
# set up your contracts
27-
addresses = ["0x5fbdb2315678afecb367f032d93f642f64180aa3"]
28-
use_cache = true
29-
30-
[data_provider]
31-
port = 9111
32-
33-
[data_provider.out]
34-
# setup your data provider URLs
35-
base_url_host = "http://localhost:9111"
36-
3723
[nodeset]
3824

3925
[[nodeset.node_specs]]
26+
...
4027

4128
[nodeset.out]
4229
use_cache = true
@@ -45,6 +32,9 @@ For example, to integrate with remote `k8s` environment you can use `CTF_CONFIGS
4532
use_cache = true
4633

4734
[nodeset.out.cl_nodes.node]
35+
# set up your user/password for API authorization
36+
api_auth_user = '[email protected]'
37+
api_auth_password = 'fj293fbBnlQ!f9vNs'
4838
# set up each node URLs
4939
p2p_url = "http://127.0.0.1:12000"
5040
url = "http://127.0.0.1:10000"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Mocking Services
2+
3+
The framework aims to equip you with all the necessary tools to write end-to-end system-level tests, while still allowing the flexibility to mock third-party services that are not critical to your testing scope.
4+
5+
## Configuration
6+
```toml
7+
[fake]
8+
# port to start Gin server
9+
port = 9111
10+
```
11+
12+
## Usage
13+
14+
See [full](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/fake_test.go) example.

book/src/framework/components/state.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Components Persistence
1+
# Exposing Components (Data and ports)
22

33
We use static port ranges and volumes for all components to simplify Docker port management for developers.
44

@@ -9,6 +9,7 @@ When deploying a component, you can explicitly configure port ranges if the defa
99
Defaults are:
1010
- [NodeSet](../components/chainlink/nodeset.md) (Node HTTP API): `10000..100XX`
1111
- [NodeSet](../components/chainlink/nodeset.md) (Node P2P API): `12000..120XX`
12+
- Shared `PostgreSQL` volume is called `postgresql_data`
1213
```
1314
[nodeset]
1415
# HTTP API port range start, each new node get port incremented (host machine)
@@ -27,6 +28,7 @@ Defaults are:
2728

2829
When you run `ctf d rm` database volume will be **removed**.
2930

31+
3032
<div class="warning">
3133

3234
One node set is enough for any kind of testing, if you need more nodes consider extending your existing node set:
@@ -35,3 +37,22 @@ One node set is enough for any kind of testing, if you need more nodes consider
3537
nodes = 10
3638
```
3739
</div>
40+
41+
## Custom ports
42+
43+
You can also define a custom set of ports for any node
44+
```toml
45+
[nodeset]
46+
nodes = 5
47+
override_mode = "each"
48+
49+
[nodeset.db]
50+
image = "postgres:15.6"
51+
52+
[[nodeset.node_specs]]
53+
54+
[nodeset.node_specs.node]
55+
# here we defined 2 new ports to listen and mapped them to our host machine
56+
custom_ports = [14000, 14001]
57+
image = "public.ecr.aws/chainlink/chainlink:v2.16.0"
58+
```

0 commit comments

Comments
 (0)