Skip to content

Commit

Permalink
upgrades: use TestingBinaryMinSupportedVersion in tests
Browse files Browse the repository at this point in the history
As described in cockroachdb#100552, it's important for this API to use
TestingBinaryMinSupportedVersion in order to correctly bootstrap on the
older version.

Removed TestFixUserfileRelatedDescriptorCorruptionUpgrade and TestPreconditionBeforeStartingAnUpgrade
since they are for 22.2 migrations.

Release note: None
  • Loading branch information
rafiss committed Apr 7, 2023
1 parent 14cf13d commit 68e6a87
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 580 deletions.
5 changes: 0 additions & 5 deletions pkg/upgrade/upgrades/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ go_library(
"descriptor_utils.go",
"ensure_sql_schema_telemetry_schedule.go",
"external_connections_table_user_id_migration.go",
"fix_userfile_descriptor_corruption.go",
"key_visualizer_migration.go",
"permanent_upgrades.go",
"precondition_before_starting_an_upgrade.go",
"role_members_ids_migration.go",
"sampled_stmt_diagnostics_requests.go",
"schema_changes.go",
Expand Down Expand Up @@ -70,7 +68,6 @@ go_library(
"//pkg/sql/sem/catconstants",
"//pkg/sql/sem/tree",
"//pkg/sql/sessiondata",
"//pkg/sql/types",
"//pkg/storage",
"//pkg/upgrade",
"//pkg/upgrade/upgradebase",
Expand Down Expand Up @@ -105,11 +102,9 @@ go_test(
"descriptor_utils_test.go",
"ensure_sql_schema_telemetry_schedule_test.go",
"external_connections_table_user_id_migration_test.go",
"fix_userfile_descriptor_corruption_test.go",
"helpers_test.go",
"key_visualizer_migration_test.go",
"main_test.go",
"precondition_before_starting_an_upgrade_external_test.go",
"role_members_ids_migration_test.go",
"sampled_stmt_diagnostics_requests_test.go",
"schema_changes_external_test.go",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestDeleteDescriptorsOfDroppedFunctions(t *testing.T) {
defer log.Scope(t).Close(t)

var (
v0 = clusterversion.ByKey(clusterversion.V23_1_DeleteDroppedFunctionDescriptors - 1)
v0 = clusterversion.TestingBinaryMinSupportedVersion
v1 = clusterversion.ByKey(clusterversion.V23_1_DeleteDroppedFunctionDescriptors)
)

Expand Down Expand Up @@ -186,10 +186,12 @@ func TestDeleteDescriptorsOfDroppedFunctions(t *testing.T) {
require.Equal(t, 0, cntFnToDelete)

// Make sure other descriptors are intact.
const deletedFnCount = 4
const newSystemTableCount = 6
var newTotalDescCnt int
row = tdb.QueryRow(t, `SELECT count(*) FROM system.descriptor`)
row.Scan(&newTotalDescCnt)
require.Equal(t, originalTotalDescCnt-4, newTotalDescCnt)
require.Equal(t, originalTotalDescCnt-deletedFnCount+newSystemTableCount, newTotalDescCnt)

row = tdb.QueryRow(t, countTotalDroppedFunctionQuery)
row.Scan(&cntFnToDelete)
Expand Down
144 changes: 0 additions & 144 deletions pkg/upgrade/upgrades/fix_userfile_descriptor_corruption.go

This file was deleted.

110 changes: 0 additions & 110 deletions pkg/upgrade/upgrades/fix_userfile_descriptor_corruption_test.go

This file was deleted.

88 changes: 0 additions & 88 deletions pkg/upgrade/upgrades/precondition_before_starting_an_upgrade.go

This file was deleted.

Loading

0 comments on commit 68e6a87

Please sign in to comment.