mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
d8198a8bad
- remove `HASURA_TEST_CLI_HGE_DOCKER_TAG` & `HASURA_TEST_CLI_HGE_DOCKER_REPO` env variables - add `HASURA_TEST_CLI_HGE_DOCKER_IMAGE` environment variable to configure hge image used in tests - add template test project directories - add helper functions to manipulate the template projects in individual tests - add config v2 tests Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com> GitOrigin-RevId: 009a74c042861ff0a8dec2b06002e55de3a8a629
47 lines
1.2 KiB
Go
47 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/gexec"
|
|
)
|
|
|
|
var _ = Describe("hasura metadata inconsistency status", func() {
|
|
|
|
var dirName string
|
|
var teardown func()
|
|
BeforeEach(func() {
|
|
dirName = testutil.RandDirName()
|
|
hgeEndPort, teardownHGE := testutil.StartHasura(GinkgoT(), testutil.HasuraDockerImage)
|
|
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() {
|
|
os.RemoveAll(dirName)
|
|
teardownHGE()
|
|
}
|
|
})
|
|
|
|
AfterEach(func() { teardown() })
|
|
|
|
Context("metadata inconsistency status test", func() {
|
|
It("Checks if the metadata is inconsistent or not", func() {
|
|
session := testutil.Hasura(testutil.CmdOpts{
|
|
Args: []string{"metadata", "inconsistency", "status"},
|
|
WorkingDirectory: dirName,
|
|
})
|
|
want := `metadata is consistent`
|
|
Eventually(session, 60*40).Should(Exit(0))
|
|
Eventually(session.Wait().Err.Contents()).Should(ContainSubstring(want))
|
|
})
|
|
})
|
|
})
|