Skip to content
New issue

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

test: Add postgres testing #2973

Merged
merged 14 commits into from
Apr 25, 2024
Merged

test: Add postgres testing #2973

merged 14 commits into from
Apr 25, 2024

Conversation

anticorrelator
Copy link
Contributor

@anticorrelator anticorrelator commented Apr 24, 2024

resolves #2783

  • Adds a parametrized session fixture, this can be used to parametrize database tests to include either an empty sqlite database session or postgresql database session.
  • Refactors data fixtures to be included individually on tests, database fixtures can be populated just with necessary data
  • Adapts existing DSL tests to use new database testing setup
  • postgres tests can be skipped by passing the --skip-postgres flag to pytest
  • in CI, postgres tests only run in linux

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 24, 2024
Copy link
Contributor

@axiomofjoy axiomofjoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice. Let me know if you need help resolving conflicts.

tests/db/test_models.py Show resolved Hide resolved
tests/db/test_models.py Show resolved Hide resolved
tests/trace/dsl/test_helpers.py Show resolved Hide resolved
tests/trace/dsl/test_helpers.py Show resolved Hide resolved
tests/trace/dsl/test_helpers.py Outdated Show resolved Hide resolved
tests/trace/dsl/test_query.py Show resolved Hide resolved
tests/conftest.py Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
@axiomofjoy axiomofjoy force-pushed the dustin/database-tests branch from 0120042 to 1c67b0f Compare April 24, 2024 20:15
@axiomofjoy
Copy link
Contributor

Think we need to update our developer guide to include instructions on installing postgresql, e.g., via brew.

Copy link
Contributor

@axiomofjoy axiomofjoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work! let's remove the nest asyncio test cases and make them into proper unit tests, otherwise, looks good.

@anticorrelator anticorrelator merged commit 3e7cbad into sql Apr 25, 2024
11 checks passed
@anticorrelator anticorrelator deleted the dustin/database-tests branch April 25, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants