Skip to content

Commit

Permalink
More debug to the god of debug
Browse files Browse the repository at this point in the history
  • Loading branch information
EinKrebs committed Apr 15, 2024
1 parent ec2fb41 commit 87702f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/feature/conf/router_with_scram_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ admin_console_port: '7432'
grpc_api_port: '7000'
router_mode: PROXY
log_level: debug
log_file: /var/log/spqr-router.log
time_quantiles:
- 0.75
world_shard_fallback: true
Expand Down
19 changes: 19 additions & 0 deletions test/feature/spqr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,32 @@ var postgresqlLogsToSave = map[string]string{
"/var/log/postgresql/postgresql-13-main.log": "postgresql.log",
}

var routerLogsToSave = map[string]string{
"/var/log/spqr-router.log": "router.log",
}

func (tctx *testContext) saveLogs(scenario string) error {
var errs []error
for _, service := range tctx.composer.Services() {
var logsToSave map[string]string
switch {
case strings.HasPrefix(service, spqrShardName):
logsToSave = postgresqlLogsToSave
case strings.HasPrefix(service, spqrRouterName):
for file := range routerLogsToSave {
remoteFile, err := tctx.composer.GetFile(service, file)
if err != nil {
errs = append(errs, err)
continue
}
content, err := io.ReadAll(remoteFile)
if err != nil {
errs = append(errs, err)
continue
}
fmt.Println("router logs:")
fmt.Println(string(content))
}
default:
continue
}
Expand Down

0 comments on commit 87702f6

Please sign in to comment.