File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 7272 activate-environment : true
7373 enable-cache : true
7474
75+ - name : Set Python path for Windows
76+ if : runner.os == 'Windows'
77+ run : |
78+ echo "PYO3_PYTHON=${{ env.pythonLocation }}\python.exe" >> $GITHUB_ENV
79+
7580 - name : Run tests
7681 shell : bash
7782 env :
Original file line number Diff line number Diff line change @@ -281,7 +281,12 @@ mod tests {
281281 Ok ( ( ) )
282282 } ) ;
283283
284- match tokio:: time:: timeout ( Duration :: from_millis ( 500 ) , submit_task) . await {
284+ #[ cfg( windows) ]
285+ let timeout_ms = 1000 ;
286+ #[ cfg( not( windows) ) ]
287+ let timeout_ms = 500 ;
288+
289+ match tokio:: time:: timeout ( Duration :: from_millis ( timeout_ms) , submit_task) . await {
285290 Ok ( Ok ( ( ) ) ) => {
286291 println ! ( "Successfully submitted 33rd task" ) ;
287292 }
@@ -291,7 +296,11 @@ mod tests {
291296 ) ,
292297 }
293298
299+ #[ cfg( windows) ]
300+ sleep ( Duration :: from_millis ( 500 ) ) . await ;
301+ #[ cfg( not( windows) ) ]
294302 sleep ( Duration :: from_millis ( 200 ) ) . await ;
303+
295304 assert_eq ! ( counter. load( Ordering :: Relaxed ) , 33 ) ;
296305 }
297306
Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ mod tests {
297297 assert ! ( session. get_document( & url) . is_some( ) ) ;
298298
299299 // Should be queryable through database
300- let path = PathBuf :: from ( "/ test.py" ) ;
300+ let path = paths :: url_to_path ( & url ) . unwrap_or_else ( || PathBuf :: from ( "test.py" ) ) ;
301301 let file = session. get_or_create_file ( & path) ;
302302 let content = session. with_db ( |db| source_text ( db, file) . to_string ( ) ) ;
303303 assert_eq ! ( content, "print('hello')" ) ;
@@ -330,7 +330,7 @@ mod tests {
330330 assert_eq ! ( doc. version( ) , 2 ) ;
331331
332332 // Database should also see updated content
333- let path = PathBuf :: from ( "/ test.py" ) ;
333+ let path = paths :: url_to_path ( & url ) . unwrap_or_else ( || PathBuf :: from ( "test.py" ) ) ;
334334 let file = session. get_or_create_file ( & path) ;
335335 let content = session. with_db ( |db| source_text ( db, file) . to_string ( ) ) ;
336336 assert_eq ! ( content, "updated" ) ;
You can’t perform that action at this time.
0 commit comments