diff --git a/tests/go.sum b/tests/go.sum index 5d00832a..9507fd4a 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -52,6 +52,7 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/h2non/filetype v1.0.8 h1:le8gpf+FQA0/DlDABbtisA1KiTS0Xi+YSC/E8yY3Y14= github.com/h2non/filetype v1.0.8/go.mod h1:isekKqOuhMj+s/7r3rIeTErIRy4Rub5uBWHfvMusLMU= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0 h1:DUwgMQuuPnS0rhMXenUtZpqZqrR/30NWY+qQvTpSvEs= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -65,6 +66,7 @@ github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bY github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= diff --git a/tests/helper.go b/tests/helper.go index c7c8808b..df60bda3 100644 --- a/tests/helper.go +++ b/tests/helper.go @@ -78,6 +78,8 @@ func notEquals(tb testing.TB, exp, act interface{}) { } func setupTestCase(t *testing.T) func(t *testing.T) { + setupInfrastructure() + t.Log("setup test case..clearing all database tables") err := db.ClearAll() diff --git a/tests/tests.go b/tests/tests.go index bf838578..a596546d 100644 --- a/tests/tests.go +++ b/tests/tests.go @@ -18,11 +18,11 @@ var X_CLIENT_SECRET string var DB_PORT string = "5432" var REDIS_ADDRESS string = ":6379" -func init() { - unverifiedDonationsDir := flag.String("unverified_donations_dir", "../unverified_donations/", "Path to unverified donations directory") - donationsDir := flag.String("donations_dir", "../donations/", "Path to donations directory") - flag.Parse() +var unverifiedDonationsDir = flag.String("unverified_donations_dir", "../unverified_donations/", "Path to unverified donations directory") +var donationsDir = flag.String("donations_dir", "../donations/", "Path to donations directory") + +func setupInfrastructure() { UNVERIFIED_DONATIONS_DIR = *unverifiedDonationsDir DONATIONS_DIR = *donationsDir