Skip to content

Commit

Permalink
Merge pull request #6445 from filecoin-project/raulk/itests-init-guard
Browse files Browse the repository at this point in the history
itests/kit: add guard to ensure imports from tests only.
  • Loading branch information
magik6k authored Jun 10, 2021
2 parents 6f80d9f + d3fc683 commit adaf789
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions itests/kit/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package kit
import (
"fmt"
"os"
"strings"

"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/build"
Expand All @@ -11,6 +12,11 @@ import (
)

func init() {
bin := os.Args[0]
if !strings.HasSuffix(bin, ".test") {
panic("package itests/kit must only be imported from tests")
}

_ = logging.SetLogLevel("*", "INFO")

policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
Expand All @@ -22,4 +28,5 @@ func init() {
panic(fmt.Sprintf("failed to set BELLMAN_NO_GPU env variable: %s", err))
}
build.InsecurePoStValidation = true

}

0 comments on commit adaf789

Please sign in to comment.