Skip to content

[Bug] test_unit_gpversion tests the old Greenplum GpVersion behavior #2364

Open

Description

@tuhaihe

Apache Cloudberry version

main (3.0.0-devel), commit c88c43d. REL_2_STABLE has the same test file.

What happened

gppylib.test.unit.test_unit_gpversion fails: 10 tests, 5 failures, 4 errors.
The test still describes the Greenplum GpVersion. The GpVersion in
gpMgmt/bin/gppylib/gpversion.py has been different since the initial
Cloudberry code dump:

  • It accepts at most three version numbers. GpVersion([3,3,0,0]) fails with
    "Version too long".
  • getVersionRelease() returns only the major number ("3", not "3.3").
  • isVersionCurrentRelease() compares only the major number with
    MAIN_VERSION, which is [3,99] on main. Old Greenplum strings in the test,
    such as "3.3 build dev", are now the current release.
  • The << operator (__lshift__) is commented out, so test_lshift,
    test_50 and test_lshift_negative fail.
  • test_case_7 expects 7.0.0 to be the current release.

No CI job runs this module, so the failures were not seen.

What you think should happen instead

The test should check the current behavior: major-version releases, at most
three numbers, no <<, and the version strings that Cloudberry prints. It
should build its versions from MAIN_VERSION, so that it does not break at
the next major version.

This needs a rewrite of most of the test file, so I open this issue first.

How to reproduce

From gpMgmt/bin:

PYTHONPATH=.:./gppylib python3 -m unittest gppylib.test.unit.test_unit_gpversion

Operating System

Rocky Linux 9 (any platform)

Anything else

Found while adding the gpMgmt unit tests to the Behave workflow.

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Activity

  1. added
    type: TestingAdding missing tests or correcting existing tests
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: TestingAdding missing tests or correcting existing tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions