postgres-switch-for-tests #255

Merged
lash merged 15 commits from postgres-switch-for-tests into master 2025-01-10 12:07:07 +01:00
6 changed files with 27 additions and 18 deletions
Showing only changes of commit 79de0a9092 - Show all commits

View File

@ -14,6 +14,7 @@ import (
"git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource"
testdataloader "github.com/peteole/testdata-loader"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/initializers"
@ -26,13 +27,14 @@ import (
var (
logg = logging.NewVanilla().WithDomain("AfricasTalking").WithContextKey("at-session-id")
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join("services", "registration")
build = "dev"
menuSeparator = ": "
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
}
func main() {
config.LoadConfig()

View File

@ -12,6 +12,7 @@ import (
"git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource"
testdataloader "github.com/peteole/testdata-loader"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/initializers"
@ -22,12 +23,13 @@ import (
var (
logg = logging.NewVanilla()
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join("services", "registration")
menuSeparator = ": "
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
}
type asyncRequestParser struct {

View File

@ -14,6 +14,7 @@ import (
"git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource"
testdataloader "github.com/peteole/testdata-loader"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/initializers"
@ -24,13 +25,14 @@ import (
)
var (
logg = logging.NewVanilla()
scriptDir = path.Join("services", "registration")
logg = logging.NewVanilla()
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join("services", "registration")
menuSeparator = ": "
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
}
func main() {

View File

@ -15,16 +15,18 @@ import (
"git.grassecon.net/urdt/ussd/internal/handlers"
"git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/remote"
testdataloader "github.com/peteole/testdata-loader"
)
var (
logg = logging.NewVanilla()
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join("services", "registration")
menuSeparator = ": "
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
}
Alfred-mk marked this conversation as resolved Outdated
Outdated
Review

I don't think we want to use the testdataloader package in main. Let's remove the basedir, and if needed using a different env/config file should be a matter of switches.

I don't think we want to use the `testdataloader` package in main. Let's remove the basedir, and if needed using a different env/config file should be a matter of switches.
func main() {

View File

@ -9,22 +9,23 @@ import (
"path"
"git.defalsify.org/vise.git/logging"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/initializers"
"git.grassecon.net/urdt/ussd/common"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/initializers"
"git.grassecon.net/urdt/ussd/internal/storage"
testdataloader "github.com/peteole/testdata-loader"
)
var (
logg = logging.NewVanilla()
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join("services", "registration")
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
}
func main() {
config.LoadConfig()
@ -75,5 +76,4 @@ func main() {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(1)
}
}

View File

@ -7,24 +7,25 @@ import (
"os"
"path"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/initializers"
"git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/debug"
"git.defalsify.org/vise.git/db"
"git.defalsify.org/vise.git/logging"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/debug"
"git.grassecon.net/urdt/ussd/initializers"
"git.grassecon.net/urdt/ussd/internal/storage"
testdataloader "github.com/peteole/testdata-loader"
)
var (
logg = logging.NewVanilla()
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join("services", "registration")
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
}
func main() {
config.LoadConfig()