graphql-engine/cli/commands/metadata_export_test.go
Aravind Shankar 6a20784b95 move metadata.yml file inside migrations folder, fix #122 (#125)
metadata.yaml will be present inside migrations folder
2018-07-12 18:22:25 +05:30

34 lines
740 B
Go

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