mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
cli(test): fix cli init test to use initDir from subtest group (#4490)
This commit is contained in:
parent
0513fd39bf
commit
2a693be553
@ -29,7 +29,7 @@ PID=$!
|
||||
wait_for_port 8080
|
||||
|
||||
# test cli
|
||||
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" TEST_TAGS="test_plugins" make test
|
||||
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test
|
||||
kill -s INT $PID
|
||||
|
||||
# start graphql-engine with admin secret
|
||||
|
@ -1,21 +1,13 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hasura/graphql-engine/cli"
|
||||
"github.com/hasura/graphql-engine/cli/commands"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
}
|
||||
|
||||
func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
||||
tt := []struct {
|
||||
name string
|
||||
@ -27,7 +19,7 @@ func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
||||
Version: cli.V1,
|
||||
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
||||
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
||||
InitDir: filepath.Join(os.TempDir(), "hasura-cli-test-"+strconv.Itoa(rand.Intn(1000))),
|
||||
InitDir: initDir,
|
||||
}, nil},
|
||||
}
|
||||
|
||||
|
@ -1,21 +1,13 @@
|
||||
package v2
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hasura/graphql-engine/cli"
|
||||
"github.com/hasura/graphql-engine/cli/commands"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
}
|
||||
|
||||
func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
||||
tt := []struct {
|
||||
name string
|
||||
@ -27,7 +19,7 @@ func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
||||
Version: cli.V2,
|
||||
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
||||
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
||||
InitDir: filepath.Join(os.TempDir(), "hasura-cli-test-"+strconv.Itoa(rand.Intn(1000))),
|
||||
InitDir: initDir,
|
||||
}, nil},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user