File tree Expand file tree Collapse file tree 4 files changed +48
-9
lines changed Expand file tree Collapse file tree 4 files changed +48
-9
lines changed Original file line number Diff line number Diff line change 1515
1616jobs :
1717 node_tests :
18- # If continue-on-error is set to true then all the queued jobs/steps
19- # are executed regardless of failure
20- # However, the workflow is always marked as passed even if some job
21- # fails inside
22- continue-on-error : ${{ inputs.continue-on-error }}
2318 strategy :
19+ # fail-fast=false runs all the jobs in strategy matrix
20+ # irrespective of failures in a particular job, and marks
21+ # the entire job as failed even if one job has failed
22+ fail-fast : false
2423 matrix :
25- os : [ubuntu-latest, windows-latest]
24+ os : [ubuntu-latest, windows-latest, macos-latest ]
2625 runs-on : ${{ matrix.os }}
2726 defaults :
2827 run :
@@ -51,10 +50,10 @@ jobs:
5150 continue-on-error : ${{ inputs.continue-on-error }}
5251 strategy :
5352 matrix :
54- os : [ubuntu-latest, windows-latest]
53+ os : [ubuntu-latest, windows-latest, macos-latest ]
5554 python-version : ['3.7', '3.8', '3.9', '3.10']
5655 exclude :
57- - os : windows-latest
56+ - os : [ windows-latest]
5857 # Python 3.7 in Windows does not run successfully
5958 python-version : ' 3.7'
6059 runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2020-2022 The MathWorks, Inc.
2+
3+ import asyncio
4+ import os
5+ import sys
6+ import time
7+
8+ """This file launches an asynchrnous infinite loop.
9+ Used for testing matlab_proxy/util/__init__.py/get_child_processes
10+ """
11+
12+ process_no = int (sys .argv [1 ])
13+
14+ loop = asyncio .get_event_loop ()
15+
16+ # Runs infinite loop asynchronously
17+ async def inf_loop (process_no ):
18+ process_no += 1
19+ inf_loop_file_path = os .path .join (os .path .dirname (__file__ ), "inf_loop.py" )
20+ cmd = [f"python { inf_loop_file_path } { process_no } " ]
21+ _ = await asyncio .create_subprocess_shell (* cmd )
22+ while True :
23+ time .sleep (1 )
24+
25+
26+ # Allows only one python process
27+ if process_no < 2 :
28+ loop .run_until_complete (inf_loop (process_no ))
Original file line number Diff line number Diff line change @@ -510,6 +510,10 @@ def test_range_matlab_connector_ports():
510510 assert first_port + 1 == second_port
511511
512512
513+ @pytest .mark .skipif (
514+ system .is_windows () or system .is_mac (),
515+ reason = "xvfb is not meant for windows and mac machines" ,
516+ )
513517async def test_create_xvfb_process (loop ):
514518 """Test to check if more than 1 xvfb process can be created with -displayfd flag
515519
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2020-2022 The MathWorks, Inc.
2+
13import asyncio
4+ import os
25
36import psutil
47from matlab_proxy import util
@@ -45,7 +48,12 @@ def test_prettify():
4548async def test_get_child_processes (loop ):
4649 """Tests if child processes are returned"""
4750
48- cmd = ["python" ]
51+ # Python process exits before validating get_child_processes
52+ # in Mac machine, so an asynchronous infinite loop is launched as a
53+ # to keep it always running
54+ process_no = 1
55+ inf_path = os .path .join (os .path .dirname (__file__ ), "inf_loop.py" )
56+ cmd = [f"python { inf_path } { process_no } " ]
4957 proc = await asyncio .create_subprocess_shell (* cmd )
5058
5159 children = util .get_child_processes (proc )
You can’t perform that action at this time.
0 commit comments