-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PMM-11714 Don't return error if API key can't be created.
- Loading branch information
Showing
22 changed files
with
153 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package management | ||
|
||
import ( | ||
"github.com/percona/pmm/api/managementpb/json/client/node" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestRegisterResult(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
result registerResult | ||
want string | ||
}{ | ||
{ | ||
name: "Success", | ||
result: registerResult{ | ||
PMMAgent: &node.RegisterNodeOKBodyPMMAgent{ | ||
AgentID: "/agent_id/new_id", | ||
RunsOnNodeID: "/node_id/second_id", | ||
}, | ||
Warning: "", | ||
}, | ||
want: `pmm-agent registered. | ||
pmm-agent ID: /agent_id/new_id | ||
Node ID : /node_id/second_id | ||
`, | ||
}, | ||
{ | ||
name: "With warning", | ||
result: registerResult{ | ||
PMMAgent: &node.RegisterNodeOKBodyPMMAgent{ | ||
AgentID: "/agent_id/warning", | ||
RunsOnNodeID: "/node_id/warning_node", | ||
}, | ||
Warning: "Couldn't create Admin API Key", | ||
}, | ||
want: `pmm-agent registered. | ||
pmm-agent ID: /agent_id/warning | ||
Node ID : /node_id/warning_node | ||
Warning: Couldn't create Admin API Key | ||
`, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
assert.Equalf(t, tt.want, tt.result.String(), "String()") | ||
}) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
managed/services/management/mock_agents_state_updater_test.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.