mirror of
https://github.com/hasura/graphql-engine.git
synced 2025-01-05 22:34:22 +03:00
cli: fix tests failing in local dev environment (#4729)
This commit is contained in:
parent
daf098886b
commit
177556f441
@ -29,7 +29,7 @@ PID=$!
|
|||||||
wait_for_port 8080
|
wait_for_port 8080
|
||||||
|
|
||||||
# test cli
|
# test cli
|
||||||
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test
|
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" HASURA_GRAPHQL_TEST_CLI_EXT_MANIFEST_FILE_PATH="/build/_cli_ext_output/manifest-dev.yaml" make test
|
||||||
kill -s INT $PID
|
kill -s INT $PID
|
||||||
|
|
||||||
# start graphql-engine with admin secret
|
# start graphql-engine with admin secret
|
||||||
|
@ -77,7 +77,7 @@ type PluginInstallOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *PluginInstallOptions) Run() error {
|
func (o *PluginInstallOptions) Run() error {
|
||||||
plugin, err := ec.PluginsConfig.GetPlugin(o.Name, plugins.FetchOpts{
|
plugin, err := o.EC.PluginsConfig.GetPlugin(o.Name, plugins.FetchOpts{
|
||||||
ManifestFile: o.ManifestFile,
|
ManifestFile: o.ManifestFile,
|
||||||
Version: o.Version.Version,
|
Version: o.Version.Version,
|
||||||
})
|
})
|
||||||
|
@ -9,9 +9,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/hasura/graphql-engine/cli/commands"
|
||||||
|
|
||||||
"github.com/briandowns/spinner"
|
"github.com/briandowns/spinner"
|
||||||
"github.com/hasura/graphql-engine/cli"
|
"github.com/hasura/graphql-engine/cli"
|
||||||
"github.com/hasura/graphql-engine/cli/commands"
|
|
||||||
integrationtest "github.com/hasura/graphql-engine/cli/integration_test"
|
integrationtest "github.com/hasura/graphql-engine/cli/integration_test"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
@ -90,19 +91,6 @@ func TestCommands(t *testing.T) {
|
|||||||
integrationtest.TestPrepare(t, ec)
|
integrationtest.TestPrepare(t, ec)
|
||||||
})
|
})
|
||||||
|
|
||||||
skip(t)
|
|
||||||
t.Run("cli-ext-plugin-install", func(t *testing.T) {
|
|
||||||
installOpts := &commands.PluginInstallOptions{
|
|
||||||
EC: ec,
|
|
||||||
Name: cli.CLIExtPluginName,
|
|
||||||
ManifestFile: "/build/_cli_ext_output/manifest-dev.yaml",
|
|
||||||
}
|
|
||||||
err := installOpts.Run()
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unable to install %s plugin, got %v", cli.CLIExtPluginName, err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
skip(t)
|
skip(t)
|
||||||
// This will init the project dir
|
// This will init the project dir
|
||||||
t.Run("init command", func(t *testing.T) {
|
t.Run("init command", func(t *testing.T) {
|
||||||
@ -115,6 +103,21 @@ func TestCommands(t *testing.T) {
|
|||||||
integrationtest.TestValidate(t, ec)
|
integrationtest.TestValidate(t, ec)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
skip(t)
|
||||||
|
if cliExtManifestFilePath := os.Getenv("HASURA_GRAPHQL_TEST_CLI_EXT_MANIFEST_FILE_PATH"); cliExtManifestFilePath != "" {
|
||||||
|
t.Run("cli-ext-plugin-install", func(t *testing.T) {
|
||||||
|
installOpts := &commands.PluginInstallOptions{
|
||||||
|
EC: ec,
|
||||||
|
Name: cli.CLIExtPluginName,
|
||||||
|
ManifestFile: cliExtManifestFilePath,
|
||||||
|
}
|
||||||
|
err := installOpts.Run()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unable to install %s plugin, got %v", cli.CLIExtPluginName, err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
skip(t)
|
skip(t)
|
||||||
t.Run("console command", func(t *testing.T) {
|
t.Run("console command", func(t *testing.T) {
|
||||||
v2.TestConsoleCmd(t, ec)
|
v2.TestConsoleCmd(t, ec)
|
||||||
|
Loading…
Reference in New Issue
Block a user