mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
379b812674
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com> GitOrigin-RevId: d63e0452fdb97a8f6c4e921467fc2a1de50639a1
52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/hasura/graphql-engine/cli/internal/testutil"
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
. "github.com/onsi/gomega/gbytes"
|
|
. "github.com/onsi/gomega/gexec"
|
|
)
|
|
|
|
var _ = Describe("metadata_reload", func() {
|
|
|
|
var dirName string
|
|
var session *Session
|
|
var teardown func()
|
|
BeforeEach(func() {
|
|
dirName = testutil.RandDirName()
|
|
hgeEndPort, teardownHGE := testutil.StartHasura(GinkgoT(), testutil.HasuraVersion)
|
|
hgeEndpoint := fmt.Sprintf("http://0.0.0.0:%s", hgeEndPort)
|
|
testutil.RunCommandAndSucceed(testutil.CmdOpts{
|
|
Args: []string{"init", dirName},
|
|
})
|
|
editEndpointInConfig(filepath.Join(dirName, defaultConfigFilename), hgeEndpoint)
|
|
|
|
teardown = func() {
|
|
session.Kill()
|
|
os.RemoveAll(dirName)
|
|
teardownHGE()
|
|
}
|
|
})
|
|
|
|
AfterEach(func() {
|
|
teardown()
|
|
})
|
|
|
|
Context("metadata reload test", func() {
|
|
It("should reload metadata", func() {
|
|
session = testutil.Hasura(testutil.CmdOpts{
|
|
Args: []string{"metadata", "reload"},
|
|
WorkingDirectory: dirName,
|
|
})
|
|
want := `.*Metadata reloaded*.`
|
|
Eventually(session, 60*40).Should(Say(want))
|
|
Eventually(session, 60*40).Should(Exit(0))
|
|
})
|
|
})
|
|
})
|