@@ -395,6 +395,39 @@ func (suite *CheckoutIntegrationTestSuite) TestCheckoutFromArchive() {
395
395
cp .ExpectExitCode (0 )
396
396
}
397
397
398
+ func (suite * CheckoutIntegrationTestSuite ) TestCheckoutPortable () {
399
+ suite .OnlyRunForTags (tagsuite .Checkout )
400
+ ts := e2e .New (suite .T (), false )
401
+ defer ts .Close ()
402
+
403
+ // Checkout a working runtime.
404
+ cp := ts .Spawn ("checkout" , "ActiveState-CLI/small-python#fb513fe6-b9f4-4c54-adf3-8a7833b290f3" , "." , "--portable" )
405
+ cp .Expect ("Checked out project" )
406
+ cp .ExpectExitCode (0 )
407
+
408
+ // Remove the artifact depot.
409
+ suite .Require ().NoError (os .RemoveAll (filepath .Join (ts .Dirs .Cache , "depot" )))
410
+
411
+ // Verify the runtime still works because its contents are copies, not links.
412
+ proj , err := project .FromPath (ts .Dirs .Work )
413
+ suite .Require ().NoError (err )
414
+ targetDir := filepath .Join (ts .Dirs .Cache , runtime_helpers .DirNameFromProjectDir (proj .Dir ()))
415
+ pythonExe := filepath .Join (rt .ExecutorsPath (targetDir ), "python3" + osutils .ExeExtension )
416
+ cp = ts .SpawnCmd (pythonExe , "--version" )
417
+ cp .Expect ("Python 3" )
418
+ cp .ExpectExitCode (0 )
419
+
420
+ // Verify there are no symlinks in the runtime.
421
+ files , err := fileutils .ListDir (targetDir , true )
422
+ suite .Require ().NoError (err )
423
+ for _ , file := range files {
424
+ path := filepath .Join (targetDir , file .Name ())
425
+ resolvedPath , err := fileutils .ResolvePath (path )
426
+ suite .Require ().NoError (err )
427
+ suite .Assert ().NotContains (resolvedPath , "depot" , "runtime file '%s' should not be linked to the depot" , file .Name ())
428
+ }
429
+ }
430
+
398
431
func TestCheckoutIntegrationTestSuite (t * testing.T ) {
399
432
suite .Run (t , new (CheckoutIntegrationTestSuite ))
400
433
}
0 commit comments