Add testing framework with Google Test and pytest#17
Open
Conversation
wdconinc
reviewed
Nov 1, 2025
Copilot
AI
changed the title
[WIP] Setup testing framework for C++ and Python interfaces
Add testing framework with Google Test and pytest
Nov 1, 2025
wdconinc
reviewed
Nov 1, 2025
wdconinc
reviewed
Nov 1, 2025
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Changed from BUILD_MOLLERDB_TESTS to BUILD_TESTING with CMAKE_PROJECT_NAME check to match sqlpp23 pattern. This prevents tests from being built when mollerdb is used as a subproject. Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Moved PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD environment variables from individual steps to the job level to avoid duplication and make the workflow cleaner. Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
7ac760f to
bcacb5a
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive testing infrastructure for the mollerdb project, including both C++ and Python test suites. The tests validate module structure, class availability, and error handling, with placeholder tests for future database integration features.
Key changes:
- Adds Google Test-based C++ tests for the Database class
- Adds pytest-based Python tests for module imports, bindings, and integration
- Integrates testing into the CI pipeline with PostgreSQL service for future use
- Updates documentation to describe test structure and execution
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cpp/test_database.cpp | C++ unit tests for Database class constructor and connection string parsing |
| tests/cpp/CMakeLists.txt | CMake configuration for building and discovering C++ tests |
| tests/python/test_basic.py | Python tests for module import and Database class availability |
| tests/python/test_database.py | Python tests for Database class constructor and error handling |
| tests/python/test_integration.py | Integration tests with placeholder tests for Arrow/pandas features |
| tests/python/conftest.py | pytest fixtures providing mock connection strings |
| tests/python/init.py | Makes tests directory a Python package |
| tests/README.md | Comprehensive documentation for test structure and execution |
| CMakeLists.txt | Adds Google Test dependency and test build configuration |
| AGENTS.md | Updates agent documentation with testing information |
| docs/README.md | Adds testing section to user documentation |
| .github/workflows/build.yml | Integrates C++ and Python tests into CI pipeline with PostgreSQL service |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setup Testing Framework for C++ and Python Interfaces with scikit-build-core Integration ✅
Implementation Complete
Successfully implemented comprehensive testing framework for mollerdb with zero security vulnerabilities and no code review issues.
Recent Updates
Latest Change (Environment Variables)
Summary
Test Coverage
Files Changed (12 files, +528 lines)
PostgreSQL Service Configuration
Benefits
✅ Tests can now connect to actual PostgreSQL database in CI
✅ Standard BUILD_TESTING option follows CMake best practices
✅ Defensive check prevents tests when used as subproject
✅ Matches sqlpp23's defensive pattern
✅ Comprehensive integration testing enabled
✅ Health checks ensure database is ready before tests run
✅ Clean workflow with environment variables at job level
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.