Skip to content

Commit e2e4b07

Browse files
Tanmay DasPrabhakar Kumar
authored andcommitted
Update MATLAB launch command in the presence of MLM_LICENSE_FILE to use licmode as file. This prioritizes MLM_LICENSE_FILE inputs irrespective of whether MATLAB contains other license information.
1 parent ba026ec commit e2e4b07

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

.github/workflows/run-tests-feature.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ jobs:
1717
# so run number needs to be hardcoded
1818
call-run-tests-r000:
1919
uses: ./.github/workflows/run-tests.yml
20-
with:
21-
continue-on-error: true
2220
call-run-tests-r001:
2321
uses: ./.github/workflows/run-tests.yml
24-
with:
25-
continue-on-error: true
2622
call-run-tests-r002:
27-
uses: ./.github/workflows/run-tests.yml
28-
with:
29-
continue-on-error: true
23+
uses: ./.github/workflows/run-tests.yml

.github/workflows/run-tests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ on:
77
# Reusable workflow
88
# Trigger on workflow call
99
workflow_call:
10-
inputs:
11-
continue-on-error:
12-
required: false
13-
default: false
14-
type: boolean
1510

1611
jobs:
1712
node_tests:
@@ -47,13 +42,16 @@ jobs:
4742
run: npm test
4843

4944
python_tests:
50-
continue-on-error: ${{ inputs.continue-on-error }}
5145
strategy:
46+
# fail-fast=false runs all the jobs in strategy matrix
47+
# irrespective of failures in a particular job, and marks
48+
# the entire job as failed even if one job has failed
49+
fail-fast: false
5250
matrix:
5351
os: [ubuntu-latest, windows-latest, macos-latest]
5452
python-version: ['3.7', '3.8', '3.9', '3.10']
5553
exclude:
56-
- os: [windows-latest]
54+
- os: windows-latest
5755
# Python 3.7 in Windows does not run successfully
5856
python-version: '3.7'
5957
runs-on: ${{ matrix.os }}

matlab_proxy/settings.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@ def get(config_name=matlab_proxy.get_default_config_name(), dev=False):
143143

144144
mwi_auth_token = token_auth.generate_mwi_auth_token()
145145

146+
# MATLAB Proxy gives precedence to the licensing information conveyed
147+
# by the user. If MLM_LICENSE_FILE is set, it should be prioritised over
148+
# other ways of licensing. But existence of license_info.xml in matlab/licenses
149+
# folder may cause hinderance in this workflow. So specifying -licmode as 'file'
150+
# overrides license_info.xml and enforces MLM_LICENSE_FILE to be the topmost priority
151+
152+
# NLM Connection String provided by MLM_LICENSE_FILE environment variable
153+
nlm_conn_str = mwi.validators.validate_mlm_license_file(
154+
os.environ.get(mwi_env.get_env_name_network_license_manager())
155+
)
156+
matlab_lic_mode = ["-licmode", "file"] if nlm_conn_str else ""
157+
146158
# All config related to matlab-proxy will be saved to user's home folder.
147159
# This will allow for other user's to launch the integration from the same system
148160
# and not have their config's overwritten.
@@ -155,6 +167,7 @@ def get(config_name=matlab_proxy.get_default_config_name(), dev=False):
155167
"-nosplash",
156168
"-nodesktop",
157169
"-softwareopengl",
170+
*matlab_lic_mode,
158171
"-r",
159172
f"try; run('{matlab_startup_file}'); catch ME; disp(ME.message); end;",
160173
],
@@ -171,9 +184,7 @@ def get(config_name=matlab_proxy.get_default_config_name(), dev=False):
171184
),
172185
"mwapikey": str(uuid.uuid4()),
173186
"matlab_protocol": "https",
174-
"nlm_conn_str": mwi.validators.validate_mlm_license_file(
175-
os.environ.get(mwi_env.get_env_name_network_license_manager())
176-
),
187+
"nlm_conn_str": nlm_conn_str,
177188
"matlab_config_file": mwi_config_folder / "proxy_app_config.json",
178189
"ws_env": ws_env,
179190
"mwa_api_endpoint": f"https://login{ws_env_suffix}.mathworks.com/authenticationws/service/v4",

tests/util/test_mw.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ def test_range_matlab_connector_ports():
511511

512512

513513
@pytest.mark.skipif(
514-
system.is_windows() or system.is_mac(),
515-
reason="xvfb is not meant for windows and mac machines",
514+
not system.is_linux(),
515+
reason="Xvfb is only required on linux based operating systems",
516516
)
517517
async def test_create_xvfb_process(loop):
518518
"""Test to check if more than 1 xvfb process can be created with -displayfd flag
@@ -521,11 +521,6 @@ async def test_create_xvfb_process(loop):
521521
running on unique display ports
522522
"""
523523

524-
# No need to test Xvfb process creation on a Windows system.
525-
# As Xvfb is meant for Posix systems.
526-
if system.is_windows():
527-
return
528-
529524
# Get command to launch xvfb with -displayfd flag.
530525
settings_1 = settings.get(dev=True)
531526
settings_2 = settings.get(dev=True)

0 commit comments

Comments
 (0)