Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes to stop confusion of kill delay value #397

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion air_example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stop_on_error = true
# Send Interrupt signal before killing process (windows does not support this feature)
send_interrupt = false
# Delay after sending Interrupt signal
kill_delay = 500 # ms
kill_delay = "500ms"
# Rerun binary or not
rerun = false
# Delay after each executions
Expand Down
20 changes: 17 additions & 3 deletions runner/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ func TestFlag(t *testing.T) {
},
{
name: "check int",
args: []string{"--build.kill_delay", "1000"},
args: []string{"--build.delay", "1000"},
expected: "1000",
key: "build.delay",
},
{
name: "check time.Duration",
args: []string{"--build.kill_delay", "1s"},
expected: "1s",
key: "build.kill_delay",
},
{
Expand Down Expand Up @@ -87,10 +93,18 @@ func TestConfigRuntimeArgs(t *testing.T) {
},
{
name: "check int64",
args: []string{"--build.kill_delay", "1000"},
args: []string{"--build.delay", "1000"},
key: "build.delay",
check: func(t *testing.T, conf *Config) {
assert.Equal(t, 1000, conf.Build.Delay)
},
},
{
name: "check time.Duration",
args: []string{"--build.kill_delay", "500000000"},
key: "build.kill_delay",
check: func(t *testing.T, conf *Config) {
assert.Equal(t, time.Duration(1000), conf.Build.KillDelay)
assert.Equal(t, time.Duration(500*time.Millisecond), conf.Build.KillDelay)
},
},
{
Expand Down