mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
lib/mergeset: detect whether we are in test by executable suffix
This commit is contained in:
parent
d2ed8cb0b2
commit
3304dc1e85
2 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@ package mergeset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -146,7 +147,9 @@ func (ib *inmemoryBlock) MarshalUnsortedData(sb *storageBlock, firstItemDst, com
|
||||||
return ib.marshalData(sb, firstItemDst, commonPrefixDst, compressLevel)
|
return ib.marshalData(sb, firstItemDst, commonPrefixDst, compressLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
var isInTest bool
|
var isInTest = func() bool {
|
||||||
|
return strings.HasSuffix(os.Args[0], ".test")
|
||||||
|
}()
|
||||||
|
|
||||||
// MarshalUnsortedData marshals sorted items from ib to sb.
|
// MarshalUnsortedData marshals sorted items from ib to sb.
|
||||||
//
|
//
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
isInTest = true
|
|
||||||
n := m.Run()
|
n := m.Run()
|
||||||
os.Exit(n)
|
os.Exit(n)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue