Skip to content

Behave: Update gpmgmt dev requirements and files - #2230

Open
tuhaihe wants to merge 4 commits into
apache:mainfrom
tuhaihe:update-gpmgmt-dev-requirements
Open

tuhaihe wants to merge 4 commits into
apache:mainfrom
tuhaihe:update-gpmgmt-dev-requirements

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Nov 3, 2026

Copy link
Copy Markdown
Member

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


`logger.info.any_call(...)` and `logger.info.called_once_with(...)` are
not assertion methods. On a Mock they are just auto-created attributes,
so both lines called a child mock and checked nothing. mock 5.x rejects
such misspelled assertion names with AttributeError, which is how they
surfaced.

Use assert_any_call. The second one also had a stray leading double
quote in the expected message that would never have matched.
behave 1.3 compiles step patterns with case_sensitive=True; 1.2.6 left
parse at its default, which ignores case. Five step definitions in
mgmt_utils.py start with "The" while every feature writes "the", so
under 1.3 they are undefined and 32 gpcheckcat scenarios error out.

Lower-case the definitions, and the three gpcheckcat.feature lines that
spelled the step "Then The user runs sql". No step now matches only
when case is ignored.
@tuhaihe tuhaihe added this to the Behave tests milestone Nov 3, 2026
The Parse Behave Results step matched the summary lines with fixed
patterns taken from behave 1.2: "skipped" last for features and
scenarios, and always ", N undefined" for steps. behave 1.3 prints a
count only when it is non-zero (except "skipped"), and adds "error",
"hook_error" and "cleanup_error". Two things go wrong:

- The steps line no longer ends in ", 0 undefined", so every job
  summary shows "unavailable" for Steps.
- A scenario with an undefined step or a hook error is counted as
  "error", not "failed". "58 scenarios passed, 0 failed, 1 error,
  9 skipped" does not match, so the job reports parse_error with zero
  failures instead of naming the failure.

Match the shape "<n> <kind>s passed, <n> failed[, <n> <status>]..."
and read each count by name. Count error, hook_error and cleanup_error
as failed scenarios. Lines from behave 1.2 parse exactly as before.
Only behave, mock and coverage are used by gpMgmt. The other 36 lines
were gsutil and the transitive pins it needed under Python 2 (enum34,
funcsigs, configparser, pathlib2, scandir, ...), plus old releases with
known CVEs (cryptography 3.3.2, pyOpenSSL 19.1.0, rsa 4.0). Nothing in
the tree calls gsutil. The pins also held behave at 1.2.6: behave 1.3
needs parse >= 1.18, parse-type >= 0.6 and six >= 1.15.

Use ranges instead of exact versions so each platform gets the newest
release its Python supports:

  Python 3.6 (Rocky 8)      behave 1.2.6  mock 5.2.0  coverage 6.2
  Python 3.9 (Rocky 9, CI)  behave 1.3.3  mock 5.2.0  coverage 7.10.7
  Python 3.12 / 3.14        behave 1.3.3  mock 5.2.0  coverage 7.17.0

The two preceding commits fix what behave 1.3 and mock 5 exposed. With
them, all 17 Behave CI jobs give the same scenario counts as main.
@tuhaihe
tuhaihe force-pushed the update-gpmgmt-dev-requirements branch from 0824afd to e94c3f2 Compare November 3, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants