From bc4dd54a3055da8bdfee7707f3277092fc938afe Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 27 Apr 2023 10:46:00 -0400 Subject: [PATCH 01/10] Add the ability to pass startup options through to MATLAB when running a command --- src/commands/run-command.yml | 7 +++++++ src/scripts/run-command.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commands/run-command.yml b/src/commands/run-command.yml index 3bc4dfd..f331103 100644 --- a/src/commands/run-command.yml +++ b/src/commands/run-command.yml @@ -12,6 +12,12 @@ parameters: script or function, do not specify the file extension. If you specify more than one MATLAB command, use a comma or semicolon to separate the commands. type: string + startup-options: + description: > + Options passed to MATLAB at startup. If you specify more than one option, use a space to + separate the options. + type: string + default: "" no-output-timeout: description: > Elapsed time the command can run without output. The string is a decimal with unit suffix, @@ -25,6 +31,7 @@ steps: name: Run MATLAB command environment: PARAM_COMMAND: <> + PARAM_ARGS: <> command: <> shell: bash no_output_timeout: <> diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh index 628caf2..3735865 100644 --- a/src/scripts/run-command.sh +++ b/src/scripts/run-command.sh @@ -33,4 +33,4 @@ ${PARAM_COMMAND} EOF # run MATLAB command -"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" +"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" "${PARAM_ARGS}" From 713c1bb6c68d47f878f76b8564039d731483e764 Mon Sep 17 00:00:00 2001 From: sameagen-MW <122639681+sameagen-MW@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:20:44 -0400 Subject: [PATCH 02/10] Update test-deploy.yml Add a test using startup-options --- .circleci/test-deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index c3bcc71..15090c4 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -102,6 +102,11 @@ jobs: shell: bash - matlab/run-command: command: assert(myvar==123, 'myvar was not set as expected by startup.m') + - matlab/run-command: + command: disp("Hello world!") + startup-options: -logfile mylog.log + - matlab/run-command: + command: assert(isfile(mylog.log), 'logfile was not created as expected') integration-test-run-tests: parameters: From a7824f4f338bef4378e0d94d5725ba880fe1dcec Mon Sep 17 00:00:00 2001 From: sameagen-MW <122639681+sameagen-MW@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:27:38 -0400 Subject: [PATCH 03/10] Update test-deploy.yml Quotes! --- .circleci/test-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 15090c4..fbd4974 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -106,7 +106,7 @@ jobs: command: disp("Hello world!") startup-options: -logfile mylog.log - matlab/run-command: - command: assert(isfile(mylog.log), 'logfile was not created as expected') + command: assert(isfile("mylog.log"), 'logfile was not created as expected') integration-test-run-tests: parameters: From f492679a44807e2dbcf900de623d14a4c384d96b Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 27 Apr 2023 11:44:54 -0400 Subject: [PATCH 04/10] Changed help text for clarity --- src/commands/run-command.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/run-command.yml b/src/commands/run-command.yml index f331103..332de56 100644 --- a/src/commands/run-command.yml +++ b/src/commands/run-command.yml @@ -14,7 +14,7 @@ parameters: type: string startup-options: description: > - Options passed to MATLAB at startup. If you specify more than one option, use a space to + MATLAB startup options. If you specify more than one option, use a space to separate the options. type: string default: "" From 2292f00ed610744a2dfc3e5b98e13aefa91fb554 Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 27 Apr 2023 13:29:42 -0400 Subject: [PATCH 05/10] Add debug statement --- src/scripts/run-command.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh index 3735865..3d88eae 100644 --- a/src/scripts/run-command.sh +++ b/src/scripts/run-command.sh @@ -32,5 +32,8 @@ cat << EOF >> "$scriptpath" ${PARAM_COMMAND} EOF +# DEBUG +echo ${PARAM_ARGS} + # run MATLAB command "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" "${PARAM_ARGS}" From ba50a822ff45c6bcfb0a4c96c59b787860100657 Mon Sep 17 00:00:00 2001 From: sameagen-MW <122639681+sameagen-MW@users.noreply.github.com> Date: Thu, 27 Apr 2023 13:36:37 -0400 Subject: [PATCH 06/10] Update test-deploy.yml Add quotes to options for potential YAML parsing issue --- .circleci/test-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index fbd4974..a0806de 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -104,7 +104,7 @@ jobs: command: assert(myvar==123, 'myvar was not set as expected by startup.m') - matlab/run-command: command: disp("Hello world!") - startup-options: -logfile mylog.log + startup-options: "-logfile mylog.log" - matlab/run-command: command: assert(isfile("mylog.log"), 'logfile was not created as expected') From f5791d9fd5b948f0473c30c3bc78d2a92525e6c6 Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 27 Apr 2023 13:42:29 -0400 Subject: [PATCH 07/10] More debug (and cowbell) --- src/scripts/run-command.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh index 3d88eae..9b46b30 100644 --- a/src/scripts/run-command.sh +++ b/src/scripts/run-command.sh @@ -34,6 +34,6 @@ EOF # DEBUG echo ${PARAM_ARGS} - +echo "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" "${PARAM_ARGS}" # run MATLAB command "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" "${PARAM_ARGS}" From d2d41cc3c6d1a15c4b942fe41259e566009b47f2 Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 27 Apr 2023 13:55:43 -0400 Subject: [PATCH 08/10] Slight change --- src/scripts/run-command.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh index 9b46b30..eb7b666 100644 --- a/src/scripts/run-command.sh +++ b/src/scripts/run-command.sh @@ -34,6 +34,6 @@ EOF # DEBUG echo ${PARAM_ARGS} -echo "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" "${PARAM_ARGS}" +echo "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS # run MATLAB command -"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" "${PARAM_ARGS}" +"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS From 8ae0fcad045dba963a7544acb3d807ee6078a03e Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 27 Apr 2023 14:08:35 -0400 Subject: [PATCH 09/10] Remove debug statements (and lessen cowbell) --- .circleci/test-deploy.yml | 2 +- src/scripts/run-command.sh | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index a0806de..fbd4974 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -104,7 +104,7 @@ jobs: command: assert(myvar==123, 'myvar was not set as expected by startup.m') - matlab/run-command: command: disp("Hello world!") - startup-options: "-logfile mylog.log" + startup-options: -logfile mylog.log - matlab/run-command: command: assert(isfile("mylog.log"), 'logfile was not created as expected') diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh index eb7b666..53faf48 100644 --- a/src/scripts/run-command.sh +++ b/src/scripts/run-command.sh @@ -32,8 +32,5 @@ cat << EOF >> "$scriptpath" ${PARAM_COMMAND} EOF -# DEBUG -echo ${PARAM_ARGS} -echo "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS # run MATLAB command "${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS From 18c12151ee9456b666ac111852db627d272a1e4d Mon Sep 17 00:00:00 2001 From: sameagen Date: Thu, 4 May 2023 09:28:02 -0400 Subject: [PATCH 10/10] Disabled parallel test --- .circleci/test-deploy.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index fbd4974..d599b25 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -207,16 +207,17 @@ jobs: grep -q "runner.addPlugin(FailOnWarningsPlugin())" console.log rm console.log shell: bash - - matlab/run-tests: - use-parallel: true - source-folder: src - - run: - name: Verify tests ran in parallel - command: | - set -e - grep -q "parallel pool" console.log - rm console.log - shell: bash + # Running test in parallel is currently unsupported + # - matlab/run-tests: + # use-parallel: true + # source-folder: src + # - run: + # name: Verify tests ran in parallel + # command: | + # set -e + # grep -q "parallel pool" console.log + # rm console.log + # shell: bash - matlab/run-tests: output-detail: Detailed source-folder: src