Skip to content

Commit dd11b12

Browse files
committed
finalize
1 parent 9e76309 commit dd11b12

File tree

10 files changed

+390
-109
lines changed

10 files changed

+390
-109
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- [Components Caching](framework/components/caching.md)
2727
- [Components Resources](framework/components/resources.md)
2828
- [Containers Network Isolation](framework/components/network_isolation.md)
29-
- [Mocking Services](framework/components/mocking.md)
29+
- [Faking Services](framework/components/mocking.md)
3030
- [Copying Files](framework/copying_files.md)
3131
- [External Environment](framework/components/external.md)
3232
- [Troubleshooting](framework/components/troubleshooting.md)

book/src/framework/components/mocking.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Use `framework.HostDockerInternal()` to reference `host.docker.internal` in your
2525

2626
## Dockerized Usage
2727

28-
Copy this example into your project, write the logic of fake, build and upload it and run.
28+
Copy this example into your project, write the logic of fake using `fake.JSON` and `fake.Func`, build and upload it and run.
2929

3030
## Install
3131

@@ -62,6 +62,14 @@ task publish -- $tag
6262
See full [example](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/fake_docker_test.go)
6363

6464
Run it
65+
```toml
66+
[fake]
67+
# the image you've built
68+
image = "test-fakes:myproduct-1.0"
69+
# port for Gin server
70+
port = 9111
71+
```
72+
6573
```
6674
CTF_CONFIGS=fake_docker.toml go test -v -run TestDockerFakes
6775
```

framework/components/fake/go.sum

Lines changed: 297 additions & 0 deletions
Large diffs are not rendered by default.

framework/examples/myproject/fakes/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ replace github.com/smartcontractkit/chainlink-testing-framework/framework/compon
66

77
require (
88
github.com/gin-gonic/gin v1.10.1
9+
github.com/rs/zerolog v1.33.0
910
github.com/smartcontractkit/chainlink-testing-framework/framework v0.9.9
1011
)
1112

@@ -76,7 +77,6 @@ require (
7677
github.com/pkg/errors v0.9.1 // indirect
7778
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
7879
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
79-
github.com/rs/zerolog v1.33.0 // indirect
8080
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
8181
github.com/sirupsen/logrus v1.9.3 // indirect
8282
github.com/stretchr/testify v1.10.0 // indirect

framework/examples/myproject/fakes/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"github.com/gin-gonic/gin"
5+
"github.com/rs/zerolog/log"
56

67
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
78
)
@@ -17,7 +18,7 @@ func main() {
1718
})
1819
})
1920
if err != nil {
20-
panic(err)
21+
log.Fatal().Err(err).Msg("failed to stark fake server API")
2122
}
2223
select {}
2324
}

framework/examples/myproject/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,10 @@ require (
414414
sigs.k8s.io/yaml v1.4.0 // indirect
415415
)
416416

