mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
ebc01c2378
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com> GitOrigin-RevId: d7a53e512d296bdd4b2119bb1d0b89e30da7d476
41 lines
770 B
Go
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())
|
|
|
|
}
|