From 20b30095e01a0a469c20de24ca8b4e324e4332fb Mon Sep 17 00:00:00 2001 From: alexj0se Date: Thu, 11 May 2023 15:15:11 -0400 Subject: [PATCH 1/2] Test only R2022b in R2022b branch --- .../{qualify_22b_23a.yml => qualify_22b.yml} | 12 ++++++------ test/tInstall.m | 8 -------- 2 files changed, 6 insertions(+), 14 deletions(-) rename .github/workflows/{qualify_22b_23a.yml => qualify_22b.yml} (85%) diff --git a/.github/workflows/qualify_22b_23a.yml b/.github/workflows/qualify_22b.yml similarity index 85% rename from .github/workflows/qualify_22b_23a.yml rename to .github/workflows/qualify_22b.yml index c4bd92e..7d40945 100644 --- a/.github/workflows/qualify_22b_23a.yml +++ b/.github/workflows/qualify_22b.yml @@ -1,13 +1,14 @@ # Run tInstall on Ubuntu against python versions 3.10, 3.9 and 3.8 -name: Test R2022b and R2023a - +name: Test R2022b on: push: branches: - R2022b - - R2023a - - main + + pull_request: + branches: + - R2022b # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -20,7 +21,6 @@ jobs: strategy: matrix: python: ["3.10", "3.9", "3.8"] - matlab: [R2022b, R2023a] runs-on: ubuntu-latest @@ -33,7 +33,7 @@ jobs: - name: Set up MATLAB uses: matlab-actions/setup-matlab@v1 with: - release: ${{ matrix.matlab }} + release: R2022b - uses: actions/checkout@v3 diff --git a/test/tInstall.m b/test/tInstall.m index 8aa3d88..aa162f9 100644 --- a/test/tInstall.m +++ b/test/tInstall.m @@ -5,17 +5,9 @@ properties (Constant) MATLABVersion = string(ver('MATLAB').Version) % Example: 9.14 - MATLABRelease = erase(ver('MATLAB').Release,{'(',')'}) % Example: (R2023a) -> R2023a end methods (Test) - function installNoVersionSpecified(testCase) - assumeEqual(testCase, testCase.MATLABRelease, 'R2023a') - [status, out] = system("pip install matlabengine"); - verifyEqual(testCase, status, 0, out) - verifyInstallation(testCase) - end - function installMatchingEngine(testCase) [status, out] = system("pip install matlabengine==" + testCase.MATLABVersion + ".*"); verifyEqual(testCase, status, 0, out) From 662805b81ce5058b984dec209fd0a1333dec0fdd Mon Sep 17 00:00:00 2001 From: alexj0se Date: Thu, 11 May 2023 15:39:29 -0400 Subject: [PATCH 2/2] Uninstall matlabengine in teardown --- test/tInstall.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tInstall.m b/test/tInstall.m index aa162f9..c2a55a9 100644 --- a/test/tInstall.m +++ b/test/tInstall.m @@ -10,6 +10,7 @@ methods (Test) function installMatchingEngine(testCase) [status, out] = system("pip install matlabengine==" + testCase.MATLABVersion + ".*"); + addTeardown(testCase, @system, "pip uninstall -y matlabengine") verifyEqual(testCase, status, 0, out) verifyInstallation(testCase) end @@ -26,7 +27,6 @@ function verifyInstallation(testCase) end pySharedEngineName = string(py.matlab.engine.find_matlab()); verifyEqual(testCase, pySharedEngineName, sharedEngineName) - system("pip uninstall -y matlabengine") end end end