Skip to content

Commit 704cf50

Browse files
committed
cleanup
rm extra logs add extra assert for the used schema for json validation
1 parent fd458a4 commit 704cf50

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

tests/integration/api_nodeinfo_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func TestNodeinfo(t *testing.T) {
2727
onGiteaRun(t, func(*testing.T, *url.URL) {
2828
req := NewRequestf(t, "GET", "/api/v1/nodeinfo")
2929
resp := MakeRequest(t, req, http.StatusOK)
30-
t.Log("resp.Body.String() 1:", resp.Body.String())
3130
VerifyJSONSchema(t, resp, "nodeinfo_2.1.json")
31+
3232
var nodeinfo api.NodeInfo
3333
DecodeJSON(t, resp, &nodeinfo)
3434
assert.True(t, nodeinfo.OpenRegistrations)

tests/integration/integration_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,7 @@ func VerifyJSONSchema(t testing.TB, resp *httptest.ResponseRecorder, schemaFile
408408

409409
schema, schemaFileReadErr := os.ReadFile(schemaFilePath)
410410
assert.Nil(t, schemaFileReadErr)
411-
412-
t.Log("schema:", string(schema))
413-
t.Log("resp.Body.Bytes():", resp.Body.Bytes())
414-
t.Log("resp.Body.String():", resp.Body.String())
411+
assert.True(t, len(schema) > 0)
415412

416413
nodeinfoSchema := gojsonschema.NewStringLoader(string(schema))
417414
nodeinfoString := gojsonschema.NewStringLoader(resp.Body.String())

0 commit comments

Comments
 (0)