Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Dec 7, 2018
1 parent 287a92e commit 3e7f20f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/app/cmd/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,32 @@
package cmd

import (
"fmt"
"github.com/clivern/beaver/internal/pkg/utils"
"github.com/nbio/st"
"os"
"strings"
"testing"
)

// init setup stuff
func init() {
basePath := fmt.Sprintf("%s/src/github.com/clivern/beaver", os.Getenv("GOPATH"))
configFile := fmt.Sprintf("%s/%s", basePath, "config.test.json")

config := utils.Config{}
ok, err := config.Load(configFile)

if !ok || err != nil {
panic(err.Error())
}
config.Cache()
config.GinEnv()
if !strings.Contains(os.Getenv("LogPath"), basePath) {
os.Setenv("LogPath", fmt.Sprintf("%s/%s", basePath, os.Getenv("LogPath")))
}
}

// TestHealthStatus test cases
func TestHealthStatus(t *testing.T) {
ok, err := HealthStatus()
Expand Down

0 comments on commit 3e7f20f

Please sign in to comment.