Skip to content

Commit

Permalink
Merge branch 'main' into issue-1903-findandmodify-error
Browse files Browse the repository at this point in the history
  • Loading branch information
Elena Grahovac authored May 19, 2023
2 parents e05dbd0 + faddeeb commit 2106ffa
Show file tree
Hide file tree
Showing 111 changed files with 1,679 additions and 395 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
include:
- { name: "MongoDB", task: "mongodb" }
- { name: "PostgreSQL", task: "pg" }
- { name: "SQLite", task: "sqlite" }
# - { name: "Tigris", task: "tigris" }
# - { name: "Tigris main", task: "tigris", tigris_dockerfile: "tigris_main" }

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ bin/
vendor/

# development and build artifacts, temporary files, etc
*.txt
*.out
*.sqlite
*.txt
**/testdata/fuzz/
state.json
tmp/
Expand Down
5 changes: 4 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ issues:
path: cmd/envtool
text: pgdb

# only `pg` handler can import `sjson` package, no other handler can do that
# only `pg` handler and `sqlite` backend can import `sjson` package, no other handlers or backends can do that
- linters: [depguard]
path: internal/handlers/pg
text: sjson
- linters: [depguard]
path: internal/backends/sqlite
test: sjson

# only `tigris` handler can import `tigrisdb` package, no other handler can do that
- linters: [depguard]
Expand Down
31 changes: 30 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ tasks:
- bin/task{{exeExt}} -d tools tools-test

test-integration:
desc: "Run integration tests for `pg` and `tigris` in parallel"
desc: "Run integration tests for several backends in parallel"
deps:
- test-integration-pg
- test-integration-mongodb
# no test-integration-sqlite yet
# disable for now - test-integration-tigris
# no test-integration-hana

Expand All @@ -195,6 +196,17 @@ tasks:
-postgresql-url=postgres://username@127.0.0.1:5432/ferretdb
-compat-url='mongodb://username:password@127.0.0.1:47018/?tls=true&tlsCertificateKeyFile=../build/certs/client.pem&tlsCaFile=../build/certs/rootCA-cert.pem'
test-integration-sqlite:
desc: "Run integration tests for `sqlite` handler"
dir: integration
cmds:
- >
go test -count=1 -timeout={{.INTEGRATIONTIME}} {{.RACEFLAG}} -tags={{.BUILDTAGS}} -shuffle=on -coverpkg=../...
-coverprofile=integration-sqlite.txt .
-target-backend=ferretdb-sqlite
-target-tls
-compat-url='mongodb://username:password@127.0.0.1:47018/?tls=true&tlsCertificateKeyFile=../build/certs/client.pem&tlsCaFile=../build/certs/rootCA-cert.pem'
test-integration-tigris:
desc: "Run integration tests for `tigris` handler"
dir: integration
Expand Down Expand Up @@ -284,6 +296,18 @@ tasks:
--postgresql-url=postgres://username@127.0.0.1:5432/ferretdb
--test-records-dir=tmp/records
run-sqlite:
desc: "Run FerretDB with `sqlite` handler"
deps: [build-host]
cmds:
- >
bin/ferretdb{{exeExt}} -test.coverprofile=cover.txt --
--listen-addr=:27017
--proxy-addr=127.0.0.1:47017
--mode=diff-normal
--handler=sqlite
--test-records-dir=tmp/records
run-tigris:
desc: "Run FerretDB with `tigris` handler"
deps: [build-host]
Expand Down Expand Up @@ -406,6 +430,11 @@ tasks:
cmds:
- docker compose exec -e PGPASSWORD=password postgres psql -U username -d ferretdb

sqlite3:
desc: "Run sqlite3"
cmds:
- sqlite3 *.sqlite

mongosh:
desc: "Run MongoDB shell (`mongosh`)"
cmds:
Expand Down
2 changes: 1 addition & 1 deletion build/deps/docusaurus-docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/ferretdb/docusaurus-docs:2.4.0-2
FROM ghcr.io/ferretdb/docusaurus-docs:2.4.1-1
2 changes: 1 addition & 1 deletion build/deps/postgres.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM postgres:15.2
FROM postgres:15.3
2 changes: 1 addition & 1 deletion build/docker/all-in-one.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ EOF

# final stage

FROM postgres:15.2 AS all-in-one
FROM postgres:15.3 AS all-in-one

