Skip to content

Commit

Permalink
feat: test: add LOTUS_RUN_VERY_EXPENSIVE_TESTS and include niporep re…
Browse files Browse the repository at this point in the history
…al-proofs
  • Loading branch information
rvagg committed Jun 25, 2024
1 parent 4f1cc8a commit 4882aa8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions itests/kit/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import (
// and set to value "1" to enable running expensive tests outside of CI.
const EnvRunExpensiveTests = "LOTUS_RUN_EXPENSIVE_TESTS"

// EnvRunVeryExpensiveTests is the environment variable that needs to be present
// and set to value "1" to enable running very expensive tests outside of CI.
// A "very expensive" test is one that is expected to take too long to run in
// a standard CI setup, and should be skipped unless explicitly enabled.
const EnvRunVeryExpensiveTests = "LOTUS_RUN_VERY_EXPENSIVE_TESTS"

// Expensive marks a test as expensive, skipping it immediately if not running an
func Expensive(t *testing.T) {
switch {
Expand All @@ -18,3 +24,10 @@ func Expensive(t *testing.T) {
t.Skipf("skipping expensive test outside of CI; enable by setting env var %s=1", EnvRunExpensiveTests)
}
}

// Expensive marks a test as expensive, skipping it immediately if not running an
func VeryExpensive(t *testing.T) {
if os.Getenv(EnvRunVeryExpensiveTests) != "1" {
t.Skipf("skipping VERY expensive test outside of CI; enable by setting env var %s=1", EnvRunVeryExpensiveTests)
}
}
2 changes: 1 addition & 1 deletion itests/niporep_manual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestManualNISectorOnboarding(t *testing.T) {
}
t.Run(testName, func(t *testing.T) {
if !withMockProofs {
kit.Expensive(t)
kit.VeryExpensive(t)
}
kit.QuietMiningLogs()
ctx, cancel := context.WithCancel(context.Background())
Expand Down

0 comments on commit 4882aa8

Please sign in to comment.