@@ -1192,15 +1192,46 @@ def test_scie_split_contents(tmpdir):
1192
1192
split_dir = tmpdir .join ("split" )
1193
1193
subprocess .check_call (args = [scie , split_dir ], env = make_env (SCIE = "split" ))
1194
1194
1195
- # TODO(John Sirois): When the 1.6.0 scie-jump is released, replace this check with:
1196
- # + Add is_exe(...) check.
1197
- # + Change is_script(...) check below to check_executable=True.
1198
- # + Execute the split PEX directly instead of via sys.executable below.
1199
- with open (os .path .join (split_dir , "lift.json" )) as fp :
1200
- assert {file ["name" ]: file for file in json .load (fp )["scie" ]["lift" ]["files" ]}[
1201
- "cowsay.pex"
1202
- ]["executable" ]
1203
-
1204
1195
split_pex = os .path .join (split_dir , "cowsay.pex" )
1205
- assert is_script (split_pex , check_executable = False )
1206
- assert b"| Moo! |" in subprocess .check_output (args = [sys .executable , split_pex , "Moo!" ])
1196
+ assert is_exe (split_pex )
1197
+ assert is_script (split_pex )
1198
+ assert b"| Moo! |" in subprocess .check_output (args = [split_pex , "Moo!" ])
1199
+
1200
+
1201
+ @skip_if_no_provider
1202
+ def test_scie_eager_no_ptex (tmpdir ):
1203
+ # type: (Tempdir) -> None
1204
+
1205
+ def assert_ptex (
1206
+ expect_included , # type: bool
1207
+ lazy , # type: bool
1208
+ ):
1209
+ # type: (...) -> None
1210
+
1211
+ run_pex_command (
1212
+ args = [
1213
+ "cowsay<6" ,
1214
+ "-c" ,
1215
+ "cowsay" ,
1216
+ "-o" ,
1217
+ tmpdir .join ("cowsay.pex" ),
1218
+ "--scie" ,
1219
+ "lazy" if lazy else "eager" ,
1220
+ ]
1221
+ ).assert_success ()
1222
+
1223
+ scie = tmpdir .join ("cowsay" )
1224
+ assert b"| Moo! |" in subprocess .check_output (args = [scie , "Moo!" ])
1225
+
1226
+ output = subprocess .check_output (args = [scie , "-n" ], env = make_env (SCIE = "split" )).decode (
1227
+ "utf-8"
1228
+ )
1229
+ assert "scie-jump" in output , output
1230
+ assert "pex" in output , output
1231
+ assert "lift.json" in output , output
1232
+
1233
+ assert (("pypy" if IS_PYPY else "cpython" ) in output ) != lazy , output
1234
+ assert ("ptex" in output ) == expect_included , output
1235
+
1236
+ assert_ptex (expect_included = False , lazy = False )
1237
+ assert_ptex (expect_included = True , lazy = True )
0 commit comments