forked from cerc-io/ipld-eth-server
Remove test and travis deps on private dev network
This commit is contained in:
parent
e96066bc83
commit
88210e436a
@ -12,15 +12,10 @@ go_import_path: github.com/vulcanize/vulcanizedb
|
||||
before_install:
|
||||
# ginkgo golint dep migrate
|
||||
- make installtools
|
||||
# geth
|
||||
- wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.8.0-5f540757.tar.gz
|
||||
- tar -xzf geth-linux-amd64-1.8.0-5f540757.tar.gz
|
||||
- sudo cp geth-linux-amd64-1.8.0-5f540757/geth /usr/local/bin
|
||||
|
||||
before_script:
|
||||
- sudo -u postgres createdb vulcanize_private
|
||||
- make migrate HOST_NAME=localhost NAME=vulcanize_private PORT=5432
|
||||
- nohup make startprivate </dev/null &
|
||||
|
||||
script:
|
||||
- make test
|
||||
|
@ -1,24 +1,38 @@
|
||||
package config_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var vulcanizeConfig = []byte(`
|
||||
[database]
|
||||
name = "dbname"
|
||||
hostname = "localhost"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "IPCPATH/geth.ipc"
|
||||
`)
|
||||
|
||||
var _ = Describe("Loading the config", func() {
|
||||
|
||||
It("reads the private config using the environment", func() {
|
||||
testConfig := viper.New()
|
||||
testConfig.SetConfigName("private")
|
||||
testConfig.AddConfigPath("$GOPATH/src/github.com/vulcanize/vulcanizedb/environments/")
|
||||
err := testConfig.ReadInConfig()
|
||||
viper.SetConfigName("config")
|
||||
viper.AddConfigPath("$GOPATH/src/github.com/vulcanize/vulcanizedb/environments/")
|
||||
Expect(viper.Get("client.ipcpath")).To(BeNil())
|
||||
|
||||
testConfig := viper.New()
|
||||
testConfig.SetConfigType("toml")
|
||||
err := testConfig.ReadConfig(bytes.NewBuffer(vulcanizeConfig))
|
||||
Expect(err).To(BeNil())
|
||||
Expect(testConfig.Get("database.hostname")).To(Equal("localhost"))
|
||||
Expect(testConfig.Get("database.name")).To(Equal("vulcanize_private"))
|
||||
Expect(testConfig.Get("database.name")).To(Equal("dbname"))
|
||||
Expect(testConfig.Get("database.port")).To(Equal(int64(5432)))
|
||||
Expect(testConfig.Get("client.ipcpath")).To(Equal("test_data_dir/geth.ipc"))
|
||||
Expect(testConfig.Get("client.ipcpath")).To(Equal("IPCPATH/geth.ipc"))
|
||||
})
|
||||
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user