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 891ca04
Show file tree
Hide file tree
Showing 2 changed files with 22 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
21 changes: 21 additions & 0 deletions test/feature/spqr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,33 @@ 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 {
fmt.Println("Enter saveLogs")
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 Expand Up @@ -908,6 +928,7 @@ func InitializeScenario(s *godog.ScenarioContext, t *testing.T, debug bool) {
return ctx, nil
})
s.After(func(ctx context.Context, scenario *godog.Scenario, err error) (context.Context, error) {
fmt.Printf("Enter after part, err = %s\n", err)
if err != nil {
name := scenario.Name
name = strings.Replace(name, " ", "_", -1)
Expand Down

0 comments on commit 891ca04

Please sign in to comment.