8000 Enhance Test and CI Compatibility with openGauss by pangpang20 · Pull Request #10 · HuaweiCloudDeveloper/gaussdb-python · GitHub
[go: up one dir, main page]

Skip to content

Enhance Test and CI Compatibility with openGauss #10

New issue
< 8000 div class="mt-3 mb-2 text-center">

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jun 10, 2025

Conversation

pangpang20
Copy link

escription

This PR introduces comprehensive support and adjustments for running the test suite against openGauss, including enhanced compatibility, test skipping for unsupported features, and improved CI configuration.


Changes Made

General Improvements

  • Added try-finally blocks to ensure proper cursor and resource cleanup.
  • Introduced database type detection to dynamically skip unsupported tests.
  • Added @pytest.mark.opengauss_skip marker for granular control over test execution.

Test Suite Adjustments for openGauss

  • Skipped or marked the following tests as unsupported on openGauss:
    • Binary COPY tests for types like inet, cidr, json, datetime, etc.
    • String encoding tests due to binary copy incompatibilities.
    • test_error_encoding (unsupported DO blocks).
    • Connection and async pool tests (no backend PID or pg_terminate_backend support).
    • Reconnect tests (due to backend PID handling differences).
    • SERIALIZABLE isolation level and session timeout behavior.
    • PGconn.info tests due to format discrepancies.

CI Workflow Enhancements

  • Added new GitHub Actions CI job targeting GaussDB (openGauss).
  • Replaced secret-based password with a randomly generated secure password using Python.
  • Standardized DB username to root for consistency with container defaults.
  • Enabled pre-commit linting and installed types-polib.
  • Added Python 3.11 to lint jobs and integrated async/sync compatibility check.

Why

openGauss is not fully PostgreSQL-compatible. These changes ensure:

  • Incompatible tests do not fail CI and are documented as skipped.
  • CI runs reliably on both PostgreSQL and openGauss.
  • Code quality remains high with proper linting and async validation.

Testing

  • All tests passing on GitHub Actions using openGauss.
  • Incompatible tests correctly skipped with justification.
  • Linting and static type checks passing using pre-commit.

Additional Notes

  • This PR does not affect production code.
  • All modifications are limited to tests, tooling, and CI configuration.
  • Skipped tests may be re-enabled in the future if openGauss expands support.

pangpang20 added 29 commits June 6, 2025 15:21
@5xuanwen 5xuanwen merged commit 92aaa40 into HuaweiCloudDeveloper:master Jun 10, 2025
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
0