Update circle ci for MySQL tests.
This commit is contained in:
parent
fbf5fbddbc
commit
4c5584aaae
8 changed files with 77 additions and 53 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package mysql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/go-jet/jet/internal/testutils"
|
||||
"github.com/go-jet/jet/tests/.gentestdata/mysql/test_sample/model"
|
||||
. "github.com/go-jet/jet/tests/.gentestdata/mysql/test_sample/table"
|
||||
|
|
@ -26,7 +25,7 @@ func TestAllTypes(t *testing.T) {
|
|||
|
||||
assert.NilError(t, err)
|
||||
|
||||
//testutils.JsonPrint(dest)
|
||||
//testutils.PrintJson(dest)
|
||||
testutils.AssertJSON(t, dest, allTypesJson)
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +95,7 @@ LIMIT ?;
|
|||
|
||||
assert.NilError(t, err)
|
||||
|
||||
//testutils.JsonPrint(dest)
|
||||
//testutils.PrintJson(dest)
|
||||
|
||||
testutils.AssertJSON(t, dest, `
|
||||
[
|
||||
|
|
@ -421,7 +420,7 @@ LIMIT ?;
|
|||
|
||||
assert.NilError(t, err)
|
||||
|
||||
//testutils.JsonPrint(dest)
|
||||
//testutils.PrintJson(dest)
|
||||
|
||||
testutils.AssertJSONFile(t, dest, "./testdata/common/int_operators.json")
|
||||
}
|
||||
|
|
@ -523,7 +522,7 @@ func TestTimeExpressions(t *testing.T) {
|
|||
CURRENT_TIME(3),
|
||||
)
|
||||
|
||||
fmt.Println(query.Sql())
|
||||
//fmt.Println(query.Sql())
|
||||
|
||||
testutils.AssertStatementSql(t, query, `
|
||||
SELECT CAST(? AS TIME),
|
||||
|
|
@ -711,7 +710,7 @@ func TestTimestampExpressions(t *testing.T) {
|
|||
CURRENT_TIMESTAMP(2),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
testutils.AssertDebugStatementSql(t, query, `
|
||||
SELECT all_types.timestamp = all_types.timestamp,
|
||||
|
|
@ -756,7 +755,7 @@ func TestTimeLiterals(t *testing.T) {
|
|||
TimestampT(timeT).AS("timestampT"),
|
||||
).FROM(AllTypes).LIMIT(1)
|
||||
|
||||
fmt.Println(query.Sql())
|
||||
//fmt.Println(query.Sql())
|
||||
|
||||
testutils.AssertStatementSql(t, query, `
|
||||
SELECT CAST(? AS DATE) AS "date",
|
||||
|
|
@ -783,7 +782,7 @@ LIMIT ?;
|
|||
err = query.Query(db, &dest)
|
||||
assert.NilError(t, err)
|
||||
|
||||
testutils.JsonPrint(dest)
|
||||
//testutils.PrintJson(dest)
|
||||
|
||||
testutils.AssertJSON(t, dest, `
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ ORDER BY actor.actor_id;
|
|||
assert.Equal(t, len(dest), 200)
|
||||
assert.DeepEqual(t, dest[0], actor1)
|
||||
|
||||
//testutils.JsonPrint(dest)
|
||||
//testutils.JsonSave(dest, "mysql/testdata/all_actors.json")
|
||||
//testutils.PrintJson(dest)
|
||||
//testutils.SaveJsonFile(dest, "mysql/testdata/all_actors.json")
|
||||
testutils.AssertJSONFile(t, dest, "mysql/testdata/all_actors.json")
|
||||
}
|
||||
|
||||
|
|
@ -129,11 +129,11 @@ ORDER BY payment.customer_id, SUM(payment.amount) ASC;
|
|||
|
||||
assert.NilError(t, err)
|
||||
|
||||
//testutils.JsonPrint(dest)
|
||||
//testutils.PrintJson(dest)
|
||||
|
||||
assert.Equal(t, len(dest), 174)
|
||||
|
||||
//testutils.JsonSave(dest, "mysql/testdata/customer_payment_sum.json")
|
||||
//testutils.SaveJsonFile(dest, "mysql/testdata/customer_payment_sum.json")
|
||||
testutils.AssertJSONFile(t, dest, "mysql/testdata/customer_payment_sum.json")
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ func TestSubQuery(t *testing.T) {
|
|||
err := query.Query(db, &dest)
|
||||
assert.NilError(t, err)
|
||||
|
||||
//testutils.JsonSave(dest, "mysql/testdata/r_rating_films.json")
|
||||
//testutils.SaveJsonFile(dest, "mysql/testdata/r_rating_films.json")
|
||||
testutils.AssertJSONFile(t, dest, "mysql/testdata/r_rating_films.json")
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ LIMIT ?;
|
|||
//assert.Equal(t, len(dest[0].Films), 10)
|
||||
//assert.Equal(t, len(dest[0].Films[0].Actors), 10)
|
||||
|
||||
//testutils.JsonSave(dest, "./mysql/testdata/lang_film_actor_inventory_rental.json")
|
||||
//testutils.SaveJsonFile(dest, "./mysql/testdata/lang_film_actor_inventory_rental.json")
|
||||
|
||||
testutils.AssertJSONFile(t, dest, "./mysql/testdata/lang_film_actor_inventory_rental.json")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue