From 704cf504b73b5117e493b205ed450f52e15e75ff Mon Sep 17 00:00:00 2001 From: Meisam <39205857+MFTabriz@users.noreply.github.com> Date: Thu, 15 Dec 2022 18:17:16 +0100 Subject: [PATCH] cleanup rm extra logs add extra assert for the used schema for json validation --- tests/integration/api_nodeinfo_test.go | 2 +- tests/integration/integration_test.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/integration/api_nodeinfo_test.go b/tests/integration/api_nodeinfo_test.go index 34a1c76e75e41..6e80ebc19c2f2 100644 --- a/tests/integration/api_nodeinfo_test.go +++ b/tests/integration/api_nodeinfo_test.go @@ -27,8 +27,8 @@ func TestNodeinfo(t *testing.T) { onGiteaRun(t, func(*testing.T, *url.URL) { req := NewRequestf(t, "GET", "/api/v1/nodeinfo") resp := MakeRequest(t, req, http.StatusOK) - t.Log("resp.Body.String() 1:", resp.Body.String()) VerifyJSONSchema(t, resp, "nodeinfo_2.1.json") + var nodeinfo api.NodeInfo DecodeJSON(t, resp, &nodeinfo) assert.True(t, nodeinfo.OpenRegistrations) diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index cb9614f61d6af..d5fbb393b5bc5 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -408,10 +408,7 @@ func VerifyJSONSchema(t testing.TB, resp *httptest.ResponseRecorder, schemaFile schema, schemaFileReadErr := os.ReadFile(schemaFilePath) assert.Nil(t, schemaFileReadErr) - - t.Log("schema:", string(schema)) - t.Log("resp.Body.Bytes():", resp.Body.Bytes()) - t.Log("resp.Body.String():", resp.Body.String()) + assert.True(t, len(schema) > 0) nodeinfoSchema := gojsonschema.NewStringLoader(string(schema)) nodeinfoString := gojsonschema.NewStringLoader(resp.Body.String())