Skip to content

Commit

Permalink
Fix more issues with test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Nov 2, 2024
1 parent 271e0f8 commit 99d8b42
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
1 change: 0 additions & 1 deletion +tests/+unit/nwbExportTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ function testExportTimeseriesWithoutStartingTimeRate(testCase)
'description', 'a test series', ...
'data_unit', 'n/a' ...
);
tesCase.verifyFail('') % Temp: provoke error
testCase.NwbObject.acquisition.set('time_series', time_series);
nwbFilePath = fullfile(testCase.OutputFolder, 'test_part1.nwb');
testCase.verifyError(@(f, fn) nwbExport(testCase.NwbObject, nwbFilePath), 'NWB:CustomConstraintUnfulfilled')
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,64 +18,67 @@ jobs:
name: Run MATLAB tests
runs-on: ubuntu-latest
steps:
- name: check out repository
- name: Check out repository
uses: actions/checkout@v4
- name: install python
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: configure python env
- name: Configure python env
run: |
python -m pip install -U pip
pip install -r +tests/requirements.txt
echo "HDF5_PLUGIN_PATH=$(python -c "import hdf5plugin; print(hdf5plugin.PLUGINS_PATH)")" >> "$GITHUB_ENV"
- name: install MATLAB
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2024a # this is necessary to test dynamic filters
- name: run tests
continue-on-error: true
- name: Run tests
uses: matlab-actions/run-command@v2
with:
command: results = assertSuccess(nwbtest); assert(~isempty(results), 'No tests ran');
- name: upload JUnit results
- name: Upload JUnit results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: testResults.xml
retention-days: 1
- name: upload coverage results
- name: Upload coverage results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-coverage
path: ./coverage.xml
publish_junit:
name: Publish JUnit Test Results
name: Publish JUnit test results
runs-on: ubuntu-latest
if: ${{ always() }}
if: always()
needs: [run_tests]
steps:
- name: retrieve result files
- name: Retrieve result files
uses: actions/download-artifact@v4
with:
name: test-results
- name: publish results
- name: Publish test results
uses: mikepenz/action-junit-report@v4
with:
report_paths: 'testResults.xml'
publish_coverage:
name: Publish Cobertura Test Coverage
name: Publish Cobertura test coverage
runs-on: ubuntu-latest
needs: [run_tests]
steps:
- name: check out repository
- name: Check out repository
uses: actions/checkout@v4
- name: retrieve code coverage files
uses: actions/download-artifact@v4
with:
name: test-coverage
- name: publish on Codecov
- name: Publish on coverage results on Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
name: codecov-matnwb
verbose: true
verbose: true

0 comments on commit 99d8b42

Please sign in to comment.