graphql-engine/cli/commands/metadata_export_test.go
Aravind Shankar 260d565e6e cli: tests for metadata commands (#18)
* [cli] added urlPrefix, consoleMode

* [cli] fix: down=all should throw error if down migration is missing

* [cli] added tests for metadata
2018-06-29 15:32:33 +05:30

32 lines
696 B
Go

package commands
import (
"testing"
"time"
"github.com/briandowns/spinner"
"github.com/hasura/graphql-engine/cli"
"github.com/sirupsen/logrus/hooks/test"
)
func testMetadataExport(t *testing.T, executionDir string, endpoint string) {
logger, _ := test.NewNullLogger()
opts := &metadataExportOptions{
EC: &cli.ExecutionContext{
Logger: logger,
Spinner: spinner.New(spinner.CharSets[7], 100*time.Millisecond),
ExecutionDirectory: executionDir,
Config: &cli.HasuraGraphQLConfig{
Endpoint: endpoint,
AccessKey: "",
},
},
actionType: "export",
}
err := opts.run()
if err != nil {
t.Fatalf("failed exporting metadata: %v", err)
}
}