Skip to content

Commit

Permalink
add test setup helper for env
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu committed Dec 16, 2024
1 parent 1670e68 commit 5a7f62d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions backend/internal/tests/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package tests

import (
"KonferCA/SPUR/common"
"os"
)

/*
Sets up all the any environment variables that the application needs to
properly boot up and run.
*/
func setupEnv() {
os.Setenv("APP_ENV", common.TEST_ENV)
// this is not a real bucket and is just here to allow
// the stogare.NewStorage to proceed
os.Setenv("AWS_S3_BUCKET", "test-bucket")
os.Setenv("DB_HOST", "localhost")
os.Setenv("DB_PORT", "5432")
os.Setenv("DB_USER", "postgres")
os.Setenv("DB_PASSWORD", "postgres")
os.Setenv("DB_NAME", "postgres")
os.Setenv("DB_SSLMODE", "disable")
}

0 comments on commit 5a7f62d

Please sign in to comment.