Skip to content

Commit

Permalink
INTG-2181 SQLite Lock (#242)
Browse files Browse the repository at this point in the history
* INTG-2181 changed the busy timeout and limited the concurrent go-routines to 10

* INTG-2181 more tests

* INTG-2181 adding comments

* INTG-2181 more tests on API
  • Loading branch information
MickStanciu authored Apr 28, 2022
1 parent dd85b71 commit 2e940ec
Show file tree
Hide file tree
Showing 15 changed files with 314 additions and 334 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd_test
package configure_test

import (
"bytes"
Expand Down
44 changes: 44 additions & 0 deletions cmd/iauditor-exporter/cmd/export/export_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package export_test

import (
"github.com/SafetyCulture/iauditor-exporter/cmd/iauditor-exporter/cmd/export"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)

func TestPrintSchemaCmd(t *testing.T) {
res := export.PrintSchemaCmd()
require.NotNil(t, res)
assert.EqualValues(t, "schema", res.Use)
assert.EqualValues(t, "Print iAuditor table schemas", res.Short)
assert.EqualValues(t, "iauditor-exporter schema", res.Example)
}

func TestReportCmd(t *testing.T) {
res := export.ReportCmd()
require.NotNil(t, res)
assert.EqualValues(t, "report", res.Use)
assert.EqualValues(t, "Export inspection report", res.Short)
}

func TestInspectionJSONCmd(t *testing.T) {
res := export.InspectionJSONCmd()
require.NotNil(t, res)
assert.EqualValues(t, "inspection-json", res.Use)
assert.EqualValues(t, "Export iAuditor inspections to json files", res.Short)
}

func TestCSVCmd(t *testing.T) {
res := export.CSVCmd()
require.NotNil(t, res)
assert.EqualValues(t, "csv", res.Use)
assert.EqualValues(t, "Export iAuditor data to CSV files", res.Short)
}

func TestSQLCmd(t *testing.T) {
res := export.SQLCmd()
require.NotNil(t, res)
assert.EqualValues(t, "sql", res.Use)
assert.EqualValues(t, "Export iAuditor data to SQL database", res.Short)
}
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
module github.com/SafetyCulture/iauditor-exporter

go 1.17
go 1.18

require (
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
github.com/dghubble/sling v1.4.0
github.com/gocarina/gocsv v0.0.0-20220310154401-d4df709ca055
github.com/gofrs/uuid v4.2.0+incompatible
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.1.0 // indirect
github.com/gookit/color v1.5.0
github.com/hashicorp/go-version v1.4.0
github.com/jackc/pgx/v4 v4.16.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-sqlite3 v1.14.12 // indirect
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.11.0
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.7.1
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0
golang.org/x/text v0.3.7 // indirect
gopkg.in/h2non/gock.v1 v1.1.2
gorm.io/driver/mysql v1.3.3
gorm.io/driver/postgres v1.3.5
Expand All @@ -41,8 +31,9 @@ require (
github.com/denisenkom/go-mssqldb v0.12.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand All @@ -53,23 +44,32 @@ require (
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.11.0 // indirect
github.com/jackc/pgx/v4 v4.16.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-sqlite3 v1.14.12 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/objx v0.3.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
Loading

0 comments on commit 2e940ec

Please sign in to comment.