Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiny test updates #710

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading