Skip to content

Uses GitHub Actions for tests and releases.#61

Open
fdcastel wants to merge 7 commits intoFirebirdSQL:masterfrom
fdcastel:fix-issue-60
Open

Uses GitHub Actions for tests and releases.#61
fdcastel wants to merge 7 commits intoFirebirdSQL:masterfrom
fdcastel:fix-issue-60

Conversation

@fdcastel
Copy link
Copy Markdown
Member

@fdcastel fdcastel commented Nov 18, 2025

Fix #60.

ToDo:

  • Update tests to use remote Firebird servers
  • Use Docker for Firebird server
  • Run tests on Linux
  • Build and publish to GitHub Releases
  • Run tests on Windows
  • Set Python package version from Git Tag.
  • Publish to PyPI (just test on official repository, after merge)

Abandoned:

  • Publish to GitHub Packages (unsupported)

Remarks:

  • Tests no longer require a local Firebird server.
    • They now run in the CI workflow using official Firebird Docker images.
  • Unofficial builds are available at: https://github.com/fdcastel/python3-driver/releases
  • The workflow should now publish to PyPI upon correct configuration.

@fdcastel fdcastel changed the title Fix issue 60 Uses GitHub Actions for tests and releases. Nov 18, 2025
@fdcastel
Copy link
Copy Markdown
Member Author

Fixed the version using hatch-vcs.

Summary:

  • hatch-vcs automatically detects versions from git tags (e.g., v2.0.3-beta12.0.3b1)
  • When you push a tag like v2.0.3-beta1, the workflow will build packages with the correct version
  • No manual version updates needed - just create and push git tags
  • The version is baked into the package metadata at build time
  • The __VERSION__ variable imports from the package metadata at runtime

Tag Format:

hatch-vcs follows PEP 440 conventions:

  • v2.0.32.0.3
  • v2.0.3-beta12.0.3b1
  • v2.0.3-rc12.0.3rc1
  • v2.0.3-alpha12.0.3a1

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 18, 2026

Finally marked the last remaining task in this PR as completed 🎉

Replaced the old Docker CI setup (Linux-only) with PSFirebird, enabling a unified workflow that runs on both Ubuntu and Windows across Firebird 3, 4 and 5.

Main change: CI rewrite (ci.yml)

  • PSFirebird v1.2.2 is installed in each job to manage Firebird lifecycle (download, configure, start, stop).
  • SYSDBA initialization: archive-extracted Firebird ships with an empty security database. The workflow creates SYSDBA via an embedded isql connection before starting the TCP server.
  • ISC_USER / ISC_PASSWORD are set as job-level env vars so the driver test suite picks them up automatically.
  • firebird.log seeding: the Service API get_log() tests assert the log is non-empty. An archive-extracted Firebird never writes startup messages to this file, so we seed it before the server starts.
  • Client library path: FirebirdEnvironment.GetClientLibraryPath() is used to pass the correct library path to the test suite on both platforms (no more OS-conditional path guessing).

Minor bugs fixed

These were uncovered while getting the test matrix fully green and are small enough not to warrant their own issues:

  1. conftest.pyPathstr conversion for fb_client_library (tests/conftest.py): The driver_config.fb_client_library option is a StringOption and rejects Path objects. The fix is a one-character change (wrap with str()).

  2. _connect_helper — missing / separator for Windows paths in protocol URLs (src/firebird/driver/core.py): When building inet:// URLs with a host, Windows drive-letter paths were concatenated directly onto the host string, producing malformed URLs like inet://localhost:3050D:\path. Added the / separator so the result is inet://localhost:3050/D:\path, which Firebird parses correctly.

  3. test_connect_config — spurious utf8filename = true (tests/test_connection.py): The database config used in this test included utf8filename = true. That option causes the Firebird engine to interpret the filename as UTF-8 bytes, which breaks attachment on Windows with drive-letter paths, producing "unavailable database". Removed the option since test_connect_config is testing config-based connection routing, not UTF-8 filename encoding.

  4. test_connect_helper — expected DSN values updated (tests/test_connection.py): The unit-test assertions for _connect_helper with Windows paths and a host in protocol-URL mode were updated to match the corrected (now correct) URL format.

@fdcastel fdcastel force-pushed the fix-issue-60 branch 2 times, most recently from aef9aa7 to a0ae985 Compare April 18, 2026 01:59
Use PSFirebird (v1.2.2+) instead of Docker to run Firebird on both Ubuntu
and Windows runners. This removes the platform split where Linux used Docker
and Windows was untested.

Changes:
- Install PSFirebird module in each CI job
- Use New-FirebirdEnvironment / Start-FirebirdInstance / Stop-FirebirdInstance
  to manage Firebird lifecycle on both platforms
- Initialize SYSDBA via embedded isql (archive-extracted Firebird ships with
  an empty security database; embedded connections bypass authentication)
- Set ISC_USER / ISC_PASSWORD env vars at job level for driver test auth
- Seed firebird.log before server start so Service API get_log() tests pass
  (archive-extracted Firebird never writes startup messages to this file)
- Use GetClientLibraryPath() on the FirebirdEnvironment object to pass the
  correct client library to the test suite on both platforms
- Fix LASTEXITCODE false-failure workaround (PSFirebird 1.2.2 fixes the leak
  in Get-FirebirdEnvironment / New-FirebirdEnvironment)

Minor bugs fixed (no separate Issue/PR needed):
- Convert client_lib Path to str before assigning to driver_config
  (Path objects are not accepted by the StringOption config field)
- Fix inet:// protocol URL construction for Windows drive-letter paths:
  _connect_helper was missing the '/' separator before the database path
  when host is set, producing malformed URLs like inet://host:3050D:\\path
- Remove spurious utf8filename=true from test_connect_config database config
  (caused 'unavailable database' on Windows when attaching to an existing DB)
- Fix test_connect_helper expected DSN values to match the corrected URL format
@fdcastel
Copy link
Copy Markdown
Member Author

Rebased onto latest master.

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.

Publish from GitHub Actions?

1 participant