Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package doctor_test
|
|
|
|
import (
|
|
_ "embed"
|
|
"testing"
|
|
|
|
"github.com/rogpeppe/go-internal/gotooltest"
|
|
"github.com/rogpeppe/go-internal/testscript"
|
|
|
|
"github.com/ignite/cli/v29/ignite/config"
|
|
"github.com/ignite/cli/v29/ignite/pkg/env"
|
|
"github.com/ignite/cli/v29/ignite/pkg/xfilepath"
|
|
envtest "github.com/ignite/cli/v29/integration"
|
|
)
|
|
|
|
const envDoNotTrack = "DO_NOT_TRACK"
|
|
|
|
func TestDoctor(t *testing.T) {
|
|
// Ensure ignite binary is compiled
|
|
envtest.New(t)
|
|
// Prepare params
|
|
params := testscript.Params{
|
|
Setup: func(testEnv *testscript.Env) error {
|
|
testEnv.Vars = append(testEnv.Vars,
|
|
envDoNotTrack+"=true",
|
|
// Pass ignite binary path
|
|
"IGNITE="+envtest.IgniteApp,
|
|
// Pass ignite config dir
|
|
// (testscript resets envs so even if envtest.New has properly set
|
|
// IGNT_CONFIG_DIR, we need to set it again)
|
|
env.ConfigDirEnvVar+"="+xfilepath.MustInvoke(config.DirPath),
|
|
)
|
|
return nil
|
|
},
|
|
Dir: "testdata",
|
|
}
|
|
// Add other setup for go environment
|
|
if err := gotooltest.Setup(¶ms); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
// Run all scripts from testdata
|
|
testscript.Run(t, params)
|
|
}
|