Skip to content
Open
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/MakeNowJust/heredoc/v2 v2.0.1
github.com/OctopusDeploy/go-octodiff v1.0.0
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.89.1
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.99.0
github.com/bmatcuk/doublestar/v4 v4.4.0
github.com/briandowns/spinner v1.19.0
github.com/google/uuid v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63n
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/OctopusDeploy/go-octodiff v1.0.0 h1:U+ORg6azniwwYo+O44giOw6TiD5USk8S4VDhOQ0Ven0=
github.com/OctopusDeploy/go-octodiff v1.0.0/go.mod h1:Mze0+EkOWTgTmi8++fyUc6r0aLZT7qD9gX+31t8MmIU=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.89.1 h1:EDo4CdA7jYZBHiaKu8nZRf9ndonJXC70OlU29+6KXKc=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.89.1/go.mod h1:VkTXDoIPbwGFi5+goo1VSwFNdMVo784cVtJdKIEvfus=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.99.0 h1:0HzgNBPiOGY7ekP+uoRbX1DeMs0Y2JpJ3ecmUxFtC1o=
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.99.0/go.mod h1:VkTXDoIPbwGFi5+goo1VSwFNdMVo784cVtJdKIEvfus=
github.com/bmatcuk/doublestar/v4 v4.4.0 h1:LmAwNwhjEbYtyVLzjcP/XeVw4nhuScHGkF/XWXnvIic=
github.com/bmatcuk/doublestar/v4 v4.4.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/briandowns/spinner v1.19.0 h1:s8aq38H+Qju89yhp89b4iIiMzMm8YN3p6vGpwyh/a8E=
Expand Down
34 changes: 9 additions & 25 deletions pkg/cmd/runbook/list/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ func TestGitRunbookList(t *testing.T) {
api.ExpectRequest(t, "GET", "/api/Spaces-1").RespondWith(rootResource)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

_, err := testutil.ReceivePair(cmdReceiver)
assert.EqualError(t, err, "git reference must be specified")
Expand All @@ -399,7 +397,7 @@ func TestGitRunbookList(t *testing.T) {
api.ExpectRequest(t, "GET", "/api/").RespondWith(rootResource)
api.ExpectRequest(t, "GET", "/api/Spaces-1").RespondWith(rootResource)

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/all").RespondWith([]*projects.Project{fireProject})
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/all").RespondWithJSON(fixtures.AsServerResponsePlainArray([]*projects.Project{fireProject}))

_ = qa.ExpectQuestion(t, &survey.Select{
Message: "Select the project to list runbooks for",
Expand Down Expand Up @@ -453,9 +451,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=2147483647").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down Expand Up @@ -484,9 +480,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=2147483647").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down Expand Up @@ -515,9 +509,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=2147483647").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down Expand Up @@ -547,9 +539,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=1&partialName=Apply").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down Expand Up @@ -577,9 +567,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=2147483647").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down Expand Up @@ -620,9 +608,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=2147483647").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down Expand Up @@ -650,9 +636,7 @@ func TestGitRunbookList(t *testing.T) {

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Fire Project").RespondWithStatus(404, "NotFound", nil)
api.ExpectRequest(t, "GET", "/api/Spaces-1/projects?partialName=Fire+Project").
RespondWith(resources.Resources[*projects.Project]{
Items: []*projects.Project{fireProject},
})
RespondWithJSON(fixtures.AsServerResponseArray([]*projects.Project{fireProject}))

api.ExpectRequest(t, "GET", "/api/Spaces-1/projects/Projects-22/refs%2Fheads%2Fmain/runbooks?take=2147483647").
RespondWith(resources.Resources[*runbooks.Runbook]{
Expand Down
Loading