As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 84862b62 authored by Archish's avatar Archish
Browse files

Test fixes for discover package

parent 1e02a179
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -23,7 +23,7 @@ type Command struct {
func (c *Command) Execute(ctx context.Context) (context.Context, error) {
response, err := c.getUserInfo(ctx)
if err != nil {
return ctx, fmt.Errorf("failed to get username: %v", err)
return ctx, fmt.Errorf("Failed to get username: %v", err) //nolint:stylecheck // This is customer facing message
}
logData := command.LogData{}
Loading
Loading
Loading
Loading
@@ -106,17 +106,17 @@ func TestFailingExecute(t *testing.T) {
{
desc: "With missing arguments",
arguments: &commandargs.Shell{},
expectedError: "failed to get username: who='' is invalid",
expectedError: "Failed to get username: who='' is invalid",
},
{
desc: "When the API returns an error",
arguments: &commandargs.Shell{GitlabUsername: "broken_message"},
expectedError: "failed to get username: Forbidden!",
expectedError: "Failed to get username: Forbidden!",
},
{
desc: "When the API fails",
arguments: &commandargs.Shell{GitlabUsername: "broken"},
expectedError: "failed to get username: Internal API unreachable",
expectedError: "Failed to get username: Internal API unreachable",
},
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment