Skip to content

Commit 53dba90

Browse files
author
Andrea Spacca
authored
print generator values from TestMain (#101)
1 parent 285c34b commit 53dba90

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pkg/genlib/generator_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ import (
55
"context"
66
"github.com/elastic/elastic-integration-corpus-generator-tool/pkg/genlib/config"
77
"github.com/elastic/elastic-integration-corpus-generator-tool/pkg/genlib/fields"
8+
"log"
9+
"math/rand"
810
"testing"
11+
"time"
912
)
1013

1114
func TestMain(m *testing.M) {
12-
InitGeneratorRandSeed(1)
15+
timeNow := time.Now()
16+
randSeed := rand.Int63()
17+
18+
log.Printf("rand seed generator initialised with value `%d`\n", randSeed)
19+
log.Printf("time now generator initialised with value `%s`\n", timeNow.UTC().Format(time.RFC3339Nano))
20+
21+
InitGeneratorRandSeed(randSeed)
22+
InitGeneratorTimeNow(timeNow)
23+
1324
}
1425

1526
func Benchmark_GeneratorCustomTemplateJSONContent(b *testing.B) {

0 commit comments

Comments
 (0)