Skip to content

Commit

Permalink
BUG#36930714 Build fix
Browse files Browse the repository at this point in the history
Correction of test for latest shell version suggestions.

Change-Id: I94f65b1a81210bedb1416b2278784cbdd8fa54f2
  • Loading branch information
Marek Młynarski committed Sep 13, 2024
1 parent eb55aab commit c76274f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions unittest/modules/upgrade_check_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4399,13 +4399,20 @@ TEST_F(MySQL_upgrade_check_test, get_next_suggested_lts_version) {

// Now verifies the current shell version series
first_lts = get_first_lts_version(mysqlshdk::utils::k_shell_version);
std::string key;
std::optional<Version> next_lts;
auto next_series_first_lts =
get_first_lts_version(get_next_series(mysqlshdk::utils::k_shell_version));
std::string key, next_series_key;
std::optional<Version> next_lts, next_series_lts;
if (mysqlshdk::utils::k_shell_version >= first_lts) {
key = first_lts.get_short();
next_lts = k_latest_versions.at(key);
}
if (k_latest_versions.contains(next_series_first_lts.get_short())) {
next_series_key = next_series_first_lts.get_short();
next_series_lts = k_latest_versions.at(next_series_key);
}

// next lts for innovation line is the latest lts in that series
auto first_innovation =
get_first_innovation_version(mysqlshdk::utils::k_shell_version);
for (minor = first_innovation.get_minor(); minor < first_lts.get_minor();
Expand All @@ -4414,13 +4421,14 @@ TEST_F(MySQL_upgrade_check_test, get_next_suggested_lts_version) {
EXPECT_NEXT_LTS(innovation, next_lts, key);
}

// next lts for lts line is the latest lts in the next series
for (patch = 0; patch < mysqlshdk::utils::k_shell_version.get_patch();
patch++) {
Version lts(major, minor, patch);
EXPECT_NEXT_LTS(lts, next_lts, key);
EXPECT_NEXT_LTS(lts, next_series_lts, next_series_key);
}

// The current version (latest) never has a next LTS
// The current version (latest) never has a next series LTS
EXPECT_NEXT_LTS(mysqlshdk::utils::k_shell_version, {}, "");
}

Expand Down Expand Up @@ -4529,6 +4537,8 @@ TEST_F(MySQL_upgrade_check_test, suggested_version_check) {

// Now verifies the current shell version series
auto first_lts = get_first_lts_version(mysqlshdk::utils::k_shell_version);
auto next_series_first_lts =
get_first_lts_version(get_next_series(mysqlshdk::utils::k_shell_version));
std::string key;
std::optional<Version> next_lts;
if (mysqlshdk::utils::k_shell_version >= first_lts) {
Expand All @@ -4546,10 +4556,11 @@ TEST_F(MySQL_upgrade_check_test, suggested_version_check) {
CHECK_MSG_SUGGEST(innovation, Version(major, 0, 0), key);
}

// next series lts does not exist for the lts line of the latest series
for (patch = 0; patch < mysqlshdk::utils::k_shell_version.get_patch();
patch++) {
Version lts(mysqlshdk::utils::k_shell_version.get_major(), minor, patch);
CHECK_MSG_SUGGEST(lts, Version(major, 0, 0), key);
CHECK_MSG_EMPTY(lts, Version(major, 0, 0));
}
}
}
Expand Down

0 comments on commit c76274f

Please sign in to comment.