@@ -24,30 +24,30 @@ type InitIntegrationTestSuite struct {
2424
2525func (suite * InitIntegrationTestSuite ) TestInit () {
2626 suite .OnlyRunForTags (tagsuite .Init , tagsuite .Critical )
27- suite .runInitTest (false , "python" , "python3" )
27+ suite .runInitTest (false , true , "python" , "python3" )
2828}
2929
3030func (suite * InitIntegrationTestSuite ) TestInit_Path () {
3131 suite .OnlyRunForTags (tagsuite .Init )
32- suite .runInitTest (true , "python" , "python3" )
32+ suite .runInitTest (true , false , "python" , "python3" )
3333}
3434
3535func (suite * InitIntegrationTestSuite ) TestInit_DisambiguatePython () {
3636 suite .OnlyRunForTags (tagsuite .Init )
37- suite .runInitTest (false , "python" , "python3" )
38- suite .
runInitTest (
false ,
"[email protected] " ,
"python3" )
39- suite .
runInitTest (
false ,
"[email protected] " ,
"python2" )
37+ suite .runInitTest (false , false , "python" , "python3" )
38+ suite .
runInitTest (
false ,
false , "[email protected] " ,
"python3" )
39+ suite .
runInitTest (
false ,
false , "[email protected] " ,
"python2" )
4040}
4141
4242func (suite * InitIntegrationTestSuite ) TestInit_PartialVersions () {
4343 suite .OnlyRunForTags (tagsuite .Init )
44- suite .
runInitTest (
false ,
"[email protected] " ,
"python3" )
45- suite .
runInitTest (
false ,
"[email protected] " ,
"python3" )
46- suite .runInitTest (false , "python@>=3" , "python3" )
47- suite .runInitTest (false , "python@2" , "python2" )
44+ suite .
runInitTest (
false ,
false , "[email protected] " ,
"python3" )
45+ suite .
runInitTest (
false ,
false , "[email protected] " ,
"python3" )
46+ suite .runInitTest (false , false , "python@>=3" , "python3" )
47+ suite .runInitTest (false , false , "python@2" , "python2" )
4848}
4949
50- func (suite * InitIntegrationTestSuite ) runInitTest (addPath bool , lang string , expectedConfigLanguage string , args ... string ) {
50+ func (suite * InitIntegrationTestSuite ) runInitTest (addPath bool , sourceRuntime bool , lang string , expectedConfigLanguage string , args ... string ) {
5151 ts := e2e .New (suite .T (), false )
5252 defer ts .Close ()
5353 ts .LoginAsPersistentUser ()
@@ -60,11 +60,20 @@ func (suite *InitIntegrationTestSuite) runInitTest(addPath bool, lang string, ex
6060 computedArgs = append (computedArgs , ts .Dirs .Work )
6161 }
6262
63+ env := []string {}
64+ if sourceRuntime {
65+ env = append (env , constants .DisableRuntime + "=false" )
66+ }
6367 // Run `state init`, creating the project.
64- cp := ts .Spawn (computedArgs ... )
68+ cp := ts .SpawnWithOpts (
69+ e2e .OptArgs (computedArgs ... ),
70+ e2e .OptAppendEnv (env ... ),
71+ )
6572 cp .Expect ("Initializing Project" )
66- cp .Expect ("Skipping runtime setup" )
67- cp .Expect (fmt .Sprintf ("Project '%s' has been successfully initialized" , namespace ))
73+ if ! sourceRuntime {
74+ cp .Expect ("Skipping runtime setup" )
75+ }
76+ cp .Expect (fmt .Sprintf ("Project '%s' has been successfully initialized" , namespace ), e2e .RuntimeSourcingTimeoutOpt )
6877 cp .ExpectExitCode (0 )
6978 ts .NotifyProjectCreated (e2e .PersistentUsername , pname .String ())
7079
0 commit comments