mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +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
|
wait_for_port 8080
|
||||||
|
|
||||||
# test cli
|
# 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
|
kill -s INT $PID
|
||||||
|
|
||||||
# start graphql-engine with admin secret
|
# start graphql-engine with admin secret
|
||||||
|
@ -1,21 +1,13 @@
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/hasura/graphql-engine/cli"
|
"github.com/hasura/graphql-engine/cli"
|
||||||
"github.com/hasura/graphql-engine/cli/commands"
|
"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) {
|
func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
||||||
tt := []struct {
|
tt := []struct {
|
||||||
name string
|
name string
|
||||||
@ -27,7 +19,7 @@ func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
|||||||
Version: cli.V1,
|
Version: cli.V1,
|
||||||
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
||||||
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
||||||
InitDir: filepath.Join(os.TempDir(), "hasura-cli-test-"+strconv.Itoa(rand.Intn(1000))),
|
InitDir: initDir,
|
||||||
}, nil},
|
}, nil},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,21 +1,13 @@
|
|||||||
package v2
|
package v2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/hasura/graphql-engine/cli"
|
"github.com/hasura/graphql-engine/cli"
|
||||||
"github.com/hasura/graphql-engine/cli/commands"
|
"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) {
|
func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
||||||
tt := []struct {
|
tt := []struct {
|
||||||
name string
|
name string
|
||||||
@ -27,7 +19,7 @@ func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
|||||||
Version: cli.V2,
|
Version: cli.V2,
|
||||||
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
||||||
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
||||||
InitDir: filepath.Join(os.TempDir(), "hasura-cli-test-"+strconv.Itoa(rand.Intn(1000))),
|
InitDir: initDir,
|
||||||
}, nil},
|
}, nil},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user