mukan-ignite/integration/doctor/doctor_test.go
Mukan Erkin Törük c32551b6f7
Some checks failed
Docs Deploy / build_and_deploy (push) Has been cancelled
Generate Docs / cli (push) Has been cancelled
Generate Config Doc / cli (push) Has been cancelled
Go formatting / go-formatting (push) Has been cancelled
Check links / markdown-link-check (push) Has been cancelled
Integration / pre-test (push) Has been cancelled
Integration / test on (push) Has been cancelled
Integration / status (push) Has been cancelled
Lint / Lint Go code (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
refactor: replace all github.com upstream refs with git.cw.tr/mukan-network
2026-05-11 03:36:24 +03:00

43 lines
1.1 KiB
Go

package doctor_test
import (
_ "embed"
"testing"
"github.com/rogpeppe/go-internal/gotooltest"
"github.com/rogpeppe/go-internal/testscript"
"git.cw.tr/mukan-network/mukan-ignite/ignite/config"
"git.cw.tr/mukan-network/mukan-ignite/ignite/pkg/env"
"git.cw.tr/mukan-network/mukan-ignite/ignite/pkg/xfilepath"
envtest "git.cw.tr/mukan-network/mukan-ignite/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(&params); err != nil {
t.Fatal(err)
}
// Run all scripts from testdata
testscript.Run(t, params)
}