-
Notifications
You must be signed in to change notification settings - Fork 2
Int test fail paths #429
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
base: main
Are you sure you want to change the base?
Int test fail paths #429
Conversation
Summary of ChangesHello @ginaxu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces several enhancements and new tests to improve the reliability, security, and maintainability of the consent engine and policy decision point services. It includes documentation for the release process, dependency cleanup, comprehensive unit and integration tests, code validation, and improved test infrastructure. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
ca6224d to
5968bd2
Compare
There was a problem hiding this 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 introduces a comprehensive suite of new integration tests across the Consent Engine and Policy Decision Point services, significantly enhancing the test coverage and reliability of the system. The tests cover various success and failure paths, including service unavailability, consent status changes, and authorization failures. Additionally, database connection helpers have been refactored and improved, and a critical security measure (isValidDBName) has been added to prevent SQL injection in test database creation. Documentation for the integration test structure has also been updated. Overall, these changes represent a substantial improvement in the project's testing infrastructure and robustness.
I am having trouble creating individual review comments. Click here to see my feedback.
exchange/policy-decision-point/v1/testhelpers/helpers.go (72-75)
The isValidDBName function is a critical security addition. It helps prevent SQL injection vulnerabilities when dynamically creating database names in PostgreSQL, especially in test environments where inputs might be less controlled. This is an excellent practice to ensure the integrity of database operations.
tests/integration/policy/policy_test.go (192-220)
The comment correctly identifies that the handler currently doesn't validate an empty schemaId. Adding this validation directly in the handler would improve API robustness by catching invalid requests earlier and providing clearer error messages to clients. This would prevent the request from proceeding to the service layer with potentially invalid data.
docs/RELEASE.md (12)
It's good practice to use a placeholder for the version number in documentation examples to make it clear that v1.0.0 is an example and not a literal value to be used. This improves the clarity and reusability of the instructions.
git tag <VERSION>
docs/RELEASE.md (23)
Similar to the tag example, using a placeholder for the version in the manual release instructions would make it clearer that v1.0.0 is an example. This helps users understand they need to substitute the actual version.
Go to **Actions** → **Release - Build and Publish All Services** → **Run workflow** → Enter version (e.g., `<VERSION>`)
docs/RELEASE.md (42)
Using a placeholder for the version in the verification command makes the example more generic and useful for future releases. This indicates that the user should replace <VERSION> with the actual release version.
docker pull ghcr.io/opendif/opendif-core/portal-backend:<VERSION>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually Integration tests workflow should be triggered in the GitHub Actions. But it didn't . So triggered it manually and it fails. Check at https://github.com/OpenDIF/opendif-core/actions/runs/21288083314
Fix the issues. Your test cases are fine. Also If you can make changes to the integration-workflow code trigger workflow, that will be also fine
Summary
Added
tests/integration/failure_paths_test.gowith 6 failure path tests:TestFailurePath_PDP_ServiceUnavailableTestFailurePath_PDP_Succeeds_ConsentNotGrantedTestFailurePath_PDP_Succeeds_ConsentExpiredTestFailurePath_PDP_AuthorizationFailureTestFailurePath_ConsentEngine_ServiceUnavailableTestFailurePath_PDP_Succeeds_ConsentRejectedTestFailurePath_Provider_ServiceUnavailable