Skip to content

Commit

Permalink
test(e2e): fix svc status output for rdws test (#2342)
Browse files Browse the repository at this point in the history
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
  • Loading branch information
efekarakus authored May 18, 2021
1 parent 4efaa0f commit 110a6e1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions e2e/apprunner/apprunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ var _ = Describe("App Runner", func() {

Context("run svc status to ensure that the service is healthy", func() {
var (
svcStatus *client.SvcStatusOutput
out *client.SvcStatusOutput
svcStatusError error
)

BeforeAll(func() {
svcStatus, svcStatusError = cli.SvcStatus(&client.SvcStatusRequest{
out, svcStatusError = cli.SvcStatus(&client.SvcStatusRequest{
Name: svcName,
AppName: appName,
EnvName: envName,
Expand All @@ -82,7 +82,7 @@ var _ = Describe("App Runner", func() {
})

It("should return app runner service status", func() {
Expect(svcStatus.Service.Status).To(Equal("RUNNING"))
Expect(out.Status).To(Equal("RUNNING"))
})
})

Expand Down Expand Up @@ -258,11 +258,11 @@ var _ = Describe("App Runner", func() {
})

It("should successfully pause service", func() {
Expect(pausedSvcStatus.Service.Status).To(Equal("PAUSED"))
Expect(pausedSvcStatus.Status).To(Equal("PAUSED"))
})

It("should successfully resume service", func() {
Expect(resumedSvcStatus.Service.Status).To(Equal("RUNNING"))
Expect(resumedSvcStatus.Status).To(Equal("RUNNING"))
})
})

Expand Down
3 changes: 2 additions & 1 deletion e2e/internal/client/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ func (cli *CLI) SvcPause(opts *SvcPauseRequest) (string, error) {
exec.Command(cli.path, "svc", "pause",
"--app", opts.AppName,
"--name", opts.Name,
"--env", opts.EnvName))
"--env", opts.EnvName,
"--yes"))
}

/*SvcResume runs:
Expand Down
1 change: 1 addition & 0 deletions e2e/internal/client/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

// SvcStatusOutput is the JSON output of the svc status.
type SvcStatusOutput struct {
Status string `json:"status"`
Service SvcStatusServiceInfo
Tasks []SvcStatusTaskInfo `json:"tasks"`
Alarms []SvcStatusAlarmInfo `json:"alarms"`
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/describe/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,15 @@ func (s *ecsServiceStatus) JSONString() (string, error) {
func (a *apprunnerServiceStatus) JSONString() (string, error) {
data := struct {
ARN string `json:"arn"`
Status string `json:"status"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Source struct {
ImageID string `json:"imageId"`
} `json:"source"`
}{
ARN: a.Service.ServiceARN,
Status: a.Service.Status,
CreatedAt: a.Service.DateCreated,
UpdatedAt: a.Service.DateUpdated,
Source: struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/describe/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ System Logs
2021-05-18T19:26:25Z [AppRunner] Service creation started.
`,
json: `{"arn":"arn:aws:apprunner:us-east-1:1111:service/frontend/8a2b343f658144d885e47d10adb4845e","createdAt":"2020-01-01T00:00:00Z","updatedAt":"2020-03-01T00:00:00Z","source":{"imageId":"hello"}}` + "\n",
json: `{"arn":"arn:aws:apprunner:us-east-1:1111:service/frontend/8a2b343f658144d885e47d10adb4845e","status":"RUNNING","createdAt":"2020-01-01T00:00:00Z","updatedAt":"2020-03-01T00:00:00Z","source":{"imageId":"hello"}}` + "\n",
},
}

Expand Down

0 comments on commit 110a6e1

Please sign in to comment.