Skip to content

Commit a1f06ec

Browse files
pranaverma92Prabhakar Kumar
authored andcommitted
Updates integration tests to run on R2021b & R2023a, and introduces downloadable logs from GitHub Action runs.
1 parent e082bc3 commit a1f06ec

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ jobs:
1616
#TODO: Add test coverage for macOs
1717
os: [ubuntu-latest, windows-latest]
1818
python-version: ["3.8", "3.11"]
19-
matlab-release: [R2020b, R2023a]
19+
20+
# The minimum matlab-release is set to 21b as 20b and 21a are not supported by matlab-actions/setup-matlab.
21+
# See https://github.com/matlab-actions/setup-matlab/issues/76
22+
matlab-release: [R2021b, R2023a]
2023

2124
runs-on: ${{ matrix.os }}
2225
steps:
@@ -48,7 +51,20 @@ jobs:
4851
run: python3 -m playwright install --with-deps
4952

5053
- name: Integration test with pytest
51-
run: python3 -m pytest tests/integration
54+
run: python3 -m pytest tests/integration -vs
5255
env:
5356
TEST_USERNAME: ${{secrets.TEST_USERNAME}}
5457
TEST_PASSWORD: ${{secrets.TEST_PASSWORD}}
58+
59+
- name: Copy Log File
60+
if: ${{ always() }}
61+
run: |
62+
cp ${{ github.workspace }}/tests/integration/integ_logs.log ${{ matrix.os }}${{ matrix.matlab-release }}${{ matrix.python-version }}.log
63+
64+
- name: Make logs files available for downloading
65+
if: ${{ always() }}
66+
uses: actions/upload-artifact@v3
67+
with:
68+
name: MATLAB Proxy Integration Test Log File
69+
path: ${{ matrix.os }}${{ matrix.matlab-release }}${{ matrix.python-version }}.log
70+
retention-days: 7

tests/integration/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ def matlab_proxy_fixture(module_monkeypatch):
3434
# some time to resolve 'localhost' hostname
3535
matlab_proxy_url = f"http://127.0.0.1:{mwi_app_port}{mwi_base_url}"
3636

37+
# Set the log path based on the test's execution environment
38+
log_path = "tests/integration/integ_logs.log"
39+
base_path = os.environ.get(
40+
"GITHUB_WORKSPACE", os.path.dirname(os.path.abspath(__name__))
41+
)
42+
matlab_proxy_logs_path = os.path.join(base_path, log_path)
43+
3744
# Start matlab-proxy-app for testing
3845
input_env = {
3946
# MWI_JUPYTER_TEST env variable is used in jupyter_matlab_kernel/kernel.py
4047
# to bypass jupyter server for testing
4148
"MWI_JUPYTER_TEST": "true",
4249
"MWI_APP_PORT": mwi_app_port,
4350
"MWI_BASE_URL": mwi_base_url,
51+
"MWI_LOG_FILE": str(matlab_proxy_logs_path),
4452
}
4553

4654
# Get event loop to start matlab-proxy in background

0 commit comments

Comments
 (0)