mirror of
https://github.com/hasura/graphql-engine.git
synced 2025-01-07 08:13:18 +03:00
379b812674
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com> GitOrigin-RevId: d63e0452fdb97a8f6c4e921467fc2a1de50639a1
46 lines
901 B
Go
46 lines
901 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/hasura/graphql-engine/cli"
|
|
"github.com/hasura/graphql-engine/cli/internal/testutil"
|
|
"gopkg.in/yaml.v2"
|
|
"io/ioutil"
|
|
"testing"
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
const (
|
|
defaultConfigFilename = "config.yaml"
|
|
)
|
|
|
|
func TestE2e(t *testing.T) {
|
|
BeforeSuite(func() {
|
|
if testutil.SkipDockerTests {
|
|
t.Skip()
|
|
}
|
|
})
|
|
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())
|
|
|
|
}
|