Skip to content

Commit 888dd37

Browse files
committed
ref(_tests): move getRandAppName to utils
because it’s used in a lot of places. also, moved the rand number seed into the same package as where tests run
1 parent 5502cf5 commit 888dd37

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

_tests/apps_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
package _tests_test
22

33
import (
4-
"fmt"
54
. "github.com/onsi/ginkgo"
65
. "github.com/onsi/gomega"
7-
"math/rand"
86
)
97

10-
func getRandAppName() string {
11-
return fmt.Sprintf("apps-test-%d", rand.Int())
12-
}
13-
148
var _ = Describe("Apps", func() {
159
app1Name := getRandAppName()
1610
app2Name := getRandAppName()

_tests/package.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
11
// Package _tests contains integration tests for the Deis open source PaaS.
22
package _tests
3-
4-
import (
5-
"github.com/onsi/ginkgo/config"
6-
"math/rand"
7-
)
8-
9-
func init() {
10-
rand.Seed(config.GinkgoConfig.RandomSeed)
11-
}

_tests/util_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package _tests_test
2+
3+
import (
4+
"fmt"
5+
"math/rand"
6+
7+
"github.com/onsi/ginkgo/config"
8+
)
9+
10+
func init() {
11+
rand.Seed(config.GinkgoConfig.RandomSeed)
12+
}
13+
14+
func getRandAppName() string {
15+
return fmt.Sprintf("apps-test-%d", rand.Int())
16+
}

0 commit comments

Comments
 (0)