feat: test: add LOTUS_RUN_VERY_EXPENSIVE_TESTS and include niporep real-proofs

This commit is contained in:
Rod Vagg 2024-06-25 19:32:51 +10:00
parent aedc15cef4
commit be592d8891
2 changed files with 14 additions and 1 deletions

View File

@ -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 {
@ -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)
}
}

View File

@ -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())