Skip to content

Commit 2e621e8

Browse files
Update version check to error on empty string
1 parent 03515b4 commit 2e621e8

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

pkg/integration/cli_output_compatibility_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,12 @@ func Test_VersionCommandOutputFormat(t *testing.T) {
4949
hasVersionPrefix := strings.Contains(outputStr, currentVersionPrefix) || strings.Contains(outputStr, currentVersionPrefixAlt)
5050
assert.True(t, hasVersionPrefix, "Version output should contain 'Current Version:' or 'Current version:' prefix")
5151

52-
// Test 2: Should contain a version number in X.Y.Z format (may be empty in dev builds)
52+
// Test 2: Should contain a version number in X.Y.Z format (dev builds should also have version)
5353
versionRegexp := regexp.MustCompile(versionPattern)
5454
matches := versionRegexp.FindAllString(outputStr, -1)
5555

56-
// In dev environments, current version might be empty, but there should be a "New Version:" mentioned
57-
if len(matches) == 0 {
58-
// Check if this is a dev build scenario where current version is empty
59-
assert.True(t, strings.Contains(outputStr, newVersionPrefix),
60-
"If no current version found, should show available version for upgrade")
61-
return
62-
}
56+
// Version should always be present, even in dev environments
57+
require.NotEmpty(t, matches, "CLI version should always be present, cannot be an empty string")
6358

6459
// If we found version numbers, verify the first one is properly formatted
6560
versionStr := matches[0]

0 commit comments

Comments
 (0)