Skip to content

Commit

Permalink
SNOW-1256899 Enable structured types on GH tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus committed Jun 17, 2024
1 parent 5d28db8 commit 597b7dd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
32 changes: 0 additions & 32 deletions structured_type_read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,7 @@ func (so *simpleObject) Write(sowc StructuredObjectWriterContext) error {
return nil
}

func skipStructuredTypesTestsOnGHActions(t *testing.T) {
if runningOnGithubAction() {
t.Skip("Structured types are not available on GH Actions")
}
}

func TestObjectWithAllTypes(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
warsawTz, err := time.LoadLocation("Europe/Warsaw")
assertNilF(t, err)
runDBTest(t, func(dbt *DBTest) {
Expand Down Expand Up @@ -406,7 +399,6 @@ func (o *objectWithAllTypesNullable) Write(sowc StructuredObjectWriterContext) e
}

func TestObjectWithAllTypesNullable(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
warsawTz, err := time.LoadLocation("Europe/Warsaw")
assertNilF(t, err)
runDBTest(t, func(dbt *DBTest) {
Expand Down Expand Up @@ -699,7 +691,6 @@ func TestObjectWithCustomName(t *testing.T) {
}

func TestObjectMetadata(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
rows := dbt.mustQuery("SELECT {'a': 'b'}::OBJECT(a VARCHAR) as structured_type")
Expand All @@ -715,7 +706,6 @@ func TestObjectMetadata(t *testing.T) {
}

func TestObjectWithoutSchema(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
if format == "NATIVE_ARROW" {
Expand All @@ -733,7 +723,6 @@ func TestObjectWithoutSchema(t *testing.T) {
}

func TestObjectWithoutSchemaMetadata(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
if format == "NATIVE_ARROW" {
Expand All @@ -752,7 +741,6 @@ func TestObjectWithoutSchemaMetadata(t *testing.T) {
}

func TestArrayAndMetadata(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
warsawTz, err := time.LoadLocation("Europe/Warsaw")
assertNilF(t, err)
runDBTest(t, func(dbt *DBTest) {
Expand Down Expand Up @@ -889,7 +877,6 @@ func TestArrayAndMetadata(t *testing.T) {
}

func TestArrayWithoutSchema(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
rows := dbt.mustQuery("SELECT ARRAY_CONSTRUCT(1, 2)")
Expand All @@ -904,7 +891,6 @@ func TestArrayWithoutSchema(t *testing.T) {
}

func TestEmptyArraysAndNullArrays(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
rows := dbt.mustQuery("SELECT ARRAY_CONSTRUCT(1, 2)::ARRAY(INTEGER) as structured_type UNION SELECT ARRAY_CONSTRUCT()::ARRAY(INTEGER) UNION SELECT NULL UNION SELECT ARRAY_CONSTRUCT(4, 5, 6)::ARRAY(INTEGER)")
Expand All @@ -926,7 +912,6 @@ func TestEmptyArraysAndNullArrays(t *testing.T) {
}

func TestArrayWithoutSchemaMetadata(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
if format == "NATIVE_ARROW" {
Expand All @@ -945,7 +930,6 @@ func TestArrayWithoutSchemaMetadata(t *testing.T) {
}

func TestArrayOfObjects(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
rows := dbt.mustQuery("SELECT ARRAY_CONSTRUCT({'s': 's1', 'i': 9}, {'s': 's2', 'i': 8})::ARRAY(OBJECT(s VARCHAR, i INTEGER)) as structured_type UNION SELECT ARRAY_CONSTRUCT({'s': 's3', 'i': 7})::ARRAY(OBJECT(s VARCHAR, i INTEGER))")
Expand Down Expand Up @@ -1045,7 +1029,6 @@ func TestArrayOfArrays(t *testing.T) {
expected: [][]time.Time{{time.Date(2024, time.January, 5, 11, 22, 33, 0, warsawTz)}, {time.Date(2001, time.November, 12, 11, 22, 33, 0, warsawTz)}},
},
}
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.mustExec("ALTER SESSION SET TIMEZONE = 'Europe/Warsaw'")
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
Expand Down Expand Up @@ -1078,7 +1061,6 @@ func TestArrayOfArrays(t *testing.T) {
}

func TestMapAndMetadata(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
warsawTz, err := time.LoadLocation("Europe/Warsaw")
assertNilF(t, err)
runDBTest(t, func(dbt *DBTest) {
Expand Down Expand Up @@ -1310,7 +1292,6 @@ func TestMapAndMetadata(t *testing.T) {
}

func TestMapOfObjects(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
rows := dbt.mustQuery("SELECT {'x': {'s': 'abc', 'i': 1}, 'y': {'s': 'def', 'i': 2}}::MAP(VARCHAR, OBJECT(s VARCHAR, i INTEGER))")
Expand All @@ -1325,7 +1306,6 @@ func TestMapOfObjects(t *testing.T) {
}

func TestMapOfArrays(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
warsawTz, err := time.LoadLocation("Europe/Warsaw")
assertNilF(t, err)
testcases := []struct {
Expand Down Expand Up @@ -1433,7 +1413,6 @@ func TestMapOfArrays(t *testing.T) {
}

func TestNullAndEmptyMaps(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
rows := dbt.mustQuery("SELECT {'a': 1}::MAP(VARCHAR, INTEGER) UNION SELECT NULL UNION SELECT {}::MAP(VARCHAR, INTEGER) UNION SELECT {'d': 4}::MAP(VARCHAR, INTEGER)")
Expand All @@ -1454,7 +1433,6 @@ func TestNullAndEmptyMaps(t *testing.T) {
}

func TestMapWithNullValues(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
warsawTz, err := time.LoadLocation("Europe/Warsaw")
assertNilF(t, err)
testcases := []struct {
Expand Down Expand Up @@ -1579,7 +1557,6 @@ func (hps *HigherPrecisionStruct) Scan(val any) error {
}

func TestWithHigherPrecision(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
forAllStructureTypeFormats(dbt, func(t *testing.T, format string) {
if format != "NATIVE_ARROW" {
Expand Down Expand Up @@ -1715,7 +1692,6 @@ func TestWithHigherPrecision(t *testing.T) {
}

func TestStructuredTypeInArrowBatchesSimple(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1746,7 +1722,6 @@ func TestStructuredTypeInArrowBatchesSimple(t *testing.T) {
}

func TestStructuredTypeInArrowBatches(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1783,7 +1758,6 @@ func TestStructuredTypeInArrowBatches(t *testing.T) {
}

func TestStructuredTypeInArrowBatchesWithTimestampOptionAndHigherPrecisionAndUtf8Validation(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1827,7 +1801,6 @@ func TestStructuredTypeInArrowBatchesWithTimestampOptionAndHigherPrecisionAndUtf
}

func TestStructuredTypeInArrowBatchesWithEmbeddedObject(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1856,7 +1829,6 @@ func TestStructuredTypeInArrowBatchesWithEmbeddedObject(t *testing.T) {
}

func TestStructuredTypeInArrowBatchesAsNull(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1886,7 +1858,6 @@ func TestStructuredTypeInArrowBatchesAsNull(t *testing.T) {
}

func TestStructuredArrayInArrowBatches(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1923,7 +1894,6 @@ func TestStructuredArrayInArrowBatches(t *testing.T) {
}

func TestStructuredMapInArrowBatches(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.enableStructuredTypes()
pool := memory.NewCheckedAllocator(memory.DefaultAllocator)
Expand Down Expand Up @@ -1992,7 +1962,6 @@ func TestSelectingNullObjectsInArrowBatches(t *testing.T) {
"select null::object(v VARCHAR)",
"select null::object",
}
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
for _, tc := range testcases {
t.Run(tc, func(t *testing.T) {
Expand Down Expand Up @@ -2074,7 +2043,6 @@ func TestSelectingSemistructuredTypesInArrowBatches(t *testing.T) {
query: "SELECT [1, 2, 3]::ARRAY",
},
}
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
Expand Down
3 changes: 0 additions & 3 deletions structured_type_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

func TestBindingVariant(t *testing.T) {
runDBTest(t, func(dbt *DBTest) {
skipStructuredTypesTestsOnGHActions(t)
dbt.mustExec("CREATE TABLE test_variant_binding (var VARIANT)")
defer func() {
dbt.mustExec("DROP TABLE IF EXISTS test_variant_binding")
Expand Down Expand Up @@ -48,7 +47,6 @@ func TestBindingVariant(t *testing.T) {
}

func TestBindingObjectWithoutSchema(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.mustExec("CREATE TABLE test_object_binding (obj OBJECT)")
defer func() {
Expand Down Expand Up @@ -88,7 +86,6 @@ func TestBindingObjectWithoutSchema(t *testing.T) {
}

func TestBindingArrayWithoutSchema(t *testing.T) {
skipStructuredTypesTestsOnGHActions(t)
runDBTest(t, func(dbt *DBTest) {
dbt.mustExec("CREATE TABLE test_array_binding (arr ARRAY)")
defer func() {
Expand Down

0 comments on commit 597b7dd

Please sign in to comment.