Skip to content

Commit

Permalink
e2e: Remove AssertExpectations (#998)
Browse files Browse the repository at this point in the history
No tests currently use workflow assertions,
their purpose is for mocking, which is not what e2e is doing,
& is something I'm moving us further away from with #980
  • Loading branch information
serprex authored Jan 5, 2024
1 parent 2d6a68a commit f894ba0
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 93 deletions.
31 changes: 0 additions & 31 deletions flow/e2e/bigquery/peer_flow_bq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Invalid_Connection_Config() {

// assert that error contains "invalid connection configs"
require.Contains(s.t, err.Error(), "invalid connection configs")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Complete_Flow_No_Data() {
Expand Down Expand Up @@ -242,8 +240,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Complete_Flow_No_Data() {

// allow only continue as new error
require.Contains(s.t, err.Error(), "continue as new")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Char_ColType_Error() {
Expand Down Expand Up @@ -286,8 +282,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Char_ColType_Error() {

// allow only continue as new error
require.Contains(s.t, err.Error(), "continue as new")

env.AssertExpectations(s.t)
}

// Test_Complete_Simple_Flow_BQ tests a complete flow with data in the source table.
Expand Down Expand Up @@ -356,8 +350,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Complete_Simple_Flow_BQ() {

// TODO: verify that the data is correctly synced to the destination table
// on the bigquery side

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Toast_BQ() {
Expand Down Expand Up @@ -425,7 +417,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Toast_BQ() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, dstTableName, "id,t1,t2,k")
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Nochanges_BQ() {
Expand Down Expand Up @@ -488,7 +479,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Nochanges_BQ() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, dstTableName, "id,t1,t2,k")
env.AssertExpectations(s.t)
<-done
}

Expand Down Expand Up @@ -563,7 +553,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Advance_1_BQ() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, dstTableName, "id,t1,t2,k")
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Advance_2_BQ() {
Expand Down Expand Up @@ -630,7 +619,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Advance_2_BQ() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, dstTableName, "id,t1,k")
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Advance_3_BQ() {
Expand Down Expand Up @@ -697,7 +685,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Toast_Advance_3_BQ() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, dstTableName, "id,t1,t2,k")
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Types_BQ() {
Expand Down Expand Up @@ -779,8 +766,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Types_BQ() {
// check if JSON on bigquery side is a good JSON
err = s.checkJSONValue(dstTableName, "c17", "sai", "-8.021390374331551")
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Invalid_Geo_BQ_Avro_CDC() {
Expand Down Expand Up @@ -863,8 +848,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Invalid_Geo_BQ_Avro_CDC() {

require.Equal(s.t, 6, lineCount)
require.Equal(s.t, 6, polyCount)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Multi_Table_BQ() {
Expand Down Expand Up @@ -924,8 +907,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Multi_Table_BQ() {

require.Equal(s.t, 1, count1)
require.Equal(s.t, 1, count2)

env.AssertExpectations(s.t)
}

// TODO: not checking schema exactly, add later
Expand Down Expand Up @@ -1025,8 +1006,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Simple_Schema_Changes_BQ() {

// allow only continue as new error
require.Contains(s.t, err.Error(), "continue as new")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Composite_PKey_BQ() {
Expand Down Expand Up @@ -1098,8 +1077,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Composite_PKey_BQ() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, dstTableName, "id,c1,c2,t")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Composite_PKey_Toast_1_BQ() {
Expand Down Expand Up @@ -1175,8 +1152,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Composite_PKey_Toast_1_BQ() {

// verify our updates and delete happened
e2e.RequireEqualTables(s, dstTableName, "id,c1,c2,t,t2")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Composite_PKey_Toast_2_BQ() {
Expand Down Expand Up @@ -1248,8 +1223,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Composite_PKey_Toast_2_BQ() {

// verify our updates and delete happened
e2e.RequireEqualTables(s, dstTableName, "id,c1,c2,t,t2")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Columns_BQ() {
Expand Down Expand Up @@ -1311,8 +1284,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Columns_BQ() {

err = s.checkPeerdbColumns(dstTableName, true)
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Multi_Table_Multi_Dataset_BQ() {
Expand Down Expand Up @@ -1379,8 +1350,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Multi_Table_Multi_Dataset_BQ() {

err = s.bqHelper.DropDataset(secondDataset)
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Soft_Delete_Basic() {
Expand Down
4 changes: 0 additions & 4 deletions flow/e2e/bigquery/qrep_flow_bq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Complete_QRep_Flow_Avro() {
require.NoError(s.t, err)

e2e.RequireEqualTables(s, tblName, "*")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteBQ) Test_PeerDB_Columns_QRep_BQ() {
Expand Down Expand Up @@ -79,6 +77,4 @@ func (s PeerFlowE2ETestSuiteBQ) Test_PeerDB_Columns_QRep_BQ() {

err = s.checkPeerdbColumns(tblName, false)
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}
11 changes: 0 additions & 11 deletions flow/e2e/postgres/peer_flow_pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ func (s PeerFlowE2ETestSuitePG) Test_Simple_Flow_PG() {

err = s.comparePGTables(srcTableName, dstTableName, "id,key,value")
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_Simple_Schema_Changes_PG() {
Expand Down Expand Up @@ -261,8 +259,6 @@ func (s PeerFlowE2ETestSuitePG) Test_Simple_Schema_Changes_PG() {

// allow only continue as new error
require.Contains(s.t, err.Error(), "continue as new")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_PG() {
Expand Down Expand Up @@ -335,8 +331,6 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_PG() {

err = s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t")
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_Toast_1_PG() {
Expand Down Expand Up @@ -416,8 +410,6 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_Toast_1_PG() {
// verify our updates and delete happened
err = s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t,t2")
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_Toast_2_PG() {
Expand Down Expand Up @@ -493,8 +485,6 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_Toast_2_PG() {
// verify our updates and delete happened
err = s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t,t2")
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_PeerDB_Columns() {
Expand Down Expand Up @@ -557,7 +547,6 @@ func (s PeerFlowE2ETestSuitePG) Test_PeerDB_Columns() {
require.Contains(s.t, err.Error(), "continue as new")
checkErr := s.checkPeerdbColumns(dstTableName, 1)
require.NoError(s.t, checkErr)
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_Soft_Delete_Basic() {
Expand Down
4 changes: 0 additions & 4 deletions flow/e2e/postgres/qrep_flow_pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ func (s PeerFlowE2ETestSuitePG) Test_Complete_QRep_Flow_Multi_Insert_PG() {

err = s.comparePGTables(srcSchemaQualified, dstSchemaQualified, "*")
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuitePG) Test_Setup_Destination_And_PeerDB_Columns_QRep_PG() {
Expand Down Expand Up @@ -303,6 +301,4 @@ func (s PeerFlowE2ETestSuitePG) Test_Setup_Destination_And_PeerDB_Columns_QRep_P

err = s.checkSyncedAt(dstSchemaQualified)
require.NoError(s.t, err)

env.AssertExpectations(s.t)
}
2 changes: 0 additions & 2 deletions flow/e2e/s3/cdc_s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,4 @@ func (s PeerFlowE2ETestSuiteS3) Test_Complete_Simple_Flow_S3() {
require.NoError(s.t, err)

require.Equal(s.t, 4, len(files))

env.AssertExpectations(s.t)
}
4 changes: 0 additions & 4 deletions flow/e2e/s3/qrep_flow_s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ func (s PeerFlowE2ETestSuiteS3) Test_Complete_QRep_Flow_S3() {
require.NoError(s.t, err)

require.Equal(s.t, 1, len(files))

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteS3) Test_Complete_QRep_Flow_S3_CTID() {
Expand Down Expand Up @@ -186,6 +184,4 @@ func (s PeerFlowE2ETestSuiteS3) Test_Complete_QRep_Flow_S3_CTID() {
require.NoError(s.t, err)

require.Equal(s.t, 10, len(files))

env.AssertExpectations(s.t)
}
25 changes: 0 additions & 25 deletions flow/e2e/snowflake/peer_flow_sf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Complete_Simple_Flow_SF() {

// TODO: verify that the data is correctly synced to the destination table
// on the Snowflake side

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Flow_ReplicaIdentity_Index_No_Pkey() {
Expand Down Expand Up @@ -262,8 +260,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Flow_ReplicaIdentity_Index_No_Pkey() {
count, err := s.sfHelper.CountRows("test_replica_identity_no_pkey")
require.NoError(s.t, err)
require.Equal(s.t, 20, count)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Invalid_Geo_SF_Avro_CDC() {
Expand Down Expand Up @@ -344,8 +340,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Invalid_Geo_SF_Avro_CDC() {
polyCount, err := s.sfHelper.CountNonNullRows("test_invalid_geo_sf_avro_cdc", "poly")
require.NoError(s.t, err)
require.Equal(s.t, 6, polyCount)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Toast_SF() {
Expand Down Expand Up @@ -412,7 +406,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Toast_SF() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, "test_toast_sf_1", `id,t1,t2,k`)
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Toast_Nochanges_SF() {
Expand Down Expand Up @@ -474,7 +467,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Toast_Nochanges_SF() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, "test_toast_sf_2", `id,t1,t2,k`)
env.AssertExpectations(s.t)
wg.Wait()
}

Expand Down Expand Up @@ -548,7 +540,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Toast_Advance_1_SF() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, "test_toast_sf_3", `id,t1,t2,k`)
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Toast_Advance_2_SF() {
Expand Down Expand Up @@ -614,7 +605,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Toast_Advance_2_SF() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, "test_toast_sf_4", `id,t1,k`)
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Toast_Advance_3_SF() {
Expand Down Expand Up @@ -680,7 +670,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Toast_Advance_3_SF() {
require.Contains(s.t, err.Error(), "continue as new")

e2e.RequireEqualTables(s, "test_toast_sf_5", `id,t1,t2,k`)
env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Types_SF() {
Expand Down Expand Up @@ -763,8 +752,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Types_SF() {

// Make sure that there are no nulls
require.Equal(s.t, noNulls, true)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Multi_Table_SF() {
Expand Down Expand Up @@ -822,8 +809,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Multi_Table_SF() {

require.Equal(s.t, 1, count1)
require.Equal(s.t, 1, count2)

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Simple_Schema_Changes_SF() {
Expand Down Expand Up @@ -1011,8 +996,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Simple_Schema_Changes_SF() {

// allow only continue as new error
require.Contains(s.t, err.Error(), "continue as new")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Composite_PKey_SF() {
Expand Down Expand Up @@ -1084,8 +1067,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Composite_PKey_SF() {

// verify our updates and delete happened
e2e.RequireEqualTables(s, "test_simple_cpkey", "id,c1,c2,t")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Composite_PKey_Toast_1_SF() {
Expand Down Expand Up @@ -1160,8 +1141,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Composite_PKey_Toast_1_SF() {

// verify our updates and delete happened
e2e.RequireEqualTables(s, "test_cpkey_toast1", "id,c1,c2,t,t2")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Composite_PKey_Toast_2_SF() {
Expand Down Expand Up @@ -1232,8 +1211,6 @@ func (s PeerFlowE2ETestSuiteSF) Test_Composite_PKey_Toast_2_SF() {

// verify our updates and delete happened
e2e.RequireEqualTables(s, "test_cpkey_toast2", "id,c1,c2,t,t2")

env.AssertExpectations(s.t)
}

func (s PeerFlowE2ETestSuiteSF) Test_Column_Exclusion() {
Expand Down Expand Up @@ -1709,6 +1686,4 @@ func (s PeerFlowE2ETestSuiteSF) Test_Supported_Mixed_Case_Table_SF() {

s.compareTableContentsWithDiffSelectorsSF("testMixedCase", `"pulseArmor","highGold","eVe",id`,
`"pulseArmor","highGold","eVe",id`, true)

env.AssertExpectations(s.t)
}
Loading

0 comments on commit f894ba0

Please sign in to comment.