417-
// replicating the replace directive on cosmos SDK
418417
replace (
418+
// replicating the replace directive on cosmos SDK
419419
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
420+
// this is needed because of github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose deps
420421
go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.35.0
421422
go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0
422423
go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.35.0

framework/examples/myproject_cll/go.mod

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
module github.com/smartcontractkit/chainlink-testing-framework/framework/examples_cll
22

3-
go 1.24.2
3+
go 1.24.4
44

55
replace (
66
github.com/smartcontractkit/chainlink-testing-framework/framework => ../../
7+
github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake => ../../components/fake
78
github.com/smartcontractkit/chainlink-testing-framework/wasp => ../../../wasp
89
)
910

1011
require (
1112
github.com/smartcontractkit/chainlink-testing-framework/framework v0.0.0-00010101000000-000000000000
13+
github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake v0.0.0-00010101000000-000000000000
1214
github.com/stretchr/testify v1.10.0
1315
)
1416

@@ -41,6 +43,8 @@ require (
4143
github.com/cloudwego/iasm v0.2.0 // indirect
4244
github.com/consensys/bavard v0.1.22 // indirect
4345
github.com/consensys/gnark-crypto v0.14.0 // indirect
46+
github.com/containerd/errdefs v1.0.0 // indirect
47+
github.com/containerd/errdefs/pkg v0.3.0 // indirect
4448
github.com/containerd/log v0.1.0 // indirect
4549
github.com/containerd/platforms v1.0.0-rc.1 // indirect
4650
github.com/cpuguy83/dockercfg v0.3.2 // indirect
@@ -50,7 +54,7 @@ require (
5054
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
5155
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
5256
github.com/distribution/reference v0.6.0 // indirect
53-
github.com/docker/docker v28.0.4+incompatible // indirect
57+
github.com/docker/docker v28.3.1+incompatible // indirect
5458
github.com/docker/go-connections v0.5.0 // indirect
5559
github.com/docker/go-units v0.5.0 // indirect
5660
github.com/ebitengine/purego v0.8.2 // indirect
@@ -61,22 +65,22 @@ require (
6165
github.com/fsnotify/fsnotify v1.7.0 // indirect
6266
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
6367
github.com/gin-contrib/sse v0.1.0 // indirect
64-
github.com/gin-gonic/gin v1.10.0 // indirect
65-
github.com/go-logr/logr v1.4.2 // indirect
68+
github.com/gin-gonic/gin v1.10.1 // indirect
69+
github.com/go-logr/logr v1.4.3 // indirect
6670
github.com/go-logr/stdr v1.2.2 // indirect
6771
github.com/go-ole/go-ole v1.3.0 // indirect
6872
github.com/go-playground/locales v0.14.1 // indirect
6973
github.com/go-playground/universal-translator v0.18.1 // indirect
7074
github.com/go-playground/validator/v10 v10.22.1 // indirect
71-
github.com/go-resty/resty/v2 v2.15.3 // indirect
75+
github.com/go-resty/resty/v2 v2.16.5 // indirect
7276
github.com/goccy/go-json v0.10.3 // indirect
7377
github.com/gogo/protobuf v1.3.2 // indirect
7478
github.com/google/uuid v1.6.0 // indirect
7579
github.com/gorilla/websocket v1.5.1 // indirect
76-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
80+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
7781
github.com/holiman/uint256 v1.3.2 // indirect
7882
github.com/json-iterator/go v1.1.12 // indirect
79-
github.com/klauspost/compress v1.17.11 // indirect
83+
github.com/klauspost/compress v1.18.0 // indirect
8084
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
8185
github.com/leodido/go-urn v1.4.0 // indirect
8286
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
@@ -85,9 +89,10 @@ require (
8589
github.com/mattn/go-isatty v0.0.20 // indirect
8690
github.com/mmcloughlin/addchain v0.4.0 // indirect
8791
github.com/moby/docker-image-spec v1.3.1 // indirect
92+
github.com/moby/go-archive v0.1.0 // indirect
8893
github.com/moby/patternmatcher v0.6.0 // indirect
8994
github.com/moby/sys/sequential v0.6.0 // indirect
90-
github.com/moby/sys/user v0.3.0 // indirect
95+
github.com/moby/sys/user v0.4.0 // indirect
9196
github.com/moby/sys/userns v0.1.0 // indirect
9297
github.com/moby/term v0.5.2 // indirect
9398
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
@@ -115,20 +120,20 @@ require (
115120
github.com/yusufpapurcu/wmi v1.2.4 // indirect
116121
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
117122
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
118-
go.opentelemetry.io/otel v1.35.0 // indirect
119-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect
120-
go.opentelemetry.io/otel/metric v1.35.0 // indirect
121-
go.opentelemetry.io/otel/trace v1.35.0 // indirect
122-
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
123+
go.opentelemetry.io/otel v1.37.0 // indirect
124+
go.opentelemetry.io/otel/metric v1.37.0 // indirect
125+
go.opentelemetry.io/otel/trace v1.37.0 // indirect
123126
golang.org/x/arch v0.11.0 // indirect
124-
golang.org/x/crypto v0.37.0 // indirect
127+
golang.org/x/crypto v0.38.0 // indirect
125128
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
126-
golang.org/x/net v0.38.0 // indirect
127-
golang.org/x/sync v0.13.0 // indirect
128-
golang.org/x/sys v0.32.0 // indirect
129-
golang.org/x/text v0.24.0 // indirect
129+
golang.org/x/net v0.40.0 // indirect
130+
golang.org/x/sync v0.14.0 // indirect
131+
golang.org/x/sys v0.33.0 // indirect
132+
golang.org/x/text v0.25.0 // indirect
130133
golang.org/x/time v0.7.0 // indirect
131-
google.golang.org/protobuf v1.36.4 // indirect
134+
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect
135+
google.golang.org/grpc v1.72.2 // indirect
136+
google.golang.org/protobuf v1.36.6 // indirect
132137
gopkg.in/guregu/null.v4 v4.0.0 // indirect
133138
gopkg.in/yaml.v3 v3.0.1 // indirect
134139
rsc.io/tmplfunc v0.0.3 // indirect

0 commit comments

Comments
 (0)