This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
generated from mrz1836/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added minor fixes for checking cachestore engine
- Loading branch information
Showing
5 changed files
with
78 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
//go:build database_tests | ||
// +build database_tests | ||
|
||
package tester | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// TestCreateMongoServer will test the method CreateMongoServer() | ||
func TestCreateMongoServer(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("valid server", func(t *testing.T) { | ||
server, err := CreateMongoServer( | ||
testMongoVersion, | ||
) | ||
require.NoError(t, err) | ||
require.NotNil(t, server) | ||
server.Stop() | ||
}) | ||
} | ||
|
||
/* | ||
@mrz: This has some strange issues re-running and fails inconsistently | ||
// TestCreatePostgresServer will test the method CreatePostgresServer() | ||
func TestCreatePostgresServer(t *testing.T) { | ||
// t.Parallel() (disabled for now) | ||
t.Run("valid server", func(t *testing.T) { | ||
server, err := CreatePostgresServer( | ||
23902, | ||
) | ||
require.NoError(t, err) | ||
require.NotNil(t, server) | ||
err = server.Stop() | ||
require.NoError(t, err) | ||
}) | ||
} | ||
*/ | ||
|
||
// TestCreateMySQL will test the method CreateMySQL() | ||
func TestCreateMySQL(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("valid server", func(t *testing.T) { | ||
server, err := CreateMySQL( | ||
testDatabaseHost, testDatabaseName, testDatabaseUser, | ||
testDatabasePassword, testDatabasePort2, | ||
) | ||
require.NoError(t, err) | ||
require.NotNil(t, server) | ||
err = server.Close() | ||
require.NoError(t, err) | ||
}) | ||
} | ||
|
||
// TestCreateMySQLTestDatabase will test the method CreateMySQLTestDatabase() | ||
func TestCreateMySQLTestDatabase(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("valid db", func(t *testing.T) { | ||
db := CreateMySQLTestDatabase(testDatabaseName) | ||
require.NotNil(t, db) | ||
assert.Equal(t, testDatabaseName, db.Name()) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters