test(source/alloydbomni): create MCP integration tests#2964
Open
anubhav756 wants to merge 6 commits intoanubhav-parityfrom
Open
test(source/alloydbomni): create MCP integration tests#2964anubhav756 wants to merge 6 commits intoanubhav-parityfrom
anubhav756 wants to merge 6 commits intoanubhav-parityfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new integration test suite for AlloyDB Omni and a comprehensive set of reusable test helpers for MCP database tools, covering views, schemas, active queries, triggers, and more. The feedback focuses on improving test efficiency and maintainability by suggesting a reduction in test timeouts, the use of proper context propagation instead of context.Background(), and the refactoring of hardcoded SQL filter strings into constants.
tests/mcp_tool.go
Outdated
| // InitPostgresConnectionPool initializes a connection pool for Postgres. | ||
| func InitPostgresConnectionPool(host, port, user, pass, dbname string) (*pgxpool.Pool, error) { | ||
| url := buildPostgresURL(host, port, user, pass, dbname) | ||
| pool, err := pgxpool.New(context.Background(), url.String()) |
Contributor
|
|
||
| // cleanupOldSchemas cleans up schemas that were created more than 1 hour ago | ||
| func cleanupOldSchemas(t *testing.T, ctx context.Context, pool *pgxpool.Pool) { | ||
| rows, err := pool.Query(ctx, "SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE 'test_proc_%'") |
Contributor
01d4bfb to
2d7e90b
Compare
1c411a8 to
77eb420
Compare
4fe514a to
075e596
Compare
77eb420 to
97ce3c1
Compare
075e596 to
af9312a
Compare
97ce3c1 to
bcecb75
Compare
af9312a to
79969dc
Compare
131d237 to
fef27e4
Compare
79969dc to
e284d4f
Compare
6d21e9c to
41b03ac
Compare
816552c to
62dfc08
Compare
2be51dc to
5561185
Compare
62dfc08 to
ddb001a
Compare
5561185 to
480b04b
Compare
ddb001a to
6839d7d
Compare
480b04b to
6cc7509
Compare
6839d7d to
483ed1d
Compare
e120bc5 to
e74fd80
Compare
483ed1d to
8be4808
Compare
e74fd80 to
3a4c79b
Compare
1affb35 to
5cf000b
Compare
29a4b31 to
64f7997
Compare
5cf000b to
940ed19
Compare
aad6cd9 to
9ecd5c2
Compare
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.
This PR adds the mapped integration tests for AlloyDB Omni tools using the native MCP harness.