mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: skip timing-sensistive AgentMetadata test in the standard suite (#7237)
* chore: skip timing-sensistive AgentMetadata test in the standard suite * Add test-timing target * fix windows? * Works on my Windows desktop? * Use tag system * fixup! Use tag system
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
//go:build timing
|
||||
|
||||
package testutil
|
||||
|
||||
var _ = func() any {
|
||||
timing = true
|
||||
return nil
|
||||
}()
|
||||
@@ -0,0 +1,20 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// We can't run timing-sensitive tests in CI because of the
|
||||
// great variance in runner performance. Instead of not testing timing at all,
|
||||
// we relegate it to humans manually running certain tests with the "-timing"
|
||||
// flag from time to time.
|
||||
//
|
||||
// Eventually, we should run all timing tests in a self-hosted runner.
|
||||
|
||||
var timing bool
|
||||
|
||||
func SkipIfNotTiming(t *testing.T) {
|
||||
if !timing {
|
||||
t.Skip("skipping timing-sensitive test")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user