mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? Add unit test for backlog manager that sends tasks through with standing backlogs. ## Why? Small framework to test concurrent operations on backlog managers. ## How did you test it? - [x] added new unit test(s) --------- Co-authored-by: Stephan Behnke <[email protected]>
24 lines
534 B
Go
24 lines
534 B
Go
package testing
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
"testing"
|
|
)
|
|
|
|
// LongTest calls Skip() on the testing.T or suite unless the environment variable
|
|
// TEMPORAL_TEST_LONG is set to true.
|
|
func LongTest(t any) {
|
|
if long, _ := strconv.ParseBool(os.Getenv("TEMPORAL_TEST_LONG")); long {
|
|
return
|
|
}
|
|
|
|
if s, ok := t.(interface{ T() *testing.T }); ok {
|
|
t = s.T()
|
|
}
|
|
if s, ok := t.(interface{ Skip(...any) }); ok {
|
|
s.Skip("skipping long test, use TEMPORAL_TEST_LONG=1 to run")
|
|
}
|
|
panic("skipping long test, use TEMPORAL_TEST_LONG=1 to run")
|
|
}
|