File tree Expand file tree Collapse file tree 3 files changed +107
-0
lines changed
framework/examples/myproject Expand file tree Collapse file tree 3 files changed +107
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Framework Docker Cache Test
2+ on :
3+ push :
4+
5+ jobs :
6+ test :
7+ defaults :
8+ run :
9+ working-directory : framework/examples/myproject
10+ env :
11+ LOKI_TENANT_ID : promtail
12+ LOKI_URL : http://localhost:3030/loki/api/v1/push
13+ runs-on : ubuntu-latest
14+ permissions :
15+ id-token : write
16+ contents : read
17+ strategy :
18+ fail-fast : false
19+ matrix :
20+ test :
21+ - name : TestBuild
22+ config : build.toml
23+ count : 1
24+ timeout : 10m
25+ name : ${{ matrix.test.name }}
26+ steps :
27+ - name : Checkout repo
28+ uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
29+ - name : Set up Go
30+ uses : actions/setup-go@v4
31+ with :
32+ go-version : 1.22.8
33+ - name : Cache Go modules
34+ uses : actions/cache@v3
35+ with :
36+ path : |
37+ ~/.cache/go-build
38+ ~/go/pkg/mod
39+ key : go-modules-${{ hashFiles('framework/examples/myproject/go.sum') }}-${{ runner.os }}-framework-golden-examples
40+ restore-keys : |
41+ go-modules-${{ runner.os }}-framework-golden-examples
42+ go-modules-${{ runner.os }}
43+ - name : Install dependencies
44+ run : go mod download
45+ - name : Checkout Chainlink repository
46+ uses : actions/checkout@v3
47+ with :
48+ repository : smartcontractkit/chainlink
49+ path : chainlink-repo
50+ - name : Run System Tests
51+ env :
52+ CTF_CONFIGS : ${{ matrix.test.config }}
53+ run : |
54+ go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }}
55+ - name : Upload Logs
56+ if : always()
57+ uses : actions/upload-artifact@v3
58+ with :
59+ name : container-logs-${{ matrix.test.name }}
60+ path : framework/examples/myproject/logs
61+ retention-days : 1
Original file line number Diff line number Diff line change 1+
2+ [blockchain_a ]
3+ type = " anvil"
4+ docker_cmd_params = [" -b" , " 1" ]
5+
6+ [data_provider ]
7+ port = 9111
8+
9+ [nodeset ]
10+ nodes = 5
11+ override_mode = " all"
12+
13+ [nodeset .db ]
14+ image = " postgres:12.0"
15+
16+ [[nodeset .node_specs ]]
17+
18+ [nodeset .node_specs .node ]
19+ docker_ctx = " ../../chainlink-repo"
20+ docker_file = " plugins/chainlink.Dockerfile"
Original file line number Diff line number Diff line change 1+ package examples
2+
3+ import (
4+ "github.com/smartcontractkit/chainlink-testing-framework/framework"
5+ "github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
6+ "github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
7+ ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
8+ "github.com/stretchr/testify/require"
9+ "testing"
10+ )
11+
12+ type CfgBuild struct {
13+ BlockchainA * blockchain.Input `toml:"blockchain_a" validate:"required"`
14+ MockerDataProvider * fake.Input `toml:"data_provider" validate:"required"`
15+ NodeSet * ns.Input `toml:"nodeset" validate:"required"`
16+ }
17+
18+ func TestBuild (t * testing.T ) {
19+ in , err := framework.Load [CfgBuild ](t )
20+ require .NoError (t , err )
21+
22+ bc , err := blockchain .NewBlockchainNetwork (in .BlockchainA )
23+ require .NoError (t , err )
24+ _ , err = ns .NewSharedDBNodeSet (in .NodeSet , bc )
25+ require .NoError (t , err )
26+ }
You can’t perform that action at this time.
0 commit comments