Skip to content

feat(db2): add clientless IBM Db2 Community Edition container service - #167

Open
cofin wants to merge 1 commit into
feat/rabbitmq-servicefrom
feat/db2-service
Open

cofin wants to merge 1 commit into
feat/rabbitmq-servicefrom
feat/db2-service

Conversation

@cofin

@cofin cofin commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

Adds an IBM Db2 Community Edition container service (db2_service, Db2Service) backed by the official icr.io/db2_community/db2:latest image, with in-container db2 CLI readiness probing and 8-character-compliant pytest-xdist worker database provisioning without requiring ibm-db in the base package.

Key Changes

IBM Db2 Container Service (pytest_databases.docker.db2)

  • Official Container & Capabilities: Starts icr.io/db2_community/db2:latest on port 50000 with privileged=True, ipc_mode="host", and fast-startup environment flags (SAMPLEDB="false", AUTOCONFIG="false", ARCHIVE_LOGS="false").
  • Clientless Readiness & SQL Helpers: Validates readiness via "Setup has completed" log matching plus exec_db2_sql("SELECT 1 FROM SYSIBM.SYSDUMMY1") executed through su - db2inst1 -c ..., and exposes Db2Service.dsn, Db2Service.connection_config, Db2Service.exec_sql(), and Db2Service.create_worker_database().
  • 8-Character Database Name Validation & xdist Isolation: Enforces Db2's 8-character identifier limit via validate_db2_database_name (pytestdb default and ptdb_<n> under pytest-xdist database isolation).

Testing, Documentation & CI

  • Unit & Contract Coverage: Adds tests/test_db2.py covering clientless module import, 8-character identifier validation, dsn/connection_config formatting, exec_db2_sql / create_worker_database, and privileged/host-IPC container launch options.
  • Documentation & Selective CI: Adds docs/supported-databases/db2.rst and registers db2 in .github/ci/provider-groups.json and pyproject.toml.

@codecov-commenter

codecov-commenter commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.41%. Comparing base (1b775e9) to head (a580de3).

Files with missing lines Patch % Lines
src/pytest_databases/docker/db2.py 82.00% 16 Missing and 2 partials ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feat/rabbitmq-service    #167      +/-   ##
========================================================
- Coverage                   8.16%   3.41%   -4.76%     
========================================================
  Files                         28      29       +1     
  Lines                       3060    3160     +100     
  Branches                     254     260       +6     
========================================================
- Hits                         250     108     -142     
- Misses                      2741    3049     +308     
+ Partials                      69       3      -66     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cofin
cofin marked this pull request as draft October 22, 2026 02:52
@cofin
cofin changed the base branch from feat/runtime-healthcheck-and-capabilities to feat/rabbitmq-service October 22, 2026 03:58
@cofin
cofin added this pull request to stack #173 October 22, 2026 05:10
@cofin
cofin marked this pull request as ready for review October 22, 2026 23:29

This branch has not been deployed

No deployments
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