From 2533f5a1975072717d7fc33a7668231f4bfd49cb Mon Sep 17 00:00:00 2001 From: sameagen Date: Wed, 21 Jun 2023 08:46:52 -0400 Subject: [PATCH 1/4] Initial startup-options support --- .circleci/test-deploy.yml | 12 ++++++++++++ src/commands/run-build.yml | 7 +++++++ src/commands/run-tests.yml | 7 +++++++ src/scripts/run-build.sh | 2 +- src/scripts/run-tests.sh | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index d599b25..370142a 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -151,6 +151,8 @@ jobs: - matlab/run-tests: test-results-junit: test-results/matlab/filterdtagresult.xml select-by-tag: FILTERED + - matlab/run-tests: + startup-options: -logfile console.log - run: name: Verify test results file was created @@ -192,6 +194,16 @@ jobs: grep -v simpleTest test-results/matlab/filterdtagresult.xml shell: bash + - run: + name: Verify tests ran with startup options + command: | + set -e + grep StartupTest console.log + grep FirstTest console.log + grep simpleTest console.log + rm console.log + shell: bash + - run: name: Set up diary for logging command: | diff --git a/src/commands/run-build.yml b/src/commands/run-build.yml index c42f055..cc1f017 100644 --- a/src/commands/run-build.yml +++ b/src/commands/run-build.yml @@ -10,6 +10,12 @@ parameters: in the plan returned by buildfile.m as well as all the tasks on which they depend. type: string default: "" + startup-options: + description: > + MATLAB startup options. 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, @@ -23,6 +29,7 @@ steps: name: Run MATLAB build environment: PARAM_TASKS: <> + PARAM_ARGS: <> command: <> shell: bash no_output_timeout: <> diff --git a/src/commands/run-tests.yml b/src/commands/run-tests.yml index ecd99b9..d373892 100644 --- a/src/commands/run-tests.yml +++ b/src/commands/run-tests.yml @@ -96,6 +96,12 @@ parameters: Maximum verbosity level for logged diagnostics included for the test run, specified as 'None', 'Terse', 'Concise', 'Detailed', or 'Verbose'. type: string default: '' + startup-options: + description: > + MATLAB startup options. If you specify more than one option, use a space to + separate the options. + type: string + default: "" steps: - run: @@ -116,6 +122,7 @@ steps: PARAM_USE_PARALLEL: <> PARAM_OUTPUT_DETAIL: <> PARAM_LOGGING_LEVEL: <> + PARAM_ARGS: <> command: <> shell: bash no_output_timeout: <> diff --git a/src/scripts/run-build.sh b/src/scripts/run-build.sh index 0693209..7bba614 100644 --- a/src/scripts/run-build.sh +++ b/src/scripts/run-build.sh @@ -36,4 +36,4 @@ $buildCommand EOF # run MATLAB command -"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" +"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS diff --git a/src/scripts/run-tests.sh b/src/scripts/run-tests.sh index 74d6f16..a75118d 100644 --- a/src/scripts/run-tests.sh +++ b/src/scripts/run-tests.sh @@ -47,4 +47,4 @@ fi disp('Running MATLAB script with contents:');\ disp(testScript.Contents);\ fprintf('__________\n\n');\ - run(testScript);" + run(testScript);" $PARAM_ARGS From 482aebda1d3b3c8162794e96ebcb1254da4e1577 Mon Sep 17 00:00:00 2001 From: sameagen Date: Wed, 21 Jun 2023 09:01:51 -0400 Subject: [PATCH 2/4] Add run-build tests, plus fix source issue for run-tests --- .circleci/test-deploy.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 370142a..3aa4c4e 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -137,6 +137,7 @@ jobs: # Integ tests for matlab/run-tests - matlab/run-tests: source-folder: src + startup-options: -logfile console.log - matlab/run-tests: test-results-junit: test-results/matlab/results.xml code-coverage-cobertura: code-coverage/coverage.xml @@ -151,9 +152,16 @@ jobs: - matlab/run-tests: test-results-junit: test-results/matlab/filterdtagresult.xml select-by-tag: FILTERED - - matlab/run-tests: - startup-options: -logfile console.log + - run: + name: Verify tests ran with startup options + command: | + set -e + grep StartupTest console.log + grep FirstTest console.log + grep simpleTest console.log + rm console.log + shell: bash - run: name: Verify test results file was created command: | @@ -194,16 +202,6 @@ jobs: grep -v simpleTest test-results/matlab/filterdtagresult.xml shell: bash - - run: - name: Verify tests ran with startup options - command: | - set -e - grep StartupTest console.log - grep FirstTest console.log - grep simpleTest console.log - rm console.log - shell: bash - - run: name: Set up diary for logging command: | @@ -376,16 +374,22 @@ jobs: rm buildlog.txt shell: bash # run build with default tasks - - matlab/run-build + - matlab/run-build: + startup-options: -logfile console.log - run: name: Verify that correct tasks appear in buildlog.txt command: | set -e grep "building" buildlog.txt + grep "building" console.log grep "testing" buildlog.txt + grep "testing" console.log ! grep "deploying" buildlog.txt + ! grep "deploying" console.log ! grep "checking" buildlog.txt + ! grep "checking" console.log rm buildlog.txt + rm console.log shell: bash workflows: From 463b8c1fd6beb665888f464092226e9c116596a8 Mon Sep 17 00:00:00 2001 From: sameagen Date: Wed, 21 Jun 2023 09:11:30 -0400 Subject: [PATCH 3/4] Fix test names --- .circleci/test-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 3aa4c4e..1994025 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -157,9 +157,9 @@ jobs: name: Verify tests ran with startup options command: | set -e - grep StartupTest console.log - grep FirstTest console.log - grep simpleTest console.log + grep mytest console.log + grep TaggedTest console.log + grep filtertest console.log rm console.log shell: bash - run: From 1a9897aa1ecb8a93164594c36a7d8c66dfb95137 Mon Sep 17 00:00:00 2001 From: sameagen Date: Wed, 21 Jun 2023 09:23:38 -0400 Subject: [PATCH 4/4] Fix task names --- .circleci/test-deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 1994025..f0831e4 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -381,13 +381,13 @@ jobs: command: | set -e grep "building" buildlog.txt - grep "building" console.log + grep "build" console.log grep "testing" buildlog.txt - grep "testing" console.log + grep "test" console.log ! grep "deploying" buildlog.txt - ! grep "deploying" console.log + ! grep "deploy" console.log ! grep "checking" buildlog.txt - ! grep "checking" console.log + ! grep "check" console.log rm buildlog.txt rm console.log shell: bash