Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Add additional tests#96

Merged
matthewmcneely merged 4 commits intomainfrom
matthewmcneely/add-additional-tests
May 20, 2025
Merged

Add additional tests#96
matthewmcneely merged 4 commits intomainfrom
matthewmcneely/add-additional-tests

Conversation

@matthewmcneely
Copy link
Contributor

Description

This PR adds additional tests for geo types and client pool operation under load

Checklist

  • Code compiles correctly and linting passes locally
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

@matthewmcneely matthewmcneely requested review from a team and Copilot May 16, 2025 19:51
@trunk-io
Copy link

trunk-io bot commented May 16, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes licensing headers across the codebase, extends raw query support with optional variables, adds verbose logging for engine queries, and introduces new geo-type tests along with more comprehensive client pool tests under load.

  • Updated license headers to use SPDX format in tests, examples, and API files
  • Added GeoLocation support and geo-filter test cases in query_test.go
  • Changed Client.QueryRaw signature/implementation to accept a vars map and updated related calls
  • Enhanced engine logging for queries and extended client pool tests (concurrency and stress)

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
util_test.go Updated license header to SPDX
update_test.go Updated license header to SPDX
unit_test/conn_test.go Updated license header to SPDX
query_test.go Defined GeoLocation, added geo-filter tests, updated raw calls
insert_test.go Updated license header to SPDX
examples/readme/main.go Updated license header to SPDX
examples/basic/main.go Updated license header to SPDX
engine.go Added logger.V(2).Info for namespace queries
delete_test.go Updated license header to SPDX
cmd/query/main.go Passed nil for new vars param in QueryRaw call
client_test.go Added client-pool concurrency & stress tests
client.go Extended QueryRaw to accept vars, switched to Context txn
api/types_test.go Updated license header to SPDX
api/types.go Updated license header to SPDX
admin_test.go Updated license header to SPDX
Comments suppressed due to low confidence (3)

client.go:353

  • [nitpick] The local variable client shadows the receiver c, which can be confusing. Consider renaming the pooled connection to something like dgraphClient or conn.
client, cleanup, err := c.pool.get(client)

query_test.go:67

  • [nitpick] The field name Coord is less descriptive than Coordinates and already maps to the JSON tag coordinates. Renaming to Coordinates would improve clarity.
Coord []float64 `json:"coordinates"`

query_test.go:236

  • Currently this new test exercises only the Dgraph client mode. Consider adding a similar QueryRawWithVars test for the engine-backed client (e.g., using file:// URI) to ensure variable binding works in both modes.
t.Run("QueryRawWithVars", func(t *testing.T) {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@matthewmcneely matthewmcneely enabled auto-merge (squash) May 17, 2025 19:14
@matthewmcneely matthewmcneely merged commit 85894ed into main May 20, 2025
7 checks passed
@matthewmcneely matthewmcneely deleted the matthewmcneely/add-additional-tests branch May 20, 2025 12:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants