Skip to content

Commit 0ed5039

Browse files
committed
Updated unit tests a bit with new test base class folder. Updated MATLAB project with new chapter2 and chapter3 unit tests (so they run with the GitHub action)
1 parent ac8a5b5 commit 0ed5039

File tree

2 files changed

+64
-35
lines changed

2 files changed

+64
-35
lines changed

.github/workflows/run_toolbox_tests.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ name: Run all toolbox tests
33
on:
44
# Automatically run this action when a new push is made to repo
55
push:
6+
7+
# Run tests every 6 months after prerelease comes out to check for regressions.
8+
# Prerelease for "a" release is out by Jan 1. for "b" release by Jul 1
9+
schedule:
10+
- cron: "0 0 1 1,7 *"
611

712
# Allows you to run this workflow manually from the Actions tab
813
workflow_dispatch:
914

1015
jobs:
1116
unittest:
17+
name: Run RVC3-MATLAB unit tests
1218
runs-on: ubuntu-latest
1319
steps:
1420
- name: Check out RVC3-MATLAB repository (for unit tests)
15-
uses: actions/checkout@v3
16-
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
21+
uses: actions/checkout@v4
22+
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
23+
1724
- name: Set up MATLAB
1825
# This uses the latest release of MATLAB. Can specify "release" if needed.
1926
uses: matlab-actions/setup-matlab@v2
@@ -29,19 +36,31 @@ jobs:
2936

3037
- name: Run MATLAB Tests
3138
# Only run tests in test/toolbox folder
32-
uses: matlab-actions/run-tests@v1
39+
uses: matlab-actions/run-tests@v2
3340
with:
34-
source-folder: toolbox
41+
source-folder: toolbox; toolbox/internal; test/book/base
3542
select-by-folder: test/toolbox
36-
code-coverage-cobertura: coverage.xml
43+
test-results-junit: test-results/unit_tests.xml
44+
code-coverage-cobertura: code-coverage/unit_tests_coverage.xml
45+
3746
- name: show all files
3847
run: ls -R
48+
3949
- name: Upload coverage reports to Codecov
4050
uses: codecov/codecov-action@v3
4151
env:
4252
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
43-
# with:
44-
# file: ./coverage.xml
53+
with:
54+
file: code-coverage/unit_tests_coverage.xml
55+
56+
- name: Upload logs and coverage for RVC3 unit tests
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: book-${{ matrix.chapter }}
61+
path: |
62+
test-results/unit_tests.xml
63+
code-coverage/unit_tests_coverage.xml
4564
4665
# codecov:
4766
# # If all tests pass:

resources/project/Project.xml

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4183,38 +4183,10 @@
41834183
</File>
41844184
<File Location="test">
41854185
<File Location="book">
4186-
<File Location="tChapter2.m">
4187-
<Info>
4188-
<Category UUID="FileClassCategory">
4189-
<Label UUID="test"/>
4190-
</Category>
4191-
</Info>
4192-
</File>
41934186
<Info/>
4194-
<File Location="RVCTest.m">
4195-
<Info>
4196-
<Category UUID="FileClassCategory">
4197-
<Label UUID="test"/>
4198-
</Category>
4199-
</Info>
4200-
</File>
4201-
<File Location="RunMLX.m">
4202-
<Info>
4203-
<Category UUID="FileClassCategory">
4204-
<Label UUID="design"/>
4205-
</Category>
4206-
</Info>
4207-
</File>
42084187
<DIR_SIGNIFIER Location="1">
42094188
<Info/>
42104189
</DIR_SIGNIFIER>
4211-
<File Location="tChapter3.m">
4212-
<Info>
4213-
<Category UUID="FileClassCategory">
4214-
<Label UUID="test"/>
4215-
</Category>
4216-
</Info>
4217-
</File>
42184190
<File Location="tChapter5.m">
42194191
<Info>
42204192
<Category UUID="FileClassCategory">
@@ -4313,6 +4285,44 @@
43134285
</Category>
43144286
</Info>
43154287
</File>
4288+
<File Location="chapter02">
4289+
<File Location="tChapter2.m">
4290+
<Info>
4291+
<Category UUID="FileClassCategory">
4292+
<Label UUID="test"/>
4293+
</Category>
4294+
</Info>
4295+
</File>
4296+
<Info/>
4297+
<DIR_SIGNIFIER Location="1">
4298+
<Info/>
4299+
</DIR_SIGNIFIER>
4300+
</File>
4301+
<File Location="base">
4302+
<File Location="RVCTest.m">
4303+
<Info/>
4304+
</File>
4305+
<Info/>
4306+
<DIR_SIGNIFIER Location="1">
4307+
<Info/>
4308+
</DIR_SIGNIFIER>
4309+
<File Location="RunMLX.m">
4310+
<Info/>
4311+
</File>
4312+
</File>
4313+
<File Location="chapter03">
4314+
<File Location="tChapter3.m">
4315+
<Info>
4316+
<Category UUID="FileClassCategory">
4317+
<Label UUID="test"/>
4318+
</Category>
4319+
</Info>
4320+
</File>
4321+
<Info/>
4322+
<DIR_SIGNIFIER Location="1">
4323+
<Info/>
4324+
</DIR_SIGNIFIER>
4325+
</File>
43164326
</File>
43174327
<Info/>
43184328
<DIR_SIGNIFIER Location="1">

0 commit comments

Comments
 (0)