This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix e2e scripts
- Loading branch information
Showing
8 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
testdata/mir/node* | ||
testdata/mir/genesis.car | ||
docker.log | ||
testdata/_runtime | ||
tests.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package fs | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"path" | ||
"path/filepath" | ||
) | ||
|
||
func FindRoot() (string, error) { | ||
dir, err := os.Getwd() | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
for dir != "" { | ||
info, err := os.Stat(path.Join(dir, "go.mod")) | ||
if err == nil && info != nil && !info.IsDir() { | ||
return dir, nil | ||
} | ||
if err != nil && !errors.Is(err, os.ErrNotExist) { | ||
return "", err | ||
} | ||
dir = filepath.Dir(dir) | ||
} | ||
|
||
return dir, nil | ||
} | ||
|
||
func CopyFile(src string, dst string) error { | ||
data, err := os.ReadFile(src) | ||
if err != nil { | ||
return err | ||
} | ||
err = os.WriteFile(dst, data, 0644) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tests | ||
package fs | ||
|
||
import ( | ||
"testing" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
INDEX=$1 | ||
STORE=$2 | ||
PORT=$2 | ||
STORE=$3 | ||
|
||
tmux new-session -d -s "mir" \; \ | ||
new-window -t "mir" \; \ | ||
split-window -t "mir:0" -v \; \ | ||
send-keys -t "mir:0.0" "./scripts/mir/daemon.sh $INDEX 2>&1 | tee $STORE/daemon_$INDEX.log" Enter \; \ | ||
send-keys -t "mir:0.0" "./scripts/mir/daemon.sh $INDEX $PORT 2>&1 | tee $STORE/daemon_$INDEX.log" Enter \; \ | ||
send-keys -t "mir:0.1" "./scripts/mir/validator.sh $INDEX 2>&1 | tee $STORE/validator_$INDEX.log" Enter \; | ||
|
||
tail -f /dev/null |