Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ignite
GitHub Repository: ignite/cli
Path: blob/main/integration/doctor/doctor_test.go
1007 views
1
package doctor_test
2
3
import (
4
_ "embed"
5
"testing"
6
7
"github.com/rogpeppe/go-internal/gotooltest"
8
"github.com/rogpeppe/go-internal/testscript"
9
10
"github.com/ignite/cli/v29/ignite/config"
11
"github.com/ignite/cli/v29/ignite/pkg/xfilepath"
12
envtest "github.com/ignite/cli/v29/integration"
13
)
14
15
const envDoNotTrack = "DO_NOT_TRACK"
16
17
func TestDoctor(t *testing.T) {
18
// Ensure ignite binary is compiled
19
envtest.New(t)
20
// Prepare params
21
params := testscript.Params{
22
Setup: func(env *testscript.Env) error {
23
env.Vars = append(env.Vars,
24
envDoNotTrack+"=true",
25
// Pass ignite binary path
26
"IGNITE="+envtest.IgniteApp,
27
// Pass ignite config dir
28
// (testscript resets envs so even if envtest.New has properly set
29
// IGNT_CONFIG_DIR, we need to set it again)
30
"IGNT_CONFIG_DIR="+xfilepath.MustInvoke(config.DirPath),
31
)
32
return nil
33
},
34
Dir: "testdata",
35
}
36
// Add other setup for go environment
37
if err := gotooltest.Setup(&params); err != nil {
38
t.Fatal(err)
39
}
40
// Run all scripts from testdata
41
testscript.Run(t, params)
42
}
43
44