Skip to content

Commit

Permalink
Update e2e tests: don't specify multi_tenant_spec in source vschema
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
  • Loading branch information
rohit-nayak-ps committed Mar 27, 2024
1 parent 7e2e1c8 commit 6be1943
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions go/test/endtoend/vreplication/multi_tenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ const (
"t1": {}
}
}
`
stSchema = mtSchema
stVSchema = `
{
"tables": {
"t1": {}
}
}
`
)

Expand All @@ -123,7 +131,7 @@ func TestMultiTenantSimple(t *testing.T) {
tenantId := int64(1)
sourceKeyspace := getSourceKeyspace(tenantId)
sourceAliasKeyspace := getSourceAliasKeyspace(tenantId)
_, err = vc.AddKeyspace(t, []*Cell{vc.Cells["zone1"]}, sourceKeyspace, "0", mtVSchema, mtSchema, 1, 0, getInitialTabletIdForTenant(tenantId), nil)
_, err = vc.AddKeyspace(t, []*Cell{vc.Cells["zone1"]}, sourceKeyspace, "0", stVSchema, stSchema, 1, 0, getInitialTabletIdForTenant(tenantId), nil)
require.NoError(t, err)

targetPrimary := vc.getPrimaryTablet(t, targetKeyspace, "0")
Expand Down Expand Up @@ -291,6 +299,7 @@ func TestMultiTenantComplex(t *testing.T) {
totalRowsInserted := totalRowsInsertedPerTenant * numTenants
totalActualRowsInserted := getRowCount(t, vtgateConn, fmt.Sprintf("%s.%s", mtm.targetKeyspace, "t1"))
require.Equal(t, totalRowsInserted, totalActualRowsInserted)
log.Infof("Migration completed, total rows inserted in target: %d", totalActualRowsInserted)
})
}

Expand Down Expand Up @@ -365,7 +374,7 @@ func (mtm *multiTenantMigration) setup(tenantId int64) {
mtm.setLastID(tenantId, 0)
sourceKeyspace := getSourceKeyspace(tenantId)
sourceAliasKeyspace := getSourceAliasKeyspace(tenantId)
_, err := vc.AddKeyspace(mtm.t, []*Cell{vc.Cells["zone1"]}, sourceKeyspace, "0", mtVSchema, mtSchema,
_, err := vc.AddKeyspace(mtm.t, []*Cell{vc.Cells["zone1"]}, sourceKeyspace, "0", stVSchema, stSchema,
1, 0, getInitialTabletIdForTenant(tenantId), nil)
require.NoError(mtm.t, err)
mtm.initTenantData(mtm.t, tenantId, sourceAliasKeyspace)
Expand Down

0 comments on commit 6be1943

Please sign in to comment.