From a7a8a482ab051919083cecd2b9102653972318d8 Mon Sep 17 00:00:00 2001 From: lash Date: Fri, 10 Jan 2025 12:03:37 +0000 Subject: [PATCH] Rehabilitate go test running --- cmd/admin/commands/seed.go | 2 +- cmd/admin/main.go | 2 +- go.mod | 6 +++--- go.sum | 6 ++++-- handlers/base.go | 16 ++++++++++++++-- menutraversal_test/menu_traversal_test.go | 4 ++-- testutil/engine.go | 4 ++-- testutil/testtag/offlinetest.go | 2 +- 8 files changed, 28 insertions(+), 14 deletions(-) diff --git a/cmd/admin/commands/seed.go b/cmd/admin/commands/seed.go index 25db7cc..41d105a 100644 --- a/cmd/admin/commands/seed.go +++ b/cmd/admin/commands/seed.go @@ -6,7 +6,7 @@ import ( "os" "git.defalsify.org/vise.git/logging" - "git.grassecon.net/grassrootseconomics/visedriver/internal/utils" + "git.grassecon.net/grassrootseconomics/visedriver/utils" ) var ( diff --git a/cmd/admin/main.go b/cmd/admin/main.go index 6f780d2..40c1247 100644 --- a/cmd/admin/main.go +++ b/cmd/admin/main.go @@ -4,7 +4,7 @@ import ( "context" "log" - "git.grassecon.net/grassrootseconomics/visedriver/devtools/admin/commands" + "git.grassecon.net/grassrootseconomics/visedriver/cmd/admin/commands" ) func main() { diff --git a/go.mod b/go.mod index d614e1b..b121a0d 100644 --- a/go.mod +++ b/go.mod @@ -8,15 +8,14 @@ require ( github.com/gofrs/uuid v4.4.0+incompatible github.com/grassrootseconomics/eth-custodial v1.3.0-beta github.com/grassrootseconomics/ussd-data-service v1.2.0-beta + github.com/jackc/pgx/v5 v5.7.1 github.com/joho/godotenv v1.5.1 github.com/peteole/testdata-loader v0.3.0 github.com/stretchr/testify v1.9.0 golang.org/x/crypto v0.27.0 - gopkg.in/leonelquinteros/gotext.v1 v1.3.1 ) require ( - github.com/alecthomas/participle/v2 v2.0.0 // indirect github.com/alecthomas/repr v0.2.0 // indirect github.com/barbashov/iso639-3 v0.0.0-20211020172741-1f4ffb2d8d1c // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -25,7 +24,6 @@ require ( github.com/hexops/gotextdiff v1.0.3 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.7.1 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/kinako v0.0.0-20170717041458-332c0a7e205a // indirect @@ -34,6 +32,8 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.18.0 // indirect + gopkg.in/leonelquinteros/gotext.v1 v1.3.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 6bef621..0456122 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ git.defalsify.org/vise.git v0.2.3-0.20250103172917-3e190a44568d h1:bPAOVZOX4frSG git.defalsify.org/vise.git v0.2.3-0.20250103172917-3e190a44568d/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g= -github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y= github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/barbashov/iso639-3 v0.0.0-20211020172741-1f4ffb2d8d1c h1:H9Nm+I7Cg/YVPpEV1RzU3Wq2pjamPc/UtHDgItcb7lE= @@ -62,6 +60,10 @@ golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/handlers/base.go b/handlers/base.go index 12df12f..25c2d8a 100644 --- a/handlers/base.go +++ b/handlers/base.go @@ -9,7 +9,6 @@ import ( "git.grassecon.net/grassrootseconomics/visedriver/request" "git.grassecon.net/grassrootseconomics/visedriver/errors" - "git.grassecon.net/grassrootseconomics/visedriver/internal/handlers/application" "git.grassecon.net/grassrootseconomics/visedriver/storage" ) @@ -17,11 +16,24 @@ var ( logg = logging.NewVanilla().WithDomain("handlers") ) +type Handlers struct { + pe *persist.Persister + st *state.State + ca cache.Memory + userdataStore common.DataStore + adminstore *utils.AdminStore + flagManager *asm.FlagParser + accountService remote.AccountServiceInterface + prefixDb dbstorage.PrefixDb + profile *models.Profile + ReplaceSeparatorFunc func(string) string +} + type BaseSessionHandler struct { cfgTemplate engine.Config rp request.RequestParser rs resource.Resource - hn *application.Handlers + hn *Handlers provider storage.StorageProvider } diff --git a/menutraversal_test/menu_traversal_test.go b/menutraversal_test/menu_traversal_test.go index 92a839a..edc5c0c 100644 --- a/menutraversal_test/menu_traversal_test.go +++ b/menutraversal_test/menu_traversal_test.go @@ -9,8 +9,8 @@ import ( "regexp" "testing" - "git.grassecon.net/grassrootseconomics/visedriver/internal/testutil" - "git.grassecon.net/grassrootseconomics/visedriver/internal/testutil/driver" + "git.grassecon.net/grassrootseconomics/visedriver/testutil" + "git.grassecon.net/grassrootseconomics/visedriver/testutil/driver" "github.com/gofrs/uuid" ) diff --git a/testutil/engine.go b/testutil/engine.go index 310b4a0..7d68f8f 100644 --- a/testutil/engine.go +++ b/testutil/engine.go @@ -18,8 +18,8 @@ import ( "git.grassecon.net/grassrootseconomics/visedriver/config" "git.grassecon.net/grassrootseconomics/visedriver/handlers" "git.grassecon.net/grassrootseconomics/visedriver/storage" - "git.grassecon.net/grassrootseconomics/visedriver/internal/testutil/testservice" - "git.grassecon.net/grassrootseconomics/visedriver/internal/testutil/testtag" + "git.grassecon.net/grassrootseconomics/visedriver/testutil/testservice" + "git.grassecon.net/grassrootseconomics/visedriver/testutil/testtag" testdataloader "github.com/peteole/testdata-loader" "git.grassecon.net/grassrootseconomics/visedriver/remote" ) diff --git a/testutil/testtag/offlinetest.go b/testutil/testtag/offlinetest.go index e8119b8..cfaa5e6 100644 --- a/testutil/testtag/offlinetest.go +++ b/testutil/testtag/offlinetest.go @@ -4,7 +4,7 @@ package testtag import ( "git.grassecon.net/grassrootseconomics/visedriver/remote" - accountservice "git.grassecon.net/grassrootseconomics/visedriver/internal/testutil/testservice" + accountservice "git.grassecon.net/grassrootseconomics/visedriver/testutil/testservice" ) var (