mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-03 08:42:39 +00:00
Switch to acctest.RandInt for acceptance tests
This commit is contained in:
parent
5d940efddf
commit
4e3e03192e
|
@ -12,6 +12,7 @@ import (
|
|||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
|
||||
|
@ -20,7 +21,7 @@ import (
|
|||
|
||||
func TestAccGoogleSqlDatabaseInstance_basic(t *testing.T) {
|
||||
var instance sqladmin.DatabaseInstance
|
||||
databaseID := genRandInt()
|
||||
databaseID := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
|
@ -64,7 +65,7 @@ func TestAccGoogleSqlDatabaseInstance_basic2(t *testing.T) {
|
|||
|
||||
func TestAccGoogleSqlDatabaseInstance_settings_basic(t *testing.T) {
|
||||
var instance sqladmin.DatabaseInstance
|
||||
databaseID := genRandInt()
|
||||
databaseID := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
|
@ -87,7 +88,7 @@ func TestAccGoogleSqlDatabaseInstance_settings_basic(t *testing.T) {
|
|||
|
||||
func TestAccGoogleSqlDatabaseInstance_settings_upgrade(t *testing.T) {
|
||||
var instance sqladmin.DatabaseInstance
|
||||
databaseID := genRandInt()
|
||||
databaseID := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
|
@ -120,7 +121,7 @@ func TestAccGoogleSqlDatabaseInstance_settings_upgrade(t *testing.T) {
|
|||
|
||||
func TestAccGoogleSqlDatabaseInstance_settings_downgrade(t *testing.T) {
|
||||
var instance sqladmin.DatabaseInstance
|
||||
databaseID := genRandInt()
|
||||
databaseID := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
|
|
10
test_util.go
10
test_util.go
|
@ -1,10 +0,0 @@
|
|||
package google
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func genRandInt() int {
|
||||
return rand.New(rand.NewSource(time.Now().UnixNano())).Int()
|
||||
}
|
Loading…
Reference in New Issue
Block a user