mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
260d565e6e
* [cli] added urlPrefix, consoleMode * [cli] fix: down=all should throw error if down migration is missing * [cli] added tests for metadata
32 lines
696 B
Go
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)
|
|
}
|
|
}
|