Skip to content

Commit

Permalink
More review fixes
Browse files Browse the repository at this point in the history
- handle write error in tests (make lint happy)
- handle "destroy" and "reset" deployment types
  • Loading branch information
ezavada committed Jan 10, 2025
1 parent 649a836 commit ce3ae38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/world/forge/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ func status(ctx context.Context) error {
if data["project_id"] != projectID {
return eris.Errorf("Deployment status does not match project id %s", projectID)
}
if data["type"] != "deploy" {
return eris.Errorf("Deployment status does not match type %s", data["type"])
if data["type"] != "deploy" && data["type"] != "destroy" && data["type"] != "reset" {
return eris.Errorf("Unknown deployment type %s", data["type"])
}
executorID, ok := data["executor_id"].(string)
if !ok {
Expand Down
3 changes: 2 additions & 1 deletion cmd/world/forge/forge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ func (s *ForgeTestSuite) writeJSON(w http.ResponseWriter, data interface{}) {

func (s *ForgeTestSuite) writeJSONString(w http.ResponseWriter, data string) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(data))
_, err := w.Write([]byte(data))
s.Require().NoError(err)
}

func (s *ForgeTestSuite) TestGetSelectedOrganization() {
Expand Down

0 comments on commit ce3ae38

Please sign in to comment.