From e77f6991e159e3349071782291ed282371d5a5a5 Mon Sep 17 00:00:00 2001 From: akeeste Date: Tue, 30 Jun 2026 15:10:28 -0500 Subject: [PATCH 1/3] remove slprj folder automatically for local tests --- Body-to-Body_Interactions/TestB2B.m | 8 ++++++++ Cable/TestCable.m | 13 ++++++++---- Controls/TestControls.m | 14 +++++++++++++ Desalination/TestDesalination.m | 13 ++++++++++-- End_Stops/TestEndStops.m | 13 ++++++++++-- Free_Decay/TestFreeDecay.m | 10 +++++++++- .../TestFullDirectionalWaves.m | 13 ++++++++++-- .../TestGeneralizedBodyModes.m | 11 +++++++++- .../TestLoadMitigatingControls.m | 13 +++++++++++- MOST/tests/TestMOST.m | 12 +++++++++++ Mean_Drift/TestMeanDrift.m | 20 +++++++++++-------- Mooring/TestMooring.m | 10 +++++++++- Morison_Element/TestMorisonElement.m | 14 ++++++++++--- .../TestMultipleConditionRuns.m | 10 +++++++++- .../TestMultipleWaveSpectra.m | 13 +++++++++--- Nonhydro_Body/TestNonHydroBody.m | 10 +++++++++- Nonlinear_Hydro/TestNonlinearHydro.m | 16 +++++++++++---- OWC/TestOWC.m | 12 +++++++++-- PTO-Sim/OSWEC/TestPTOSimOSWEC.m | 12 ++++++++++- PTO-Sim/RM3/TestPTOSimRM3.m | 12 ++++++++++- .../TestOSWECNonLinearViz.m | 9 +++++++++ .../RM3_MoorDyn_Viz/TestMoorDynViz.m | 9 +++++++++ Passive_Yaw/TestPassiveYaw.m | 8 ++++++++ Passive_Yaw/TestPassiveYawRegression.m | 8 ++++++++ RM3_PTO_Extension/TestRM3PTOExtension.m | 10 +++++++++- .../TestRadiationForceOptions.m | 11 ++++++++-- Radiation_Force_Options/compare_runs.m | 4 ++++ Variable_Hydro/TestVariableHydro.m | 12 ++++++++--- WECCCOMP/TestWECCCOMP.m | 10 +++++++++- Wave_Markers/TestWaveMarkerRM3.m | 9 +++++++++ 30 files changed, 294 insertions(+), 45 deletions(-) diff --git a/Body-to-Body_Interactions/TestB2B.m b/Body-to-Body_Interactions/TestB2B.m index 4deff748..f6757dce 100644 --- a/Body-to-Body_Interactions/TestB2B.m +++ b/Body-to-Body_Interactions/TestB2B.m @@ -21,6 +21,14 @@ function killPlots (~) end methods(TestClassSetup) + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end diff --git a/Cable/TestCable.m b/Cable/TestCable.m index 13c2704f..37b7cc4d 100644 --- a/Cable/TestCable.m +++ b/Cable/TestCable.m @@ -22,11 +22,17 @@ function killPlots (~) end methods(TestClassSetup) - function captureVisibility(testCase) testCase.OriginalDefault = get(0, 'DefaultFigureVisible'); end - + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -40,18 +46,17 @@ function runBemio(testCase) end methods(TestClassTeardown) - function checkVisibilityRestored(testCase) set(0, 'DefaultFigureVisible', testCase.OriginalDefault); testCase.assertEqual(get(0, 'DefaultFigureVisible'), ... testCase.OriginalDefault); end - end methods(Test) function testCable(testCase) wecSim + close_system('MBARI_cable',0) end end diff --git a/Controls/TestControls.m b/Controls/TestControls.m index 821c7071..d6a6447a 100644 --- a/Controls/TestControls.m +++ b/Controls/TestControls.m @@ -24,6 +24,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -53,26 +61,32 @@ function checkVisibilityRestored(testCase) function testPassive(testCase) cd('Passive (P)') wecSim + close_system('passive',0) end function testReactive(testCase) cd('Reactive (PI)') wecSim + close_system('reactive',0) end function testLatching(testCase) cd('Latching') wecSim + close_system('latchTime',0) end function testDeclutching(testCase) cd('Declutching') wecSim + close_system('declutch',0) end function testMPC(testCase) cd('MPC') wecSim + close_system('sphereMPC',0) end function testReactiveWithPTO(testCase) cd('ReactiveWithPTO') wecSim + close_system('reactiveWithPTO',0) end end end diff --git a/Desalination/TestDesalination.m b/Desalination/TestDesalination.m index 5ca23fa3..a61ffd39 100644 --- a/Desalination/TestDesalination.m +++ b/Desalination/TestDesalination.m @@ -24,7 +24,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) % Check for Simscape Fluids assumeEqual(testCase, ... @@ -38,7 +46,7 @@ function runBemio(testCase) end cd(testCase.testDir) testCase.hasH5 = true; - end + end end methods(TestClassTeardown) @@ -52,6 +60,7 @@ function checkVisibilityRestored(testCase) methods(Test) function testDesalination(testCase) wecSim + close_system('OSWEC_RO',0) end end end diff --git a/End_Stops/TestEndStops.m b/End_Stops/TestEndStops.m index 5b666a18..16e0a253 100644 --- a/End_Stops/TestEndStops.m +++ b/End_Stops/TestEndStops.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -34,7 +42,7 @@ function runBemio(testCase) cd(testCase.testDir) end end - + methods(TestClassTeardown) function checkVisibilityRestored(testCase) set(0,'DefaultFigureVisible',testCase.OriginalDefault); @@ -46,6 +54,7 @@ function checkVisibilityRestored(testCase) methods(Test) function testEnd_Stops(testCase) wecSim + close_system('RM3',0) end end end diff --git a/Free_Decay/TestFreeDecay.m b/Free_Decay/TestFreeDecay.m index 7a26f25b..0f871855 100644 --- a/Free_Decay/TestFreeDecay.m +++ b/Free_Decay/TestFreeDecay.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) diff --git a/Full_Directional_Waves/TestFullDirectionalWaves.m b/Full_Directional_Waves/TestFullDirectionalWaves.m index 3d5ccfb7..1a0673da 100644 --- a/Full_Directional_Waves/TestFullDirectionalWaves.m +++ b/Full_Directional_Waves/TestFullDirectionalWaves.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -52,6 +60,7 @@ function checkVisibilityRestored(testCase) methods(Test) function testFullDirectionalWaves(testCase) wecSim - end + close_system('OSWEC',0) + end end end diff --git a/Generalized_Body_Modes/TestGeneralizedBodyModes.m b/Generalized_Body_Modes/TestGeneralizedBodyModes.m index 31ae4b9e..d6e93e67 100644 --- a/Generalized_Body_Modes/TestGeneralizedBodyModes.m +++ b/Generalized_Body_Modes/TestGeneralizedBodyModes.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -46,6 +54,7 @@ function checkVisibilityRestored(testCase) methods(Test) function testGeneralized_Body_Modes(testCase) wecSim + close_system('GBM',0) end end end diff --git a/Load_Mitigating_Controls/TestLoadMitigatingControls.m b/Load_Mitigating_Controls/TestLoadMitigatingControls.m index 567b0339..15809191 100644 --- a/Load_Mitigating_Controls/TestLoadMitigatingControls.m +++ b/Load_Mitigating_Controls/TestLoadMitigatingControls.m @@ -22,7 +22,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -52,14 +60,17 @@ function checkVisibilityRestored(testCase) function testLoad_Mitigating_Control_ControlTests(testCase) cd('ControlTests') wecSim + close_system('WaveBot3Dof_Control',0) end function testLoad_Mitigating_Control_CalcImpedance(testCase) cd('CalcImpedance') wecSim + close_system('WaveBot3Dof_ID',0) end function testLoad_Mitigating_Control_CalcImpedance_MCR(testCase) cd('CalcImpedance') wecSimMCR + close_system('WaveBot3Dof_ID',0) end end end diff --git a/MOST/tests/TestMOST.m b/MOST/tests/TestMOST.m index 7d77e802..0ebc69cf 100644 --- a/MOST/tests/TestMOST.m +++ b/MOST/tests/TestMOST.m @@ -33,6 +33,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBEMIO(testCase) cd(fullfile(testCase.testDir, testCase.hydroDataDir)); if isfile(testCase.h5Name) @@ -52,6 +60,7 @@ function runMOSTIO(testCase) function runTurbulentTest(testCase) cd(fullfile(testCase.testDir,'turbulent')) runLoadTurbulent; + close_system('SModel_VolturnUS',0) testCase.turbulent = load('turbulent.mat').("turbulent"); cd(testCase.testDir); end @@ -64,6 +73,9 @@ function plotTests(testCase) plotTests(testCase.turbulent.newCase,testCase.turbulent.orgCase); end end + function closeModels(~) + bdclose('all'); + end function checkVisibilityRestored(testCase) set(0,'DefaultFigureVisible',testCase.OriginalDefault); testCase.assertEqual(get(0,'DefaultFigureVisible'),... diff --git a/Mean_Drift/TestMeanDrift.m b/Mean_Drift/TestMeanDrift.m index bebb06b5..a450fde2 100644 --- a/Mean_Drift/TestMeanDrift.m +++ b/Mean_Drift/TestMeanDrift.m @@ -21,12 +21,18 @@ function killPlots (~) end end - methods(TestClassSetup) - + methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end - + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -36,22 +42,20 @@ function runBemio(testCase) end cd(testCase.testDir) end - - end + end methods(TestClassTeardown) - function checkVisibilityRestored(testCase) set(0,'DefaultFigureVisible',testCase.OriginalDefault); testCase.assertEqual(get(0,'DefaultFigureVisible'), ... testCase.OriginalDefault); - end - + end end methods(Test) function testMean_Drift(testCase) wecSim + close_system('sphere',0) end end diff --git a/Mooring/TestMooring.m b/Mooring/TestMooring.m index 8f1fc5c9..537c7f1e 100644 --- a/Mooring/TestMooring.m +++ b/Mooring/TestMooring.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) diff --git a/Morison_Element/TestMorisonElement.m b/Morison_Element/TestMorisonElement.m index aa709ab2..d9b6ddaf 100644 --- a/Morison_Element/TestMorisonElement.m +++ b/Morison_Element/TestMorisonElement.m @@ -20,10 +20,18 @@ function killPlots (~) end end - methods(TestClassSetup) + methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -38,7 +46,7 @@ function runBemio(testCase) methods(TestMethodTeardown) function returnHome(testCase) cd(testCase.testDir) - end + end end methods(TestClassTeardown) diff --git a/Multiple_Condition_Runs/TestMultipleConditionRuns.m b/Multiple_Condition_Runs/TestMultipleConditionRuns.m index 9f227b12..64443f49 100644 --- a/Multiple_Condition_Runs/TestMultipleConditionRuns.m +++ b/Multiple_Condition_Runs/TestMultipleConditionRuns.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) diff --git a/Multiple_Wave_Spectra/TestMultipleWaveSpectra.m b/Multiple_Wave_Spectra/TestMultipleWaveSpectra.m index 83ffb71c..56f2e4b6 100644 --- a/Multiple_Wave_Spectra/TestMultipleWaveSpectra.m +++ b/Multiple_Wave_Spectra/TestMultipleWaveSpectra.m @@ -22,11 +22,17 @@ function killPlots (~) end methods(TestClassSetup) - function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end - + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -44,12 +50,13 @@ function checkVisibilityRestored(testCase) set(0,'DefaultFigureVisible',testCase.OriginalDefault); testCase.assertEqual(get(0,'DefaultFigureVisible'), ... testCase.OriginalDefault); - end + end end methods(Test) function testMultiple_Wave_Headings(testCase) wecSim + close_system('OSWEC',0) end end end diff --git a/Nonhydro_Body/TestNonHydroBody.m b/Nonhydro_Body/TestNonHydroBody.m index 9239d2db..11a1dc5f 100644 --- a/Nonhydro_Body/TestNonHydroBody.m +++ b/Nonhydro_Body/TestNonHydroBody.m @@ -24,7 +24,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end - + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -48,6 +55,7 @@ function checkVisibilityRestored(testCase) methods(Test) function testNonhydro_Body(testCase) wecSim + close_system('OSWEC',0) end end diff --git a/Nonlinear_Hydro/TestNonlinearHydro.m b/Nonlinear_Hydro/TestNonlinearHydro.m index e1424eac..4ac88efb 100644 --- a/Nonlinear_Hydro/TestNonlinearHydro.m +++ b/Nonlinear_Hydro/TestNonlinearHydro.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -59,16 +67,16 @@ function testNonlinear_Hydro_ode4_RegularCIC(testCase) cd(fullfile('ode4', 'RegularCIC')) wecSim close_system('ellipsoid',0) - end + end function testNonlinear_Hydro_ode45_Regular(testCase) cd(fullfile('ode45', 'Regular')) wecSim close_system('ellipsoid',0) - end + end function testNonlinear_Hydro_ode45_RegularCIC(testCase) cd(fullfile('ode45', 'RegularCIC')) wecSim close_system('ellipsoid',0) - end + end end end diff --git a/OWC/TestOWC.m b/OWC/TestOWC.m index 2b186dac..3307173d 100644 --- a/OWC/TestOWC.m +++ b/OWC/TestOWC.m @@ -22,6 +22,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemioOrifice(testCase) cd(testCase.h5DirOrifice); if isfile(testCase.h5NameOrifice) @@ -58,7 +66,7 @@ function checkVisibilityRestored(testCase) function testOWCOrifice(testCase) cd('OrificeModel') wecSim - close_system('OWC_rigid',0) + close_system('OWC_GBM',0) end function testOWCFloating(testCase) isCI = strcmpi(getenv("GITHUB_ACTIONS"), "true"); @@ -67,7 +75,7 @@ function testOWCFloating(testCase) "MoorDyn is not installed"); cd('FloatingOWC') wecSim - close_system('OWC_GBM',0) + close_system('OWC_rigid',0) end end end \ No newline at end of file diff --git a/PTO-Sim/OSWEC/TestPTOSimOSWEC.m b/PTO-Sim/OSWEC/TestPTOSimOSWEC.m index 86a48608..55b573b8 100644 --- a/PTO-Sim/OSWEC/TestPTOSimOSWEC.m +++ b/PTO-Sim/OSWEC/TestPTOSimOSWEC.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -58,10 +66,12 @@ function checkVisibilityRestored(testCase) function testOSWEC_Hydraulic_Crank_PTO(testCase) cd('OSWEC_Hydraulic_Crank_PTO') wecSim + close_system('OSWEC_Hydraulic_Crank_PTO',0) end function testOSWEC_Hydraulic_PTO(testCase) cd('OSWEC_Hydraulic_PTO') wecSim + close_system('OSWEC_Hydraulic_PTO',0) end end end diff --git a/PTO-Sim/RM3/TestPTOSimRM3.m b/PTO-Sim/RM3/TestPTOSimRM3.m index 91a19117..ded1f793 100644 --- a/PTO-Sim/RM3/TestPTOSimRM3.m +++ b/PTO-Sim/RM3/TestPTOSimRM3.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -58,10 +66,12 @@ function checkVisibilityRestored(testCase) function testRM3_cHydraulic_PTO(testCase) cd('RM3_cHydraulic_PTO') wecSim + close_system('RM3_cHydraulic_PTO',0) end function testRM3_DD_PTO(testCase) cd('RM3_DD_PTO') wecSim + close_system('RM3_DD_PTO',0) end end end diff --git a/Paraview_Visualization/OSWEC_NonLinear_Viz/TestOSWECNonLinearViz.m b/Paraview_Visualization/OSWEC_NonLinear_Viz/TestOSWECNonLinearViz.m index a1dee4ef..87212314 100644 --- a/Paraview_Visualization/OSWEC_NonLinear_Viz/TestOSWECNonLinearViz.m +++ b/Paraview_Visualization/OSWEC_NonLinear_Viz/TestOSWECNonLinearViz.m @@ -24,6 +24,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -54,6 +62,7 @@ function removeVTK(testCase) methods(Test) function testParaview_Visualization_OSWEC_NonLinear_Viz(testCase) wecSim + close_system('OSWEC',0) end end end diff --git a/Paraview_Visualization/RM3_MoorDyn_Viz/TestMoorDynViz.m b/Paraview_Visualization/RM3_MoorDyn_Viz/TestMoorDynViz.m index eeef9996..49f4c212 100644 --- a/Paraview_Visualization/RM3_MoorDyn_Viz/TestMoorDynViz.m +++ b/Paraview_Visualization/RM3_MoorDyn_Viz/TestMoorDynViz.m @@ -25,6 +25,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) % Check for MoorDyn assumeEqual(testCase, ... @@ -65,6 +73,7 @@ function testParaview_Visualization_RM3_MoorDyn_Viz(testCase) isCI = strcmpi(getenv("GITHUB_ACTIONS"), "true"); testCase.assumeFalse(isCI, "Skipping MoorDyn test on GitHub CI"); wecSim + close_system('RM3MoorDyn',0) end end end diff --git a/Passive_Yaw/TestPassiveYaw.m b/Passive_Yaw/TestPassiveYaw.m index c108a74b..e9d63863 100644 --- a/Passive_Yaw/TestPassiveYaw.m +++ b/Passive_Yaw/TestPassiveYaw.m @@ -21,6 +21,14 @@ function killPlots (~) end methods(TestClassSetup) + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end diff --git a/Passive_Yaw/TestPassiveYawRegression.m b/Passive_Yaw/TestPassiveYawRegression.m index 30b00cdb..51d10013 100644 --- a/Passive_Yaw/TestPassiveYawRegression.m +++ b/Passive_Yaw/TestPassiveYawRegression.m @@ -28,6 +28,14 @@ function killPlots (~) end methods(TestClassSetup) + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runYawIrrTest(testCase) cd(fullfile(testCase.testDir, ... 'PassiveYawRegression')) diff --git a/RM3_PTO_Extension/TestRM3PTOExtension.m b/RM3_PTO_Extension/TestRM3PTOExtension.m index 75b8de29..f3d59736 100644 --- a/RM3_PTO_Extension/TestRM3PTOExtension.m +++ b/RM3_PTO_Extension/TestRM3PTOExtension.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) diff --git a/Radiation_Force_Options/TestRadiationForceOptions.m b/Radiation_Force_Options/TestRadiationForceOptions.m index 271b3cde..f3998c4b 100644 --- a/Radiation_Force_Options/TestRadiationForceOptions.m +++ b/Radiation_Force_Options/TestRadiationForceOptions.m @@ -22,11 +22,17 @@ function killPlots (~) end methods(TestClassSetup) - function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end - + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -52,6 +58,7 @@ function checkVisibilityRestored(testCase) methods(Test) function TestRadiation_Force_Options(testCase) compare_runs + close_system('RM3',0) end end diff --git a/Radiation_Force_Options/compare_runs.m b/Radiation_Force_Options/compare_runs.m index 537045c9..01012be7 100644 --- a/Radiation_Force_Options/compare_runs.m +++ b/Radiation_Force_Options/compare_runs.m @@ -8,6 +8,7 @@ enable_ss = 0; t_regular = tic; wecSim +close_system('RM3',0) run_time.baseline = toc(t_regular); run_summary.baseline = output; clearvars -except run_summary run_time @@ -19,6 +20,7 @@ enable_ss = 0; tStart_FIR = tic; wecSim +close_system('RM3',0) run_time.FIR = toc(tStart_FIR)/run_time.baseline; run_summary.FIR = output; clearvars -except run_summary run_time @@ -30,6 +32,7 @@ enable_ss = 1; tStart_ss = tic; wecSim +close_system('RM3',0) run_time.state_space = toc(tStart_ss)/run_time.baseline; run_summary.state_space = output; clearvars -except run_summary run_time @@ -40,6 +43,7 @@ enable_ss = 0; t_conv = tic; wecSim +close_system('RM3',0) run_time.convolution = toc(t_conv)/run_time.baseline; run_summary.convolution = output; clearvars -except run_summary run_time diff --git a/Variable_Hydro/TestVariableHydro.m b/Variable_Hydro/TestVariableHydro.m index 8ea87de0..8d50d159 100644 --- a/Variable_Hydro/TestVariableHydro.m +++ b/Variable_Hydro/TestVariableHydro.m @@ -24,11 +24,17 @@ function killPlots (~) end methods(TestClassSetup) - function captureVisibility(testCase) testCase.OriginalDefault = get(0, 'DefaultFigureVisible'); end - + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemioPY(testCase) cd(testCase.h5DirPY); if isfile(testCase.h5NamePY) @@ -74,7 +80,7 @@ function testPY(testCase) function testVM(testCase) cd('Variable_Mass') wecSim - close_system('OSWEC',0) + close_system('sphereVarMass',0) end end diff --git a/WECCCOMP/TestWECCCOMP.m b/WECCCOMP/TestWECCCOMP.m index a2b17925..f37c68ce 100644 --- a/WECCCOMP/TestWECCCOMP.m +++ b/WECCCOMP/TestWECCCOMP.m @@ -23,7 +23,15 @@ function killPlots (~) methods(TestClassSetup) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); - end + end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) diff --git a/Wave_Markers/TestWaveMarkerRM3.m b/Wave_Markers/TestWaveMarkerRM3.m index 0cac83c9..4d0c7f5f 100644 --- a/Wave_Markers/TestWaveMarkerRM3.m +++ b/Wave_Markers/TestWaveMarkerRM3.m @@ -24,6 +24,14 @@ function killPlots (~) function captureVisibility(testCase) testCase.OriginalDefault = get(0,'DefaultFigureVisible'); end + function removeProjectFolder(~) + d = dir('**'); + d = d([d.isdir]); + d = d(string({d.name})=="slprj"); + for i = 1:length(d) + rmdir(fullfile(d(i).folder, d(i).name), 's') + end + end function runBemio(testCase) cd(testCase.h5Dir); if isfile(testCase.h5Name) @@ -47,6 +55,7 @@ function checkVisibilityRestored(testCase) function testRM3_Marker(testCase) cd RM3 wecSim + close_system('RM3',0) end end end From 77595c6fd90c0f5217d47cba9ccfb3f2a2c6b3cf Mon Sep 17 00:00:00 2001 From: akeeste Date: Tue, 30 Jun 2026 15:12:49 -0500 Subject: [PATCH 2/3] update Actions actions versions --- .github/workflows/all-tests-reusable.yml | 6 +++--- .github/workflows/changed-tests.yml | 8 ++++---- .github/workflows/run-tests-reusable.yml | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/all-tests-reusable.yml b/.github/workflows/all-tests-reusable.yml index e71a33f2..eb544ab9 100644 --- a/.github/workflows/all-tests-reusable.yml +++ b/.github/workflows/all-tests-reusable.yml @@ -20,16 +20,16 @@ jobs: steps: - run: echo "Triggered by WEC-Sim commit ${{ fromJSON(inputs.client_payload).sha }}" - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: lfs: true ref: ${{ fromJSON(inputs.client_payload).branch }} - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 + uses: matlab-actions/setup-matlab@v3 with: release: R2024b - name: Get test target folder - uses: matlab-actions/run-command@v2 + uses: matlab-actions/run-command@v3 with: command: getTestTargets - name: Save output diff --git a/.github/workflows/changed-tests.yml b/.github/workflows/changed-tests.yml index dac05829..8e46d607 100644 --- a/.github/workflows/changed-tests.yml +++ b/.github/workflows/changed-tests.yml @@ -24,22 +24,22 @@ jobs: if: github.event_name != 'repository_dispatch' steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: lfs: true fetch-depth: 0 - name: Generate git diff - uses: GrantBirki/git-diff-action@v2 + uses: GrantBirki/git-diff-action@v3 id: git-diff-action with: json_diff_file_output: diff.json file_output_only: "true" - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 + uses: matlab-actions/setup-matlab@v3 with: release: R2024b - name: Get test target folder - uses: matlab-actions/run-command@v2 + uses: matlab-actions/run-command@v3 with: command: getTestTargets("diff.json") - name: Save output diff --git a/.github/workflows/run-tests-reusable.yml b/.github/workflows/run-tests-reusable.yml index 5ca3ad4a..0a1b051f 100644 --- a/.github/workflows/run-tests-reusable.yml +++ b/.github/workflows/run-tests-reusable.yml @@ -33,7 +33,7 @@ jobs: timeout-minutes: 45 steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: lfs: true ref: ${{ inputs.head_ref }} @@ -41,14 +41,14 @@ jobs: - name: Checkout LFS objects run: git lfs checkout - name: Check out WEC-Sim - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: repository: WEC-Sim/WEC-Sim ref: ${{ inputs.base_ref }} path: './WEC-Sim' - name: Check out MoorDyn if: matrix.folder == 'Mooring' || matrix.folder == 'OWC' || matrix.folder == 'Paraview_Visualization' - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: repository: WEC-Sim/MoorDyn path: './MoorDyn' @@ -60,7 +60,7 @@ jobs: shell: bash working-directory: './MoorDyn' - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 + uses: matlab-actions/setup-matlab@v3 with: products: ${{ matrix.products }} release: ${{ matrix.release }} @@ -71,7 +71,7 @@ jobs: Xvfb :99 & echo "DISPLAY=:99" >> $GITHUB_ENV - name: Install WEC-Sim, run tests and generate artifacts - uses: matlab-actions/run-command@v2 + uses: matlab-actions/run-command@v3 with: command: | addpath(genpath('WEC-Sim/source')); From 9dbb2528370c8d8ecdc7608a9153e94f6bc54d9b Mon Sep 17 00:00:00 2001 From: akeeste Date: Tue, 30 Jun 2026 15:18:47 -0500 Subject: [PATCH 3/3] remove bdclose call in testMost --- MOST/tests/TestMOST.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/MOST/tests/TestMOST.m b/MOST/tests/TestMOST.m index 0ebc69cf..20ed82c4 100644 --- a/MOST/tests/TestMOST.m +++ b/MOST/tests/TestMOST.m @@ -73,9 +73,6 @@ function plotTests(testCase) plotTests(testCase.turbulent.newCase,testCase.turbulent.orgCase); end end - function closeModels(~) - bdclose('all'); - end function checkVisibilityRestored(testCase) set(0,'DefaultFigureVisible',testCase.OriginalDefault); testCase.assertEqual(get(0,'DefaultFigureVisible'),...