Skip to content

Commit

Permalink
tiny test updates (#710)
Browse files Browse the repository at this point in the history
## Motivation


## Solution
  • Loading branch information
AnieeG authored Apr 11, 2024
1 parent 49b15a7 commit 4e3e306
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
_ "embed"
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
"sync"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -202,6 +204,16 @@ func WriteLanesToJSON(path string, lanes *Lanes) error {
if err != nil {
return err
}
// Get the directory part of the file path.
dir := filepath.Dir(path)
// Check if the directory exists.
if _, err := os.Stat(dir); os.IsNotExist(err) {
// The directory does not exist, create it.
if err := os.MkdirAll(dir, 0755); err != nil {
return fmt.Errorf("failed to create directory: %w", err)
}
}

f, err := os.Create(path)
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ func CCIPDefaultTestSetUp(
var (
err error
)
filename := fmt.Sprintf("./tmp_%s.json", strings.ReplaceAll(t.Name(), "/", "_"))
reportPath := "tmp_laneconfig"
filename := fmt.Sprintf("./%s/tmp_%s.json", reportPath, strings.ReplaceAll(t.Name(), "/", "_"))
var transferAmounts []*big.Int
if testConfig.TestGroupInput.MsgType == actions.TokenTransfer {
for i := 0; i < testConfig.TestGroupInput.NoOfTokensInMsg; i++ {
Expand Down

0 comments on commit 4e3e306

Please sign in to comment.