Skip to content

Commit f64df04

Browse files
authored
Merge branch 'main' into tt-1806-required-labels
2 parents 4c8999d + 4457e19 commit f64df04

File tree

37 files changed

+470
-339
lines changed

37 files changed

+470
-339
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
filters: |
6060
src:
6161
- 'framework/**'
62+
- '.github/workflows/framework-golden-tests.yml'
6263
- name: Set up Go
6364
uses: actions/setup-go@v4
6465
with:
@@ -81,3 +82,10 @@ jobs:
8182
CTF_CONFIGS: ${{ matrix.test.config }}
8283
run: |
8384
go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }}
85+
- name: Upload Logs
86+
if: always()
87+
uses: actions/upload-artifact@v3
88+
with:
89+
name: container-logs-${{ matrix.test.name }}
90+
path: framework/examples/myproject/logs
91+
retention-days: 1

.github/workflows/k8s-e2e.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: (k8s package) E2E tests
2-
on:
3-
pull_request:
2+
# disabling for now, as they always fail
3+
#on:
4+
# pull_request:
45

56
concurrency:
67
group: e2e-tests-k8s-${{ github.ref }}

.github/workflows/wasp-test-e2e.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: WASP E2E tests
2-
on: [push]
2+
# disabling for now, as they always fail
3+
#on:
4+
# push:
35
concurrency:
46
group: ${{ github.workflow }}-${{ github.ref }}
57
cancel-in-progress: true

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
golang 1.22.3
1+
golang 1.23.3
22
nodejs 18.20.3
33
k3d 5.6.3
44
act 0.2.52

book/src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
1212
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
1313
- [Fork Testing](./framework/fork.md)
14+
- [Quick Contracts Deployment](./framework/quick_deployment.md)
1415
- [NodeSet with External Blockchain]()
1516
- [CLI](./framework/cli.md)
1617
- [Configuration](./framework/configuration.md)
1718
- [Test Configuration](./framework/test_configuration_overrides.md)
1819
- [Exposing Components](framework/components/state.md)
20+
- [Debugging Tests](framework/components/debug.md)
1921
- [Components Cleanup](framework/components/cleanup.md)
2022
- [Components Caching](framework/components/caching.md)
2123
- [Mocking Services](framework/components/mocking.md)
@@ -27,7 +29,6 @@
2729
- [Logs](framework/observability/logs.md)
2830
- [Profiling](framework/observability/profiling.md)
2931
- [Traces]()
30-
- [Debugger]()
3132
- [Blockscout](framework/observability/blockscout.md)
3233
- [Components](framework/components/overview.md)
3334
- [Blockchains](framework/components/blockchains/overview.md)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Debugging Tests
2+
3+
All container logs are saved in a directory named `logs`, which will appear in the same directory where you ran the test after the test is completed.
4+
5+
For verifying your on-chain components, refer to the [Blockscout documentation](https://docs.blockscout.com/devs/verification/foundry-verification) on smart contract verification. This guide provides detailed instructions on uploading your ABI and verifying your contracts.
6+
7+
Use `CTF_LOG_LEVEL=trace|debug|info|warn` to debug the framework.
8+
9+
Use `RESTY_DEBUG=true` to debug any API calls.
10+
11+
Use `SETH_LOG_LEVEL=trace|debug|info|warn` to debug [Seth](../../libs/seth.md).
12+
13+
## Using Delve (TBD)
14+
15+
You can use [Delve]() inside your containers to debug aplications.
16+
17+
Build them with `go build -gcflags="all=-N -l" -o myapp` and use an example `Dockerfile`:
18+
```
19+
FROM golang:1.20
20+
21+
# Install Delve
22+
RUN go install github.com/go-delve/delve/cmd/dlv@latest
23+
24+
# Set working directory
25+
WORKDIR /app
26+
27+
# Copy the application binary and source code (if needed for debugging)
28+
COPY myapp /app/myapp
29+
COPY . /app
30+
31+
# Expose the port for Delve
32+
EXPOSE 40000
33+
34+
# Start Delve in headless mode for remote debugging
35+
ENTRYPOINT ["dlv", "exec", "./myapp", "--headless", "--listen=:40000", "--api-version=2", "--accept-multiclient"]
36+
37+
```
38+
39+
Adding `Delve` to all our components is WIP right now.
40+
41+
To expose `Delve` port follow this [guide](state.md).
42+
43+
44+

book/src/framework/components/mocking.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ The framework aims to equip you with all the necessary tools to write end-to-end
1212
## Usage
1313

1414
See [full](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/fake_test.go) example.
15+
16+
<div class="warning">
17+
18+
`host.docker.internal` is docker platform dependent!
19+
20+
Use `framework.HostDockerInternal()` to reference `host.docker.internal` in your tests, so they can work in GHA CI
21+
</div>

book/src/framework/observability/debugger.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Quick Contracts Deployment
2+
3+
You can control the mining pace to accelerate contract deployment. Start anvil with the following configuration:
4+
5+
```toml
6+
[blockchain_a]
7+
chain_id = "31337"
8+
image = "f4hrenh9it/foundry:latest"
9+
port = "8545"
10+
type = "anvil"
11+
```
12+
Set the `miner` speed,
13+
```golang
14+
// start periodic mining so nodes can receive heads (async)
15+
miner := rpc.NewRemoteAnvilMiner(bcSrc.Nodes[0].HostHTTPUrl, nil)
16+
miner.MinePeriodically(5 * time.Second)
17+
```
18+
19+
Then use this [template](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/quick_deploy_test.go)

framework/.changeset/v0.2.10.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Switch to "anvil_mine" instead of "evm_mine"
2+
- Test that CL nodes can see block heads after we switch the mining pace
3+
- Quick deployments example (docs)

0 commit comments

Comments
 (0)