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