Skip to content

Fix linting, tests, and CI configuration#4

Open
jarobe42 wants to merge 5 commits intomasterfrom
fix/tentalcio-ci
Open

Fix linting, tests, and CI configuration#4
jarobe42 wants to merge 5 commits intomasterfrom
fix/tentalcio-ci

Conversation

@jarobe42
Copy link

@jarobe42 jarobe42 commented Jan 6, 2026

This PR fixes linting errors, unit test failures, and functional test issues that were preventing the CI pipeline from passing. Also adds a local Docker Compose environment for easier development and testing.

Changes

  1. Update dependencies and fix linting
  • Fixed mypy type annotation error in get_df_unsafe() by using Optional[dict] instead of implicit optional
  • Removed deprecated skip-numeric-underscore-normalization option from black configuration
  • Added E704 to flake8 ignore list to resolve conflict between black's stub function formatting and flake8
  1. Fix unit tests
  • Corrected mock paths in test_postgres_handler.py from tentaclio.clients.postgres_client to tentaclio_postgres.clients.postgres_client
  • Updated conftest.py to import tentaclio_postgres directly instead of through tentaclio's client registry
  1. Add local docker environment and fix functional tests
  • Added docker-compose.yml with PostgreSQL 15 for local testing
  • Fixed "relation does not exist" errors by adding explicit db_client.conn.commit() calls after set_schema() and delete_schema() operations
  1. Fix CI configuration for functional tests
  2. Upgraded PostgreSQL from 9.5 to 15 (stable LTS) for both local and CI environments

CharlotteDodd and others added 5 commits November 3, 2025 16:48
- Update Pipfile dependencies to resolve compatibility issues
- Remove deprecated black config option (skip-numeric-underscore-normalization)
- Add E704 to flake8 ignore list for compatibility with black's stub formatting
- Fix type annotation in postgres_client.py: change params: dict = None to
  params: Optional[dict] = None to satisfy mypy's no_implicit_optional
- Apply black and isort formatting to existing files

All linting checks (flake8, mypy, black, isort) now pass.
- Update mock paths in test_postgres_handler.py from tentaclio.clients.postgres_client
  to tentaclio_postgres.clients.postgres_client (the correct module path for this
  plugin package)
- Update conftest.py to import tentaclio_postgres instead of using tentaclio.clients,
  since PostgresClient is not part of the base tentaclio package

All 13 unit tests now pass.
- Add docker-compose.yml for local PostgreSQL testing environment
- Add explicit db_client.conn.commit() calls after set_schema() and delete_schema()
  in test fixtures to ensure schema changes are visible to other database connections
- Add pytest.mark.skipif decorators to gracefully skip tests when PostgreSQL is not
  configured locally

Root cause: Schema changes (CREATE TABLE, DROP TABLE) were not being committed to the
database, so when tentaclio.open() created a new connection, it couldn't see the tables
created by the test fixture, causing "relation does not exist" errors.

All 15 functional tests now pass when run with local PostgreSQL via docker-compose.
- Update PostgreSQL connection string to include password authentication:
  postgresql://circleci:testpassword@localhost:5432/tentaclio-db
- Set POSTGRES_PASSWORD in postgres container environment
- Install postgresql-client in CI for database readiness checks
- Add wait-for-postgres step to ensure database is ready before running tests

The functional tests were timing out in CI because:
1. The connection string didn't include authentication credentials
2. Tests ran before PostgreSQL was fully initialized

With these changes, the functional tests run successfully in CI with proper
password authentication instead of relying on trust-based authentication.
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

Comments