Skip to content

Comments

Increase Unit and Integration Test Coverage for CE and PDP#372

Open
ginaxu1 wants to merge 3 commits intomainfrom
restore-353
Open

Increase Unit and Integration Test Coverage for CE and PDP#372
ginaxu1 wants to merge 3 commits intomainfrom
restore-353

Conversation

@ginaxu1
Copy link
Collaborator

@ginaxu1 ginaxu1 commented Dec 5, 2025

Summary

This PR improves test coverage for the Consent Engine and Policy Decision Point services by adding comprehensive unit tests and integration tests. This replaces legacy shell script-based tests with maintainable, type-safe Go tests that integrate seamlessly with the existing CI/CD pipeline. ref: current unit test coverage by service.

Type of Change

  • New feature (test coverage improvements)
  • Refactoring (replacing legacy test approaches)
  • Bug fix
  • Breaking change
  • Documentation update
  • Performance improvement

@ginaxu1
Copy link
Collaborator Author

ginaxu1 commented Jan 5, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the testing strategy by migrating unit tests from in-memory SQLite to integration tests using a real PostgreSQL database via Docker. This enhances test fidelity. It also introduces comprehensive integration test suites for the Consent Engine and Audit Service. The changes are well-structured, but there are a few issues to address, primarily in the new test files and the updated README, such as removing a merge conflict marker and improving test code maintainability.

@ginaxu1
Copy link
Collaborator Author

ginaxu1 commented Jan 5, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant step forward for the project's testing infrastructure. It introduces integration tests for the Audit and Consent services and migrates the Policy Decision Point tests from SQLite to a more realistic PostgreSQL setup. The new test helper for managing PostgreSQL test databases is comprehensive, and the updated docker-compose.test.yml provides excellent service isolation.

My review focuses on improving test reliability and maintainability. I've identified a critical issue with a merge conflict marker in the README, and several high-severity issues related to missing data cleanup in the new integration tests, which could lead to flaky tests. I've also included some medium-severity suggestions for code refinement and clarity. Overall, this is a great contribution to the project's quality.

@ginaxu1 ginaxu1 force-pushed the restore-353 branch 2 times, most recently from 8009ce6 to 9d1d915 Compare January 5, 2026 08:43
@ginaxu1
Copy link
Collaborator Author

ginaxu1 commented Jan 5, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant step forward for the project's testing strategy. It successfully replaces legacy shell scripts with robust, Go-based integration tests for the Consent Engine and Audit Service. The introduction of new test suites, isolated database configurations in Docker Compose, and comprehensive test helpers are excellent improvements. The code is well-structured, and the tests cover a good range of scenarios, including success paths, failure cases, and edge cases.

I've found a critical issue in tests/integration/graphql_flow_test.go that will cause a compilation failure due to a duplicated function. I've also included a couple of suggestions to improve code readability and maintainability in the test helpers.

Once the critical issue is addressed, this PR will be a great addition to the codebase.

@ginaxu1
Copy link
Collaborator Author

ginaxu1 commented Jan 5, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request does a great job of expanding the integration test suite for the Consent Engine and Audit Service, and refactoring existing tests to use a more realistic PostgreSQL backend instead of SQLite. The new tests are comprehensive and cover many important scenarios. The docker-compose setup is also well-structured for isolated service testing.

My review includes a few suggestions to improve the new tests and test helpers:

  • Strengthening assertions in the audit service tests.
  • Correcting the response handling in the consent service tests, which currently seem to have a bug.
  • Improving the clarity and maintainability of some test functions.
  • Enhancing the security posture of the database test helper by adding a warning for default credentials.

@ginaxu1 ginaxu1 marked this pull request as draft January 7, 2026 04:39
@ginaxu1 ginaxu1 changed the title Integration Tests Part 2: CE and Audit Service Increase Unit and Integration Test Coverage for CE and PDP Jan 14, 2026
@ginaxu1 ginaxu1 marked this pull request as ready for review January 14, 2026 05:44
@ginaxu1 ginaxu1 force-pushed the restore-353 branch 3 times, most recently from 3478418 to 38189fa Compare January 14, 2026 06:51
@ginaxu1
Copy link
Collaborator Author

ginaxu1 commented Jan 14, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the test coverage for the Consent Engine and Policy Decision Point services by introducing a comprehensive suite of unit and integration tests. The refactoring to use a shared testutils package for mocking the database is a commendable improvement for code maintainability. The new integration tests, which leverage a real PostgreSQL database via Docker, are well-implemented and provide valuable, realistic validation of the services. The overall quality of the new tests is high. I have identified a few areas for improvement to enhance the robustness and correctness of the tests.

@ginaxu1 ginaxu1 force-pushed the restore-353 branch 3 times, most recently from b1bfbbe to 9a7b2ea Compare January 17, 2026 15:35
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the test coverage for the Consent Engine and Policy Decision Point services by introducing a comprehensive suite of unit and integration tests. The refactoring to replace legacy shell scripts with type-safe Go tests is a major step forward for maintainability. I'm impressed with the clear separation between unit tests (using mocks) and integration tests (using a real database via Docker Compose), and the creation of a shared testutils package is an excellent practice for reducing code duplication. The new tests are thorough, covering happy paths, edge cases, and error conditions. The code quality is high, and I only found one minor formatting issue to address.

@ginaxu1 ginaxu1 force-pushed the restore-353 branch 3 times, most recently from 429a2e7 to 3fe56e6 Compare January 19, 2026 07:20
@ginaxu1 ginaxu1 requested a review from sthanikan2000 January 19, 2026 17:35
@ginaxu1 ginaxu1 force-pushed the restore-353 branch 4 times, most recently from 1de2d66 to 0aa14fb Compare January 19, 2026 18:24
Co-authored-by: Thanikan Sivatheepan <sthanikan2000@gmail.com>
* Refactor release workflow to enhance metadata extraction and improve Docker image tagging for all services

* Add detailed release process documentation for OpenDIF Core platform

* Enhance release workflow with dry run mode for Docker image pushes

* Refactor Docker build context and Dockerfile paths for Portal Backend and Audit Service

* Add release guide and remove outdated release process documentation

* Refactor release workflow to use environment variables for build time and commit hash, and add workflow summary generation step

* Update release workflow to extract Docker tag without 'v' prefix for versioning

* Address PR Comment: Refactor release workflow to set build time with fallback logic and remove unused variable

* Enhance release workflow to include additional semantic versioning tags and update service descriptions for clarity

* Add frontends to release

* Remove leading 'v' from version tag extraction in release workflow

* Remove outdated release management guide and streamline release instructions in RELEASE.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants