Skip to content

Commit e283a93

Browse files
committed
docs
1 parent 12c1567 commit e283a93

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
- [Chainlink]()
5454
- [RPC]()
5555
- [Loki]()
56+
- [Mono Repository Tooling](./monorepo-tools.md)
5657
- [Testing Maturity Model](framework/testing.md)
5758
- [Smoke]()
5859
- [Performance]()

book/src/monorepo-tools.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Mono Repository Tooling
2+
3+
In our multi-module Go repository, we use tools like:
4+
- DevBox
5+
- Just
6+
- Matrix CI pattern
7+
8+
Open DevBox shell:
9+
```
10+
devbox shell
11+
```
12+
13+
Install pre-commit hooks first:
14+
```
15+
just install
16+
```
17+
18+
Each package has tests, run using commands in the justfile, examples:
19+
```
20+
# run all the tests (cache)
21+
just test-all
22+
# run package tests with regex
23+
just test wasp TestSmoke
24+
# run all package tests
25+
just test tools/ghlatestreleasechecker ./...
26+
```
27+
28+
Use linters:
29+
```
30+
# all packages
31+
just lint-all
32+
# one package
33+
just lint wasp
34+
```
35+
36+
For extra dependencies, we use [NixHub](https://www.nixhub.io/) to add them to [DevBox](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/devbox.json), which also works in [CI](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/.github/workflows/seth-test.yml#L62).

book/src/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To get started with writing system-level tests, refer to the [Framework](./frame
1010

1111
If you want to build integration with Chainlink not in [Golang](https://go.dev/), please refer to our [Interactive](framework/interactive.md) chapter.
1212

13-
We are using [DevBox](https://www.jetify.com/docs/devbox/quickstart/) for dependencies.
13+
See mono repository [tooling](monorepo-tools.md) to start working with Go modules.
1414

1515
[Repository](https://github.com/smartcontractkit/chainlink-testing-framework) contains two major pieces:
1616
- [Framework](framework/overview.md)

justfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
go_test_args := env('GO_TEST_ARGS', '')
2+
13
# Print all the commands
24
default:
35
@just --list
46

57
# Install pre-commit hooks
68
install:
79
pre-commit install
10+
811
# Install gotestloghelper for enhanced go test logs output
912
install-loghelper:
1013
go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest
@@ -45,13 +48,13 @@ test-all:
4548
@just test wasp TestSmoke
4649
@just test wasp TestBenchSpy
4750

48-
# Default test command (cacheable)
51+
# Default test command (cacheable), set GO_TEST_ARGS="-count 1" to disable cache
4952
_default_cached_test dir test_regex:
50-
cd {{dir}} && go test -v -race `go list ./... | grep -v examples` -run {{test_regex}}
53+
cd {{dir}} && go test {{go_test_args}} -v -race `go list ./... | grep -v examples` -run {{test_regex}}
5154

5255
# Default test + coverage command (no-cache)
5356
_default_cover_test dir test_regex:
54-
cd {{dir}} && go test -v -race -cover -coverprofile=cover.out `go list ./... | grep -v examples` -run {{test_regex}}
57+
cd {{dir}} && go test {{go_test_args}} -v -race -cover -coverprofile=cover.out `go list ./... | grep -v examples` -run {{test_regex}}
5558

5659
# Run tests for a package, example: just test wasp TestSmoke, example: just test tools/citool ./...
5760
test dir_path test_regex:

0 commit comments

Comments
 (0)