-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(server): Updating data store test to use queues (#3166)
* chore(server): Updating data store test to use queues * chore(server): Updating data store test to use queues * fix: build * Adding postgres pipelines * fix: agent unit tests * using testconnection job instead of executor job * cleanup * PR comments
- Loading branch information
Showing
20 changed files
with
2,339 additions
and
439 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"io" | ||
"log" | ||
|
||
"github.com/kubeshop/tracetest/agent/proto" | ||
) | ||
|
||
func (c *Client) startDataStoreConnectionTestListener(ctx context.Context) error { | ||
client := proto.NewOrchestratorClient(c.conn) | ||
|
||
stream, err := client.RegisterDataStoreConnectionTestAgent(ctx, c.sessionConfig.AgentIdentification) | ||
if err != nil { | ||
return fmt.Errorf("could not open agent stream: %w", err) | ||
} | ||
|
||
go func() { | ||
for { | ||
req := proto.DataStoreConnectionTestRequest{} | ||
err := stream.RecvMsg(&req) | ||
if err == io.EOF { | ||
return | ||
} | ||
|
||
if err != nil { | ||
log.Fatal("could not get message from trigger stream: %w", err) | ||
} | ||
|
||
// TODO: Get ctx from request | ||
c.dataStoreConnectionListener(context.Background(), &req) | ||
} | ||
}() | ||
return nil | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/kubeshop/tracetest/agent/proto" | ||
) | ||
|
||
func (c *Client) SendDataStoreConnectionResult(ctx context.Context, response *proto.DataStoreConnectionTestResponse) error { | ||
client := proto.NewOrchestratorClient(c.conn) | ||
|
||
response.AgentIdentification = c.sessionConfig.AgentIdentification | ||
|
||
_, err := client.SendDataStoreConnectionTestResult(ctx, response) | ||
if err != nil { | ||
return fmt.Errorf("could not send data store connection result request: %w", err) | ||
} | ||
|
||
return nil | ||
} |
This file contains 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
Oops, something went wrong.