Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update go dependencies #1329

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
go 1.23.4
go 1.23.5

use ./server
445 changes: 442 additions & 3 deletions go.work.sum

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ help:
lint:
golangci-lint run --fix

TARGET_TEST :=./...
REEARTH_DB := mongodb://localhost
test:
go test -race -short -v ./...
REEARTH_DB=${REEARTH_DB} go test ./... -run ${TARGET_TEST}

failcheck:
go test -race -short -failfast -p 1 $(TEST_DIR)
Expand Down
4 changes: 2 additions & 2 deletions server/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func StartServerWithRepos(t *testing.T, cfg *config.Config, repos *repo.Containe
}
})

return httpexpect.New(t, "http://"+l.Addr().String())
return httpexpect.Default(t, "http://"+l.Addr().String())
}

type GraphQLRequest struct {
Expand Down Expand Up @@ -177,7 +177,7 @@ func StartGQLServerWithRepos(t *testing.T, cfg *config.Config, repos *repo.Conta
t.Fatalf("server serve: %v", err)
}
})
return httpexpect.New(t, "http://"+l.Addr().String())
return httpexpect.Default(t, "http://"+l.Addr().String())
}

func Server(t *testing.T, seeder Seeder) *httpexpect.Expect {
Expand Down
16 changes: 8 additions & 8 deletions server/e2e/dataset_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ func TestDatasetExport(t *testing.T) {
WithHeader("X-Reearth-Debug-User", uID.String()).
Expect().
Status(http.StatusOK).
ContentType("text/csv")
res.Header("Content-Disposition").Equal("attachment;filename=test.csv")
res.Body().Equal(",f1,f2,f3,location_lng,location_lat\n" + dsID.String() + ",test,123,true,12.000000,11.000000\n")
HasContentType("text/csv")
res.Header("Content-Disposition").IsEqual("attachment;filename=test.csv")
res.Body().IsEqual(",f1,f2,f3,location_lng,location_lat\n" + dsID.String() + ",test,123,true,12.000000,11.000000\n")

res = e.GET("/api/datasets/{}.csv", dssID).
WithHeader("X-Reearth-Debug-User", uID.String()).
Expect().
Status(http.StatusOK).
ContentType("text/csv")
res.Header("Content-Disposition").Equal("attachment;filename=test.csv")
res.Body().Equal(",f1,f2,f3,location_lng,location_lat\n" + dsID.String() + ",test,123,true,12.000000,11.000000\n")
HasContentType("text/csv")
res.Header("Content-Disposition").IsEqual("attachment;filename=test.csv")
res.Body().IsEqual(",f1,f2,f3,location_lng,location_lat\n" + dsID.String() + ",test,123,true,12.000000,11.000000\n")

res = e.GET("/api/datasets/{}.json", dssID).
WithHeader("X-Reearth-Debug-User", uID.String()).
Expect().
Status(http.StatusOK).
ContentType("application/json")
res.Header("Content-Disposition").Equal("attachment;filename=test.csv.json")
HasContentType("application/json")
res.Header("Content-Disposition").IsEqual("attachment;filename=test.csv.json")

res.JSON().Equal(map[string]any{
"schema": map[string]any{
Expand Down
26 changes: 13 additions & 13 deletions server/e2e/gql_asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ func TestGetAssets(t *testing.T) {

res := createAsset(t, e, "test.png", true, teamId)
res.Object().Value("data").Object().Value("createAsset").Object().Value("asset").Object().
ValueEqual("teamId", teamId).
ValueEqual("name", "test.png").
ValueEqual("coreSupport", true)
HasValue("teamId", teamId).
HasValue("name", "test.png").
HasValue("coreSupport", true)

res = createAsset(t, e, "test.png", false, teamId)
res.Object().Value("data").Object().Value("createAsset").Object().Value("asset").Object().
ValueEqual("teamId", teamId).
ValueEqual("name", "test.png").
ValueEqual("coreSupport", false)
HasValue("teamId", teamId).
HasValue("name", "test.png").
HasValue("coreSupport", false)

res = createAsset(t, e, "test.csv", true, teamId)
res.Object().Value("data").Object().Value("createAsset").Object().Value("asset").Object().
ValueEqual("teamId", teamId).
ValueEqual("name", "test.csv").
ValueEqual("coreSupport", true)
HasValue("teamId", teamId).
HasValue("name", "test.csv").
HasValue("coreSupport", true)

res = createAsset(t, e, "test.csv", false, teamId)
res.Object().Value("data").Object().Value("createAsset").Object().Value("asset").Object().
ValueEqual("teamId", teamId).
ValueEqual("name", "test.csv").
ValueEqual("coreSupport", false)
HasValue("teamId", teamId).
HasValue("name", "test.csv").
HasValue("coreSupport", false)

// Write directly to the DB
ctx := context.Background()
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestGetAssets(t *testing.T) {
res = getAssets(e, teamId)
assets := res.Object().Value("data").Object().Value("assets").Object().Value("nodes").Array().Iter()
for _, a := range assets {
a.Object().ValueEqual("coreSupport", true) // coreSupport true only
a.Object().HasValue("coreSupport", true) // coreSupport true only
}

}
Expand Down
14 changes: 7 additions & 7 deletions server/e2e/gql_custom_property_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ func TestChangeCustomPropertyTitle(t *testing.T) {
}`)

features := res.Path("$.sketch.featureCollection.features").Array()
features.Length().Equal(2)
feature0 := features.Element(0).Object()
feature1 := features.Element(1).Object()
features.Length().IsEqual(2)
feature0 := features.Value(0).Object()
feature1 := features.Value(1).Object()

JSONEqRegexpInterface(t, feature0.Raw(), `
{
Expand Down Expand Up @@ -220,9 +220,9 @@ func TestRemoveCustomProperty(t *testing.T) {
}`)

features := res.Path("$.sketch.featureCollection.features").Array()
features.Length().Equal(2)
feature0 := features.Element(0).Object()
feature1 := features.Element(1).Object()
features.Length().IsEqual(2)
feature0 := features.Value(0).Object()
feature1 := features.Value(1).Object()

JSONEqRegexpInterface(t, feature0.Raw(), `

Expand Down Expand Up @@ -289,7 +289,7 @@ func getNewLayersOfScene(e *httpexpect.Expect, sId string) *httpexpect.Object {
}
res := Request(e, uID.String(), requestBody)
newLayers := res.Path("$.data.node.newLayers").Array()
newLayers.Length().Equal(1)
newLayers.Length().IsEqual(1)
return newLayers.Element(0).Object()
}

Expand Down
Loading
Loading