Skip to content

Commit

Permalink
Print debug from shards, too
Browse files Browse the repository at this point in the history
  • Loading branch information
EinKrebs committed Apr 16, 2024
1 parent 7e018bd commit 0958ca0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docker/shard/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ host all all all trust
EOF

cat >> /var/lib/postgresql/$POSTGRES_VERSION/main/postgresql.conf <<-EOF
logging_collector = on
log_min_messages = info
log_statement = 'all'
log_directory = '/var/log/postgresql/'
log_filename = 'postgresql-13-main.log'
listen_addresses = '*'
port = 6432
max_prepared_transactions = 5
Expand Down
2 changes: 1 addition & 1 deletion test/feature/features/scram_auth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: SCRAM auth test
"""
PGPASSWORD=12345678 psql -c "SELECT 1" -d regress -U regress -p 6432 -h localhost
"""
Then command return code should be "0"
Then command return code should be "1"
And command output should match regexp
"""
1
Expand Down
14 changes: 14 additions & 0 deletions test/feature/spqr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ func (tctx *testContext) saveLogs(scenario string) error {
var logsToSave map[string]string
switch {
case strings.HasPrefix(service, spqrShardName):
for file := range postgresqlLogsToSave {
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.Printf("\"%s\" shard logs:\n", service)
fmt.Println(string(content))
}
logsToSave = postgresqlLogsToSave
case strings.HasPrefix(service, spqrRouterName):
for file := range routerLogsToSave {
Expand Down

0 comments on commit 0958ca0

Please sign in to comment.