ARG LABEL_VERSION
ARG LABEL_COMMIT
Expand Down
8 changes: 4 additions & 4 deletions cmd/envtool/envtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func mkdir(paths ...string) error {
var errs error

for _, path := range paths {
if err := os.MkdirAll(path, 0o700); err != nil {
if err := os.MkdirAll(path, 0o777); err != nil {
errs = errors.Join(errs, err)
}
}
Expand All @@ -348,14 +348,14 @@ func rmdir(paths ...string) error {
}

// read will show the content of a file.
func read(paths ...string) error {
func read(w io.Writer, paths ...string) error {
for _, path := range paths {
b, err := os.ReadFile(path)
if err != nil {
return err
}

fmt.Print(string(b))
fmt.Fprint(w, string(b))
}

return nil
Expand Down Expand Up @@ -408,7 +408,7 @@ func main() {
case "shell rmdir <path>":
err = rmdir(cli.Shell.Rmdir.Paths...)
case "shell read <path>":
err = read(cli.Shell.Read.Paths...)
err = read(os.Stdout, cli.Shell.Read.Paths...)
default:
err = fmt.Errorf("unknown command: %s", cmd)
}
Expand Down
18 changes: 18 additions & 0 deletions cmd/envtool/envtool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package main

import (
"bytes"
"os"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -58,3 +60,19 @@ func TestMkdirAndRmdir(t *testing.T) {
assert.NoDirExists(t, path)
}
}

func TestRead(t *testing.T) {
t.Parallel()

f, err := os.CreateTemp("", "test_read")
assert.NoError(t, err)

s := "test string in a file"
_, err = f.Write([]byte(s))
assert.NoError(t, err)

var output bytes.Buffer
err = read(&output, f.Name())
assert.NoError(t, err)
assert.Equal(t, s, output.String())
}
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/AlekSi/pointer v1.2.0
github.com/SAP/go-hdb v1.2.6
github.com/SAP/go-hdb v1.3.0
github.com/alecthomas/kong v0.7.1
github.com/google/uuid v1.3.0
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
Expand All @@ -14,13 +14,13 @@ require (
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/client_model v0.4.0
github.com/prometheus/common v0.43.0
github.com/stretchr/testify v1.8.2
github.com/tigrisdata/tigris-client-go v1.0.0-beta.37
github.com/stretchr/testify v1.8.3
github.com/tigrisdata/tigris-client-go v1.0.0
go.opentelemetry.io/otel v1.15.1
go.opentelemetry.io/otel/trace v1.15.1
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.9.0 // indirect; always use @latest
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
golang.org/x/net v0.10.0
golang.org/x/sys v0.8.0
modernc.org/sqlite v1.22.1
Expand Down
20 changes: 8 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tS
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/SAP/go-hdb v1.2.6 h1:FLrDgSySez0Ye+e4g8pm0ciSj2xOdPFM0reY/fcNaS0=
github.com/SAP/go-hdb v1.2.6/go.mod h1:LCziJVuENlInAw8+9sb1ZgQZKThaFRE6vUcLeTLUr/M=
github.com/SAP/go-hdb v1.3.0 h1:ldNnAfI1dOHARYxagtvvJj5y6jK+joHUZ5DXRr2QgXM=
github.com/SAP/go-hdb v1.3.0/go.mod h1:Aqn8GpDM15AOEV83O9CA0Q28MOKszDCCo83FvJx5cl4=
github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0=
github.com/alecthomas/kong v0.7.1 h1:azoTh0IOfwlAX3qN9sHWTxACE2oV8Bg2gAwBsMwDQY4=
github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
Expand Down Expand Up @@ -163,19 +163,15 @@ github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKk
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/tigrisdata/tigris-client-go v1.0.0-beta.37 h1:YFwjiEiexMDHTudzdrfGk9I7TAIj/mamsp/XbfNFCrE=
github.com/tigrisdata/tigris-client-go v1.0.0-beta.37/go.mod h1:2n6TQUdoTbzuTtakHT/ZNuK5X+I/i57BqqCcYAzG7y4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tigrisdata/tigris-client-go v1.0.0 h1:07Qw8Tm0qL15WiadP0hp4iBiRzfNSJ+GH4/ozO0nNs0=
github.com/tigrisdata/tigris-client-go v1.0.0/go.mod h1:2n6TQUdoTbzuTtakHT/ZNuK5X+I/i57BqqCcYAzG7y4=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
Expand Down Expand Up @@ -203,8 +199,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o=
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU=
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down
1 change: 1 addition & 0 deletions integration/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tasks:
-tags=ferretdb_testenvdata .
-target-backend=ferretdb-pg
-postgresql-url=postgres://username:password@127.0.0.1:5433/ferretdb?pool_min_conns=1
# no sqlite yet
- >
go test -count=1 {{.RACEFLAG}} -run=TestEnvData
-tags=ferretdb_testenvdata,ferretdb_tigris .
Expand Down
4 changes: 2 additions & 2 deletions integration/commands_diagnostic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ func TestCommandsDiagnosticGetLog(t *testing.T) {

var actual bson.D
err := collection.Database().RunCommand(ctx, tc.command).Decode(&actual)
if err != nil {
AssertEqualAltError(t, *tc.err, tc.alt, err)
if tc.err != nil {
AssertEqualAltCommandError(t, *tc.err, tc.alt, err)
return
}
require.NoError(t, err)
Expand Down
8 changes: 4 additions & 4 deletions integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ require (
github.com/AlekSi/pointer v1.2.0
github.com/FerretDB/FerretDB v0.0.0-00010101000000-000000000000
github.com/prometheus/client_golang v1.15.1
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.3
go.mongodb.org/mongo-driver v1.11.6
go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.41.1
go.opentelemetry.io/otel v1.15.1
go.opentelemetry.io/otel/exporters/jaeger v1.15.1
go.opentelemetry.io/otel/sdk v1.15.1
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
)

require (
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/SAP/go-hdb v1.2.6 // indirect
github.com/SAP/go-hdb v1.3.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/benbjohnson/clock v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down Expand Up @@ -58,7 +58,7 @@ require (
github.com/prometheus/common v0.43.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/tigrisdata/tigris-client-go v1.0.0-beta.37 // indirect
github.com/tigrisdata/tigris-client-go v1.0.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
Expand Down
20 changes: 8 additions & 12 deletions integration/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tS
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/SAP/go-hdb v1.2.6 h1:FLrDgSySez0Ye+e4g8pm0ciSj2xOdPFM0reY/fcNaS0=
github.com/SAP/go-hdb v1.2.6/go.mod h1:LCziJVuENlInAw8+9sb1ZgQZKThaFRE6vUcLeTLUr/M=
github.com/SAP/go-hdb v1.3.0 h1:ldNnAfI1dOHARYxagtvvJj5y6jK+joHUZ5DXRr2QgXM=
github.com/SAP/go-hdb v1.3.0/go.mod h1:Aqn8GpDM15AOEV83O9CA0Q28MOKszDCCo83FvJx5cl4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
Expand Down Expand Up @@ -166,23 +166,19 @@ github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKk
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tigrisdata/tigris-client-go v1.0.0-beta.37 h1:YFwjiEiexMDHTudzdrfGk9I7TAIj/mamsp/XbfNFCrE=
github.com/tigrisdata/tigris-client-go v1.0.0-beta.37/go.mod h1:2n6TQUdoTbzuTtakHT/ZNuK5X+I/i57BqqCcYAzG7y4=
github.com/tigrisdata/tigris-client-go v1.0.0 h1:07Qw8Tm0qL15WiadP0hp4iBiRzfNSJ+GH4/ozO0nNs0=
github.com/tigrisdata/tigris-client-go v1.0.0/go.mod h1:2n6TQUdoTbzuTtakHT/ZNuK5X+I/i57BqqCcYAzG7y4=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=
Expand Down Expand Up @@ -227,8 +223,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o=
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU=
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down
2 changes: 1 addition & 1 deletion integration/query_projection_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestQueryProjectionCompat(t *testing.T) {
// topLevelFieldsIntegers contains documents with several top level fields with integer values.
topLevelFieldsIntegers := shareddata.NewTopLevelFieldsProvider(
"TopLevelFieldsIntegers",
[]string{"ferretdb-pg", "ferretdb-tigris", "mongodb"},
nil,
map[string]map[string]any{
"ferretdb-tigris": {
"$tigrisSchemaString": `{
Expand Down
6 changes: 6 additions & 0 deletions integration/setup/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func setupListener(tb testing.TB, ctx context.Context, logger *zap.Logger) (*mon
require.NotEmpty(tb, *postgreSQLURLF, "-postgresql-url must be set for %q", *targetBackendF)
require.Empty(tb, *tigrisURLSF, "-tigris-urls must be empty for %q", *targetBackendF)
handler = "pg"
case "ferretdb-sqlite":
require.Empty(tb, *postgreSQLURLF, "-postgresql-url must be empty for %q", *targetBackendF)
require.Empty(tb, *tigrisURLSF, "-tigris-urls must be empty for %q", *targetBackendF)
handler = "sqlite"
case "ferretdb-tigris":
require.Empty(tb, *postgreSQLURLF, "-postgresql-url must be empty for %q", *targetBackendF)
require.NotEmpty(tb, *tigrisURLSF, "-tigris-urls must be set for %q", *targetBackendF)
Expand All @@ -105,6 +109,8 @@ func setupListener(tb testing.TB, ctx context.Context, logger *zap.Logger) (*mon

PostgreSQLURL: *postgreSQLURLF,

SQLiteURI: filepath.Join("..", "tmp", "sqlite-tests"),

TigrisURL: nextTigrisUrl(),

TestOpts: registry.TestOpts{
Expand Down
2 changes: 1 addition & 1 deletion integration/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (

// Other globals.
var (
allBackends = []string{"ferretdb-pg", "ferretdb-tigris", "mongodb"}
allBackends = []string{"ferretdb-pg", "ferretdb-sqlite", "ferretdb-tigris", "mongodb"}

CertsRoot = filepath.Join("..", "build", "certs") // relative to `integration` directory
)
Expand Down
Loading

0 comments on commit 2106ffa

Please sign in to comment.