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

Print empty array if hosts not found #326

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

kazeburo
Copy link
Contributor

related: #324

initialize hostsFormat with make to avoid print "null" when no hosts found.

Copy link
Contributor

@Krout0n Krout0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change these expected in this test case.

mkr/hosts/app_test.go

Lines 162 to 185 in ad3a0e6

{
id: "name",
hosts: []*mackerel.Host{},
name: "Sample.app",
expected: "null\n",
},
{
id: "service",
hosts: []*mackerel.Host{},
service: "SampleService",
expected: "null\n",
},
{
id: "roles",
hosts: []*mackerel.Host{},
roles: []string{"role1", "role2"},
expected: "null\n",
},
{
id: "statuses",
hosts: []*mackerel.Host{},
statuses: []string{mackerel.HostStatusPoweroff, mackerel.HostStatusMaintenance},
expected: "null\n",
},

@Krout0n Krout0n self-requested a review October 26, 2020 06:13
Copy link
Contributor

@Krout0n Krout0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your work! @kazeburo

@Krout0n Krout0n merged commit be1a2f7 into mackerelio:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants