Skip to content

Commit e77ef2b

Browse files
committed
Merge branch 'main' into tt-1862-remove-logstream
2 parents be0ae06 + 151614d commit e77ef2b

File tree

51 files changed

+1341
-81
lines changed

Some content is hidden

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

51 files changed

+1341
-81
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
env:
1111
LOKI_TENANT_ID: promtail
1212
LOKI_URL: http://localhost:3030/loki/api/v1/push
13+
# this is not the best practice, and it must be fixed, run your tests WITHOUT IT!
14+
# however, on current latest image we must use this flag
15+
CTF_IGNORE_CRITICAL_LOGS: true
1316
runs-on: ubuntu-latest
1417
permissions:
1518
id-token: write

book/src/SUMMARY.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
- [NodeSet with Capabilities](./framework/nodeset_capabilities.md)
1111
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
1212
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
13+
- [Creating your own components](./developing/developing_components.md)
1314
- [Fork Testing](./framework/fork.md)
1415
- [Quick Contracts Deployment](./framework/quick_deployment.md)
16+
- [Verifying Contracts](./framework/verify.md)
1517
- [NodeSet with External Blockchain]()
1618
- [CLI](./framework/cli.md)
1719
- [Configuration](./framework/configuration.md)
@@ -82,8 +84,6 @@
8284

8385
---
8486

85-
- [Developing](developing.md)
86-
- [Components](developing/developing_components.md)
8787
- [Releasing modules](releasing_modules.md)
8888

8989
---
@@ -92,6 +92,7 @@
9292
- [Kubernetes](lib/k8s/KUBERNETES.md)
9393
- [K8s Remote Run](lib/k8s/REMOTE_RUN.md)
9494
- [K8s Tutorial](lib/k8s/TUTORIAL.md)
95+
- [k8s chain.link labels](lib/k8s/labels.md)
9596
- [Config](lib/config/config.md)
9697
- [CRIB Connector](lib/crib.md)
9798
---

book/src/developing/developing_components.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ Each component can define inputs and outputs, following these rules:
4747
- If your component is used for side effects output can be omitted.
4848
- `input.Out.UseCache` should be added if you'd like to use caching, see more [here](caching)
4949

50-
### Docker components good practices for [testcontainers-go](https://golang.testcontainers.org/):
50+
### Building Local Images
5151

52-
An example [simple component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/blockchain/anvil.go)
52+
Use `framework.BuildImage` or `framework.BuildImageOnce` to build the docker image.
5353

54-
An example of [complex component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/clnode/clnode.go)
54+
Do not use `testcontainers.NewDockerProvider()` methods, see issues: [#1](https://github.com/testcontainers/testcontainers-go/pull/2482), [#2](https://github.com/testcontainers/testcontainers-go/issues/1484)
5555

56-
An example of [composite component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/simple_node_set/node_set.go)
56+
### Docker components good practices for [testcontainers-go](https://golang.testcontainers.org/):
5757

5858
- Inputs should include at least `image`, `tag` and `pull_image` field
5959
```golang
@@ -94,3 +94,10 @@ An example of [composite component](https://github.com/smartcontractkit/chainlin
9494
HostURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
9595
}, nil
9696
```
97+
98+
An example [simple component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/blockchain/anvil.go)
99+
100+
An example of [complex component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/clnode/clnode.go)
101+
102+
An example of [composite component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/simple_node_set/node_set.go)
103+

book/src/framework/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
| LOKI_TENANT_ID | Streams all components logs to `Loki`, see params below | `string` | `promtail` | 🚫 |
1212
| LOKI_BASIC_AUTH | Basic auth in format $user:$password | `$user:$password` | - | 🚫 |
1313
| RESTY_DEBUG | Log all Resty client HTTP calls | `true`, `false` | `false` | 🚫 |
14+
| CTF_IGNORE_CRITICAL_LOGS | Ignore all logs that has CRIT,FATAL or PANIC levels (Chainlink nodes only!) | `true`, `false` | `false` | 🚫 |
15+
| CTF_CHAINLINK_IMAGE | Flag to override Chainlink Docker image in format $repository:$tag | $repository:$tag | - | 🚫 |

book/src/framework/nodeset_docker_rebuild.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ Create a configuration file `smoke.toml`
2525

2626
These paths will work for `e2e/capabilities` in our main [repository](https://github.com/smartcontractkit/chainlink/tree/ctf-v2-tests/e2e/capabilities)
2727

28+
Also check how you can add rebuild to your [components](../developing/developing_components.md#building-local-images).
29+
2830
Summary:
2931
- We learned how we can quickly re-build local docker image for CL node

book/src/framework/observability/blockscout.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,4 @@ ctf bs -r http://host.docker.internal:8555 d
2525
Blockscout isn’t ideal for local, ephemeral environments, as it won’t re-index blocks and transactions on test reruns. The easiest approach is to set up Blockscout first, initialize the test environment, switch to the [cache](../components/caching.md) config, and run tests without restarting RPC nodes.
2626

2727
Otherwise, use `ctf bs r` each time you restart your test with a fresh docker environment.
28-
</div>
29-
30-
<div class="warning">
31-
32-
Blockscout integration is still WIP, for now Blockscout reads only one node that is on `:8545`, all our blockchain implementation expose this port by default.
33-
</div>
28+
</div>

book/src/framework/verify.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Verifying Contracts
2+
3+
Check out our [example](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/verify_test.go) of programmatically verifying contracts using `Blockscout` and `Foundry`. You'll need to provide:
4+
5+
- The path to your Foundry directory
6+
- The path to the contract
7+
- The contract name
8+
9+
```golang
10+
err := blockchain.VerifyContract(blockchainComponentOutput, c.Addresses[0].String(),
11+
"example_components/onchain",
12+
"src/Counter.sol",
13+
"Counter",
14+
)
15+
require.NoError(t, err)
16+
```

book/src/lib/k8s/REMOTE_RUN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export TEST_ENV_VAR=myTestVarForAJob
3939
# your image to run as a k8s job
4040
ACCOUNT=$(aws sts get-caller-identity | jq -r .Account)
4141
export ENV_JOB_IMAGE="${ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/core-integration-tests:v1.1"
42+
export DETACH_RUNNER=true # if you want the test job to run in the background after it has started
43+
export CHAINLINK_ENV_USER=yourUser # user to run the tests
44+
export CHAINLINK_USER_TEAM=yourTeam # team to run the tests for
4245
# your example test file to run inside k8s
4346
# if ENV_JOB_IMAGE is present it will create a job, wait until it finished and get logs
4447
go run examples/remote-test-runner/env.go

0 commit comments

Comments
 (0)