Skip to content

Commit

Permalink
chore: test unicode support in response messages
Browse files Browse the repository at this point in the history
- Updated test to confirm unicode support in messages
  • Loading branch information
farzadghanei committed May 4, 2024
1 parent a5b7f6b commit 8faf5cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
runners:
default:
timeout: 5m
listen_address: "127.0.0.1:51234"
# response_ok: "OK"
response_ok: "" # any unicode string can be used, '↑' is just an example
# response_fail: "FAILED"
# response_timeout: "TIMEOUT"
cli: {} # override default runner only for CLI mode
http: # override default runner only for HTTP mode
# shutdown_signal_header is mainly useful for testing http mode, do not set it in production
# if set, better be treated like a secret, and a secure transport layer should be used.
# this is the value set on "X-Shutdown-Signal" header in the http request
# shutdown_signal_header: "test-shutdown-signal"
# listen_address: "127.0.0.1:51234"
# request_read_timeout: 2s
# response_write_timeout: 2s
# timeout: 5s


check_suites:
etc:
Expand Down
4 changes: 4 additions & 0 deletions internal/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ func TestReadConf(t *testing.T) {
t.Errorf("invalid read conf, want default runner")
}
wantMinutes := 5
wantResponseOK := "↑" // test unicode support
if runner.Timeout.Minutes() != float64(wantMinutes) {
t.Errorf("invalid read conf default runner, want %v timeout got %v", wantMinutes, runner.Timeout.Minutes())
}
if *runner.ResponseOK != wantResponseOK {
t.Errorf("invalid read conf default runner, want %v response got %v", wantResponseOK, runner.ResponseOK)
}
etcChecks, ok := conf.CheckSuites["etc"]
if !ok {
t.Errorf("read conf found no etc checks")
Expand Down

0 comments on commit 8faf5cb

Please sign in to comment.