graphql-engine/cli/commands/commands_test.go
Vishnu Bharathi ebc01c2378 cli, ci: enables docker based tests
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: d7a53e512d296bdd4b2119bb1d0b89e30da7d476
2021-05-17 00:30:08 +00:00

41 lines
770 B
Go

package commands
import (
"io/ioutil"
"testing"
"github.com/hasura/graphql-engine/cli"
"gopkg.in/yaml.v2"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const (
defaultConfigFilename = "config.yaml"
)
func TestE2e(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "e2e testsuite")
}
// EditEndpoint in config
func editEndpointInConfig(configFilePath, endpoint string) {
var config cli.Config
b, err := ioutil.ReadFile(configFilePath)
Expect(err).ShouldNot(HaveOccurred())
err = yaml.Unmarshal(b, &config)
Expect(err).ShouldNot(HaveOccurred())
config.Endpoint = endpoint
b, err = yaml.Marshal(&config)
Expect(err).ShouldNot(HaveOccurred())
err = ioutil.WriteFile(configFilePath, b, 0655)
Expect(err).ShouldNot(HaveOccurred())
}