Skip to content

Commit 2d5d34f

Browse files
authored
fix(sui,aptos): skip tarring cwd when ContractsDir is empty (#2519)
1 parent c5a51ef commit 2d5d34f

3 files changed

Lines changed: 27 additions & 18 deletions

File tree

framework/.changeset/v0.15.16.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix Sui/Aptos CTF providers tarring the process working directory when `ContractsDir` is empty, eliminating an `archive/tar: write too long` flake in downstream CCIP smoke tests

framework/components/blockchain/aptos.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,18 @@ func newAptos(ctx context.Context, in *Input) (*Output, error) {
5555
defaultAptos(in)
5656
containerName := framework.DefaultTCName("blockchain-node")
5757

58-
absPath, err := filepath.Abs(in.ContractsDir)
59-
if err != nil {
60-
return nil, err
58+
var files []testcontainers.ContainerFile
59+
if in.ContractsDir != "" {
60+
absPath, err := filepath.Abs(in.ContractsDir)
61+
if err != nil {
62+
return nil, err
63+
}
64+
files = []testcontainers.ContainerFile{
65+
{
66+
HostFilePath: absPath,
67+
ContainerFilePath: "/",
68+
},
69+
}
6170
}
6271

6372
exposedPorts, bindings, err := framework.GenerateCustomPortsData(in.CustomPorts)
@@ -108,12 +117,7 @@ func newAptos(ctx context.Context, in *Input) (*Output, error) {
108117
},
109118
ImagePlatform: imagePlatform,
110119
Cmd: cmd,
111-
Files: []testcontainers.ContainerFile{
112-
{
113-
HostFilePath: absPath,
114-
ContainerFilePath: "/",
115-
},
116-
},
120+
Files: files,
117121
}
118122

119123
c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{

framework/components/blockchain/sui.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,18 @@ func newSui(ctx context.Context, in *Input) (*Output, error) {
9595
defaultSui(in)
9696
containerName := framework.DefaultTCName("blockchain-node")
9797

98-
absPath, err := filepath.Abs(in.ContractsDir)
99-
if err != nil {
100-
return nil, err
98+
var files []testcontainers.ContainerFile
99+
if in.ContractsDir != "" {
100+
absPath, err := filepath.Abs(in.ContractsDir)
101+
if err != nil {
102+
return nil, err
103+
}
104+
files = []testcontainers.ContainerFile{
105+
{
106+
HostFilePath: absPath,
107+
ContainerFilePath: "/",
108+
},
109+
}
101110
}
102111

103112
// Sui container always listens on port 9000 internally
@@ -150,12 +159,7 @@ func newSui(ctx context.Context, in *Input) (*Output, error) {
150159
"--force-regenesis",
151160
"--with-faucet",
152161
},
153-
Files: []testcontainers.ContainerFile{
154-
{
155-
HostFilePath: absPath,
156-
ContainerFilePath: "/",
157-
},
158-
},
162+
Files: files,
159163
// we need faucet for funding
160164
WaitingFor: wait.ForListeningPort(DefaultFaucetPort).WithStartupTimeout(1 * time.Minute).WithPollInterval(200 * time.Millisecond),
161165
}

0 commit comments

Comments
 (0)