Skip to content

Commit 77b7005

Browse files
committed
merge
2 parents 696e1b1 + 2fcbdd8 commit 77b7005

File tree

37 files changed

+406
-116
lines changed

37 files changed

+406
-116
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Framework Golden Private Tests Examples
2+
# Groups tests that require access to private container registries
3+
on:
4+
push:
5+
6+
jobs:
7+
test:
8+
defaults:
9+
run:
10+
working-directory: framework/examples/myproject
11+
env:
12+
CTF_JD_IMAGE: "${{secrets.AWS_ACCOUNT_ID_PROD}}.dkr.ecr.us-west-2.amazonaws.com/job-distributor:0.22.1"
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: TestPrivate
22+
config: jd.toml
23+
count: 1
24+
timeout: 10m
25+
# TODO: sdlc auth
26+
# - name: TestDockerFakes
27+
# config: fake_docker.toml
28+
# count: 1
29+
# timeout: 10m
30+
name: ${{ matrix.test.name }}
31+
steps:
32+
- name: Checkout repo
33+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
34+
- name: Configure AWS credentials using OIDC
35+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
36+
with:
37+
role-to-assume: ${{ secrets.AWS_CTF_READ_ACCESS_ROLE_ARN }}
38+
aws-region: us-west-2
39+
- name: Login to Amazon ECR
40+
id: login-ecr-private
41+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
42+
with:
43+
registries: ${{ format('{0},{1}', secrets.AWS_ACCOUNT_ID_SDLC, secrets.AWS_ACCOUNT_ID_PROD) }}
44+
env:
45+
AWS_REGION: us-west-2
46+
- name: Check for changes in Framework
47+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
48+
id: changes
49+
with:
50+
filters: |
51+
src:
52+
- 'framework/**'
53+
- '.github/workflows/framework-golden-tests.yml'
54+
- name: Set up Go
55+
uses: actions/setup-go@v5
56+
with:
57+
go-version: '1.24.0'
58+
- name: Cache Go modules
59+
uses: actions/cache@v4
60+
with:
61+
path: |
62+
~/.cache/go-build
63+
~/go/pkg/mod
64+
key: go-modules-${{ hashFiles('framework/examples/myproject/go.sum') }}-${{ runner.os }}-framework-golden-examples
65+
restore-keys: |
66+
go-modules-${{ runner.os }}-framework-golden-examples
67+
go-modules-${{ runner.os }}
68+
- name: Install dependencies
69+
run: go mod download
70+
- name: Run Tests
71+
if: steps.changes.outputs.src == 'true'
72+
env:
73+
CTF_CONFIGS: ${{ matrix.test.config }}
74+
run: |
75+
go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }}
76+
- name: Upload Logs
77+
if: always()
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: container-logs-${{ matrix.test.name }}
81+
path: framework/examples/myproject/logs
82+
retention-days: 1

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
config: fake.toml
7676
count: 1
7777
timeout: 10m
78-
# TODO: sdlc auth
78+
# TODO: sdlc auth (move to framework-golden-tests-private.yml, which has that auth set up)
7979
# - name: TestDockerFakes
8080
# config: fake_docker.toml
8181
# count: 1

framework/.changeset/v0.11.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Bump the Aptos node image to v1.36.6
1+
- Bump the Aptos node image to v1.36.6

framework/.changeset/v0.11.4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix failing node logs in OTel collector when enabled logs streaming

framework/.changeset/v0.11.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Enhance JD health checks and add a CI test for it

framework/.changeset/v0.11.6.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Allow to pass context to all components' constructors

framework/components/blockchain/anvil.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package blockchain
22

33
import (
4+
"context"
45
"strings"
56

67
"github.com/smartcontractkit/chainlink-testing-framework/framework"
@@ -31,8 +32,7 @@ func defaultAnvil(in *Input) {
3132
}
3233
}
3334

