diff --git a/framework/.changeset/v0.15.16.md b/framework/.changeset/v0.15.16.md new file mode 100644 index 000000000..2a4e86268 --- /dev/null +++ b/framework/.changeset/v0.15.16.md @@ -0,0 +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 \ No newline at end of file diff --git a/framework/components/blockchain/aptos.go b/framework/components/blockchain/aptos.go index 42b66ee1a..46c475efd 100644 --- a/framework/components/blockchain/aptos.go +++ b/framework/components/blockchain/aptos.go @@ -55,9 +55,18 @@ func newAptos(ctx context.Context, in *Input) (*Output, error) { defaultAptos(in) containerName := framework.DefaultTCName("blockchain-node") - absPath, err := filepath.Abs(in.ContractsDir) - if err != nil { - return nil, err + var files []testcontainers.ContainerFile + if in.ContractsDir != "" { + absPath, err := filepath.Abs(in.ContractsDir) + if err != nil { + return nil, err + } + files = []testcontainers.ContainerFile{ + { + HostFilePath: absPath, + ContainerFilePath: "/", + }, + } } exposedPorts, bindings, err := framework.GenerateCustomPortsData(in.CustomPorts) @@ -108,12 +117,7 @@ func newAptos(ctx context.Context, in *Input) (*Output, error) { }, ImagePlatform: imagePlatform, Cmd: cmd, - Files: []testcontainers.ContainerFile{ - { - HostFilePath: absPath, - ContainerFilePath: "/", - }, - }, + Files: files, } c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ diff --git a/framework/components/blockchain/sui.go b/framework/components/blockchain/sui.go index e3debe6ef..f326c6917 100644 --- a/framework/components/blockchain/sui.go +++ b/framework/components/blockchain/sui.go @@ -95,9 +95,18 @@ func newSui(ctx context.Context, in *Input) (*Output, error) { defaultSui(in) containerName := framework.DefaultTCName("blockchain-node") - absPath, err := filepath.Abs(in.ContractsDir) - if err != nil { - return nil, err + var files []testcontainers.ContainerFile + if in.ContractsDir != "" { + absPath, err := filepath.Abs(in.ContractsDir) + if err != nil { + return nil, err + } + files = []testcontainers.ContainerFile{ + { + HostFilePath: absPath, + ContainerFilePath: "/", + }, + } } // Sui container always listens on port 9000 internally @@ -150,12 +159,7 @@ func newSui(ctx context.Context, in *Input) (*Output, error) { "--force-regenesis", "--with-faucet", }, - Files: []testcontainers.ContainerFile{ - { - HostFilePath: absPath, - ContainerFilePath: "/", - }, - }, + Files: files, // we need faucet for funding WaitingFor: wait.ForListeningPort(DefaultFaucetPort).WithStartupTimeout(1 * time.Minute).WithPollInterval(200 * time.Millisecond), }