11import { existsSync , writeFileSync } from 'node:fs' ;
2+ import { rm } from 'node:fs/promises' ;
23
34import { loadJsonFileSync } from 'load-json-file' ;
45
@@ -26,14 +27,19 @@ describe('Python support [python]', () => {
2627 await afterAllCalls ( ) ;
2728 } ) ;
2829
29- it ( 'Python templates work [python]' , async ( ) => {
30+ it ( 'Python templates work [python]' , { timeout : 120_000 } , async ( ) => {
3031 const pythonVersion = detectPythonVersion ( '.' ) ;
3132 // Don't fail this test when Python is not installed (it will be installed in the right CI workflow)
3233 if ( ! pythonVersion && ! process . env . CI ) {
3334 console . log ( 'Skipping Python template test since Python is not installed' ) ;
3435 return ;
3536 }
3637
38+ if ( existsSync ( tmpPath ) ) {
39+ // Remove the tmp path if it exists
40+ await rm ( tmpPath , { recursive : true , force : true } ) ;
41+ }
42+
3743 await CreateCommand . run ( [ actorName , '--template' , PYTHON_START_TEMPLATE_ID ] , import . meta. url ) ;
3844
3945 // Check file structure
@@ -54,8 +60,11 @@ async def main():
5460 writeFileSync ( joinPath ( 'src' , 'main.py' ) , actorCode , { flag : 'w' } ) ;
5561
5662 toggleCwdBetweenFullAndParentPath ( ) ;
63+
5764 await RunCommand . run ( [ ] , import . meta. url ) ;
5865
66+ console . log ( 'ran' ) ;
67+
5968 // Check Actor output
6069 const actorOutputPath = joinPath ( getLocalKeyValueStorePath ( ) , 'OUTPUT.json' ) ;
6170 const actorOutput = loadJsonFileSync ( actorOutputPath ) ;
0 commit comments