34-
// newAnvil deploy foundry anvil node
35-
func newAnvil(in *Input) (*Output, error) {
35+
func newAnvil(ctx context.Context, in *Input) (*Output, error) {
3636
if in.Out != nil && in.Out.UseCache {
3737
return in.Out, nil
3838
}
@@ -50,5 +50,5 @@ func newAnvil(in *Input) (*Output, error) {
5050

5151
framework.L.Info().Any("Cmd", strings.Join(entryPoint, " ")).Msg("Creating anvil with command")
5252

53-
return createGenericEvmContainer(in, req, false)
53+
return createGenericEvmContainer(ctx, in, req, false)
5454
}

framework/components/blockchain/anvil_zksync.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package blockchain
22

33
import (
4+
"context"
45
"os"
56
"path/filepath"
67
"strings"
@@ -41,7 +42,7 @@ RUN curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/in
4142
// creating a dockerfile in a temporary directory with the necessary commands to install
4243
// foundry-zksync.
4344
// see: https://foundry-book.zksync.io/getting-started/installation#using-foundry-with-docker
44-
func newAnvilZksync(in *Input) (*Output, error) {
45+
func newAnvilZksync(ctx context.Context, in *Input) (*Output, error) {
4546
defaultAnvilZksync(in)
4647
req := baseRequest(in, WithoutWsEndpoint)
4748

@@ -77,7 +78,7 @@ func newAnvilZksync(in *Input) (*Output, error) {
7778

7879
framework.L.Info().Any("Cmd", strings.Join(req.Entrypoint, " ")).Msg("Creating anvil zkSync with command")
7980

80-
output, err := createGenericEvmContainer(in, req, false)
81+
output, err := createGenericEvmContainer(ctx, in, req, false)
8182
if err != nil {
8283
return nil, err
8384
}

framework/components/blockchain/aptos.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ func defaultAptos(in *Input) {
5050
}
5151
}
5252

53-
func newAptos(in *Input) (*Output, error) {
53+
func newAptos(ctx context.Context, in *Input) (*Output, error) {
5454
defaultAptos(in)
55-
ctx := context.Background()
5655
containerName := framework.DefaultTCName("blockchain-node")
5756

5857
absPath, err := filepath.Abs(in.ContractsDir)
@@ -129,12 +128,12 @@ func newAptos(in *Input) (*Output, error) {
129128
return nil, err
130129
}
131130
cmdStr := []string{"aptos", "init", "--network=local", "--assume-yes", fmt.Sprintf("--private-key=%s", DefaultAptosPrivateKey)}
132-
_, err = dc.ExecContainer(containerName, cmdStr)
131+
_, err = dc.ExecContainerWithContext(ctx, containerName, cmdStr)
133132
if err != nil {
134133
return nil, err
135134
}
136135
fundCmd := []string{"aptos", "account", "fund-with-faucet", "--account", DefaultAptosAccount, "--amount", "1000000000000"}
137-
_, err = dc.ExecContainer(containerName, fundCmd)
136+
_, err = dc.ExecContainerWithContext(ctx, containerName, fundCmd)
138137
if err != nil {
139138
return nil, err
140139
}

framework/components/blockchain/besu.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package blockchain
22

3+
import "context"
4+
35
const (
46
DefaultBesuPrivateKey1 = "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63"
57
DefaultBesuPrivateKey2 = "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"
@@ -24,7 +26,7 @@ func defaultBesu(in *Input) {
2426
}
2527
}
2628

27-
func newBesu(in *Input) (*Output, error) {
29+
func newBesu(ctx context.Context, in *Input) (*Output, error) {
2830
defaultBesu(in)
2931
req := baseRequest(in, WithWsEndpoint)
3032

@@ -48,5 +50,5 @@ func newBesu(in *Input) (*Output, error) {
4850
entryPoint := append(defaultCmd, in.DockerCmdParamsOverrides...)
4951
req.Cmd = entryPoint
5052

51-
return createGenericEvmContainer(in, req, true)
53+
return createGenericEvmContainer(ctx, in, req, true)
5254
}

0 commit comments

Comments
 (0)