Skip to content

Commit ec74850

Browse files
committed
Merge branch 'main' of github.com:smartcontractkit/chainlink-testing-framework into DX-933/closedTickets
2 parents 82b2869 + 7ea1859 commit ec74850

File tree

28 files changed

+645
-28
lines changed

28 files changed

+645
-28
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ jobs:
6363
config: scalability.toml
6464
count: 1
6565
timeout: 10m
66+
- name: TestLocalS3
67+
config: local_s3.toml
68+
count: 1
69+
timeout: 10m
6670
name: ${{ matrix.test.name }}
6771
steps:
6872
- name: Checkout repo

book/src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
- [Chainlink](framework/components/chainlink.md)
5353
- [Node](framework/components/chainlink/node.md)
5454
- [NodeSet](framework/components/chainlink/nodeset.md)
55+
- [Storage](framework/components/storage.md)
56+
- [S3](framework/components/storage/s3.md)
5557
- [Clients]()
5658
- [Chainlink]()
5759
- [RPC]()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Storage
2+
3+
Here we store `Storage` components: S3.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# S3
2+
3+
The framework contains local S3 provider.
4+
Currently, we support [MinIO](github.com/minio/minio).
5+
6+
## Configuration
7+
```toml
8+
[local_s3]
9+
host = "minio"
10+
port = 9000
11+
console_port = 9001
12+
access_key = "(default:random)"
13+
secret_key = "(default:random)"
14+
bucket = "test-bucket"
15+
region = "us-east-1"
16+
```
17+
18+
Example values are defaults.
19+
20+
## Usage
21+
22+
```golang
23+
package my_test
24+
25+
import (
26+
"fmt"
27+
"os"
28+
"testing"
29+
30+
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/s3provider"
31+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
32+
"github.com/stretchr/testify/require"
33+
)
34+
35+
type Config struct {
36+
S3Config *s3provider.Input `toml:"local_s3" validate:"required"`
37+
}
38+
39+
func TestLocalS3(t *testing.T) {
40+
in, err := framework.Load[Config](t)
41+
require.NoError(t, err)
42+
43+
output, err := NewMinioFactory().NewFrom(in)
44+
require.NoError(t, err)
45+
46+
t.log(fmt.Printf("%#v", output))
47+
}
48+
```
49+
50+
Alternatively, the component supports Options pattern and can be created from code:
51+
```golang
52+
// ...
53+
s3provider, err := NewMinioFactory().New(
54+
WithPort(port),
55+
WithConsolePort(consolePort),
56+
WithAccessKey(accessKey),
57+
WithSecretKey(secretKey),
58+
)
59+
require.NoError(t, err)
60+
61+
output := s3provider.Output()
62+
// ...
63+
```

framework/.changeset/v0.8.6.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Aptos support for arm64

framework/.changeset/v0.8.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Allow host network option for GAP integration

framework/.changeset/v0.8.8.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Local S3 provider

framework/.changeset/v0.8.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Increase blockchain, CL node and Postgres containers startup times

framework/components/blockchain/aptos.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"path/filepath"
7+
"runtime"
78
"strings"
89

910
"github.com/docker/docker/api/types/container"
@@ -14,8 +15,10 @@ import (
1415
)
1516

1617
const (
17-
DefaultAptosAPIPort = "8080"
18-
DefaultAptosFaucetPort = "8081"
18+
DefaultAptosAPIPort = "8080"
19+
DefaultAptosFaucetPort = "8081"
20+
DefaultAptosArm64Image = "ghcr.io/friedemannf/aptos-tools:aptos-node-v1.30.2-rc"
21+
DefaultAptosX86_64Image = "aptoslabs/tools:aptos-node-v1.27.2"
1922
)
2023

2124
var (
@@ -25,7 +28,16 @@ var (
2528

2629
func defaultAptos(in *Input) {
2730
if in.Image == "" {
28-
in.Image = "aptoslabs/tools:aptos-node-v1.27.2"
31+
// Aptos doesn't support an official arm64 image yet, so we use a custom image for now
32+
// CI Runners use x86_64 images, so CI checks will use the official image
33+
if runtime.GOARCH == "arm64" {
34+
// Uses an unofficial image built for arm64
35+
framework.L.Warn().Msgf("Using unofficial Aptos image for arm64 %s", DefaultAptosArm64Image)
36+
in.Image = DefaultAptosArm64Image
37+
} else {
38+
// Official Aptos image
39+
in.Image = DefaultAptosX86_64Image
40+
}
2941
}
3042
framework.L.Warn().Msgf("Aptos node API can only be exposed on port %s!", DefaultAptosAPIPort)
3143
if in.Port == "" {
@@ -68,6 +80,14 @@ func newAptos(in *Input) (*Output, error) {
6880
cmd = append(cmd, in.DockerCmdParamsOverrides...)
6981
}
7082

83+
// Set image platform based on architecture
84+
var imagePlatform string
85+
if runtime.GOARCH == "arm64" {
86+
imagePlatform = "linux/arm64"
87+
} else {
88+
imagePlatform = "linux/amd64"
89+
}
90+
7191
req := testcontainers.ContainerRequest{
7292
Image: in.Image,
7393
ExposedPorts: exposedPorts,
@@ -82,7 +102,7 @@ func newAptos(in *Input) (*Output, error) {
82102
h.PortBindings = bindings
83103
framework.ResourceLimitsFunc(h, in.ContainerResources)
84104
},
85-
ImagePlatform: "linux/amd64",
105+
ImagePlatform: imagePlatform,
86106
Cmd: cmd,
87107
Files: []testcontainers.ContainerFile{
88108
{

framework/components/blockchain/blockchain.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ type Input struct {
5454
SolanaPrograms map[string]string `toml:"solana_programs"`
5555
ContainerResources *framework.ContainerResources `toml:"resources"`
5656
CustomPorts []string `toml:"custom_ports"`
57+
58+
// GAPv2 specific params
59+
HostNetworkMode bool `toml:"host_network_mode"`
60+
CertificatesPath string `toml:"certificates_path"`
5761
}
5862

5963
// Output is a blockchain network output, ChainID and one or more nodes that forms the network

0 commit comments

Comments
 (0)