From ce3ae3801a489bbc74be7758d41b04ac703d260b Mon Sep 17 00:00:00 2001 From: Ed Zavada Date: Fri, 10 Jan 2025 14:32:34 -0500 Subject: [PATCH] More review fixes - handle write error in tests (make lint happy) - handle "destroy" and "reset" deployment types --- cmd/world/forge/deployment.go | 4 ++-- cmd/world/forge/forge_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/world/forge/deployment.go b/cmd/world/forge/deployment.go index 4a27cda..42f2e68 100644 --- a/cmd/world/forge/deployment.go +++ b/cmd/world/forge/deployment.go @@ -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 { diff --git a/cmd/world/forge/forge_test.go b/cmd/world/forge/forge_test.go index 5eb3b09..9fd8fcf 100644 --- a/cmd/world/forge/forge_test.go +++ b/cmd/world/forge/forge_test.go @@ -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() {