Make env variables required
This commit is contained in:
parent
51030ac162
commit
ccb34d4452
3 changed files with 8 additions and 5 deletions
|
@ -106,6 +106,9 @@ func (s *Server) Initialise(fillWorld bool) (err error) {
|
||||||
s.sync.Add(1)
|
s.sync.Add(1)
|
||||||
|
|
||||||
// Connect to the accountant
|
// Connect to the accountant
|
||||||
|
if len(accountantAddress) == 0 {
|
||||||
|
log.Fatal("must set ACCOUNTANT_ADDRESS")
|
||||||
|
}
|
||||||
log.Printf("Dialing accountant on %s\n", accountantAddress)
|
log.Printf("Dialing accountant on %s\n", accountantAddress)
|
||||||
s.clientConn, err = grpc.Dial(accountantAddress, grpc.WithInsecure())
|
s.clientConn, err = grpc.Dial(accountantAddress, grpc.WithInsecure())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -35,6 +35,10 @@ func InnerMain() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(address) == 0 {
|
||||||
|
log.Fatalf("Must set HOST_ADDRESS")
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("Initialising version %s...\n", version.Version)
|
log.Printf("Initialising version %s...\n", version.Version)
|
||||||
|
|
||||||
// Set the persistence path
|
// Set the persistence path
|
||||||
|
|
|
@ -12,15 +12,11 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
defaultAddress = "localhost:8080"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Test_InnerMain(t *testing.T) {
|
func Test_InnerMain(t *testing.T) {
|
||||||
|
|
||||||
var address = os.Getenv("ROVE_SERVER_ADDRESS")
|
var address = os.Getenv("ROVE_SERVER_ADDRESS")
|
||||||
if len(address) == 0 {
|
if len(address) == 0 {
|
||||||
address = defaultAddress
|
log.Fatal("Must set ROVE_SERVER_ADDRESS")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the flags to act locally and use a temporary file
|
// Set up the flags to act locally and use a temporary file
|
||||||
|
|
Loading…
Add table
Reference in a new issue