ci(cloudsql-pg): add end to end integration test (#113)

End to end integration test for cloudsql postgres.

Include checks for one tool's get (manifest) and post (invoke) endpoint.

Integration tests are excluded from regular unit tests.
This commit is contained in:
Yuan
2024-12-12 13:56:04 -08:00
committed by GitHub
parent 6d19ff96e4
commit 7e8d751d3f
6 changed files with 412 additions and 23 deletions

View File

@@ -87,9 +87,9 @@ func NewServer(cfg ServerConfig, log logLib.Logger) (*Server, error) {
}
sourcesMap[name] = s
}
log.Info(fmt.Sprintf("Initalized %d sources.", len(sourcesMap)))
log.Info(fmt.Sprintf("Initialized %d sources.", len(sourcesMap)))
// initalize and validate the tools
// initialize and validate the tools
toolsMap := make(map[string]tools.Tool)
for name, tc := range cfg.ToolConfigs {
t, err := tc.Initialize(sourcesMap)
@@ -98,7 +98,7 @@ func NewServer(cfg ServerConfig, log logLib.Logger) (*Server, error) {
}
toolsMap[name] = t
}
log.Info(fmt.Sprintf("Initalized %d tools.", len(toolsMap)))
log.Info(fmt.Sprintf("Initialized %d tools.", len(toolsMap)))
// create a default toolset that contains all tools
allToolNames := make([]string, 0, len(toolsMap))
@@ -109,7 +109,7 @@ func NewServer(cfg ServerConfig, log logLib.Logger) (*Server, error) {
cfg.ToolsetConfigs = make(ToolsetConfigs)
}
cfg.ToolsetConfigs[""] = tools.ToolsetConfig{Name: "", ToolNames: allToolNames}
// initalize and validate the toolsets
// initialize and validate the toolsets
toolsetsMap := make(map[string]tools.Toolset)
for name, tc := range cfg.ToolsetConfigs {
t, err := tc.Initialize(cfg.Version, toolsMap)
@@ -118,7 +118,7 @@ func NewServer(cfg ServerConfig, log logLib.Logger) (*Server, error) {
}
toolsetsMap[name] = t
}
log.Info(fmt.Sprintf("Initalized %d toolsets.", len(toolsetsMap)))
log.Info(fmt.Sprintf("Initialized %d toolsets.", len(toolsetsMap)))
s := &Server{
conf: cfg,