[go] database/sql: run tests with different driver variants

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
May 15, 2026, 3:36:25 PM (14 hours ago) May 15
to Damien Neil, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, golang...@luci-project-accounts.iam.gserviceaccount.com, Alan Donovan, golang-co...@googlegroups.com

Gopher Robot submitted the change with unreviewed changes

Unreviewed changes

4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: src/database/sql/sql_test.go
Insertions: 4, Deletions: 1.

@@ -231,9 +231,12 @@

func (c *basicConnector) Connect(ctx context.Context) (driver.Conn, error) {
conn, err := c.fakeConnector.Connect(ctx)
+ if err != nil {
+ return nil, err
+ }
fc := getFakeConn(conn)
fc.skipDirtySession = true // Conn won't implement ResetSession
- return &basicConn{fc}, err
+ return &basicConn{fc}, nil
}

func TestOpenDB(t *testing.T) {
```

Change information

Commit message:
database/sql: run tests with different driver variants

Database drivers can support a variety of optional features.
For example, a driver.Conn can optionally implement the
Queryer and/or QueryerContext interfaces.

We currently run most database/sql tests with a general-purpose
test driver which implements most optional interfaces.

Add support for running tests with a variety of different drivers.
To start with, use two variations: A "basic" driver which only
implements the minimal mandatory interfaces, and a "default"
driver which implements most optional interfaces.

For #67546
Change-Id: I60bd02260810b6468e6b02a1ac7544406a6a6964
Reviewed-by: Alan Donovan <adon...@google.com>
Auto-Submit: Damien Neil <dn...@google.com>
Files:
  • M src/database/sql/fakedb_test.go
  • M src/database/sql/sql_test.go
Change size: L
Delta: 2 files changed, 409 insertions(+), 324 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I60bd02260810b6468e6b02a1ac7544406a6a6964
Gerrit-Change-Number: 766700
Gerrit-PatchSet: 6
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages