Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions +labkit/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@

## Validation Routing

- Always run `scripts/run_matlab_tests.sh --suite project` for package boundary or public surface changes.
- DTA changes: also run `scripts/run_matlab_tests.sh --suite labkit/dta`; add `--suite apps/electrochem` when app-facing behavior may be affected.
- Biosignal changes: also run `scripts/run_matlab_tests.sh --suite labkit/biosignal`; add `--suite apps/wearable` when app-facing behavior may be affected.
- UI changes: also run `scripts/run_matlab_tests.sh --suite labkit/ui`; add `--suite apps --gui` for layout, launch, callback, or app shell changes.
- Always run `buildtool testProject` for package boundary or public surface changes.
- DTA changes: also run `buildtool testLabkitDta`; add
`buildtool testAppsElectrochem` when app-facing behavior may be affected.
- Biosignal changes: also run `buildtool testLabkitBiosignal`; add
`buildtool testAppsWearableGui` when app-facing behavior may be affected.
- UI changes: also run `buildtool testLabkitUi`; add
`buildtool testLabkitUiGui testAppsGui` for layout, launch, callback, or app
shell changes.
68 changes: 42 additions & 26 deletions .github/workflows/matlab-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ env:
MATLAB_RELEASE: R2025a

jobs:
shell-wrapper:
name: Shell Wrapper Checks
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Check Bash wrapper syntax
run: bash -n scripts/run_matlab_tests.sh

- name: Check Bash wrapper help
run: bash scripts/run_matlab_tests.sh --help

- name: Check Bash wrapper build task smoke
run: MATLAB_CMD=true bash scripts/run_matlab_tests.sh testProject

- name: Check removed selector flags are rejected
run: |
if bash scripts/run_matlab_tests.sh --suite; then
echo "Expected --suite to be rejected"
exit 1
fi

quality:
name: Quality Guardrails
runs-on: ubuntu-latest
Expand All @@ -31,7 +55,7 @@ jobs:
release: ${{ env.MATLAB_RELEASE }}

- name: Prepare artifact directories
run: mkdir -p artifacts/logs artifacts/test-results/html
run: mkdir -p artifacts/logs

- name: Run quality guardrails
uses: matlab-actions/run-build@v3
Expand All @@ -47,9 +71,8 @@ jobs:
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/junit.xml
artifacts/test-results/html/**
artifacts/logs/matlab.log
artifacts/test-results/**
artifacts/logs/**

unit:
name: Unit And Coverage
Expand All @@ -67,7 +90,7 @@ jobs:
release: ${{ env.MATLAB_RELEASE }}

- name: Prepare artifact directories
run: mkdir -p artifacts/logs artifacts/test-results/html artifacts/coverage/html
run: mkdir -p artifacts/logs

- name: Run unit tests and coverage
uses: matlab-actions/run-build@v3
Expand All @@ -83,11 +106,9 @@ jobs:
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/junit.xml
artifacts/test-results/html/**
artifacts/coverage/cobertura.xml
artifacts/coverage/html/**
artifacts/logs/matlab.log
artifacts/test-results/**
artifacts/coverage/**
artifacts/logs/**

integration:
name: Integration Tests
Expand All @@ -105,7 +126,7 @@ jobs:
release: ${{ env.MATLAB_RELEASE }}

- name: Prepare artifact directories
run: mkdir -p artifacts/logs artifacts/test-results/html
run: mkdir -p artifacts/logs

- name: Run integration tests
uses: matlab-actions/run-build@v3
Expand All @@ -121,9 +142,8 @@ jobs:
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/junit.xml
artifacts/test-results/html/**
artifacts/logs/matlab.log
artifacts/test-results/**
artifacts/logs/**

gui-structural:
name: GUI Structural Tests
Expand All @@ -142,7 +162,7 @@ jobs:
release: ${{ env.MATLAB_RELEASE }}

- name: Prepare artifact directories
run: mkdir -p artifacts/logs artifacts/test-results/html artifacts/gui/trace artifacts/gui/snapshots
run: mkdir -p artifacts/logs

- name: Run GUI structural tests
uses: matlab-actions/run-build@v3
Expand All @@ -158,11 +178,9 @@ jobs:
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/junit.xml
artifacts/test-results/html/**
artifacts/gui/trace/**
artifacts/gui/snapshots/**
artifacts/logs/matlab.log
artifacts/test-results/**
artifacts/gui/**
artifacts/logs/**

gui-gesture:
name: GUI Gesture Tests
Expand All @@ -182,7 +200,7 @@ jobs:
release: ${{ env.MATLAB_RELEASE }}

- name: Prepare artifact directories
run: mkdir -p artifacts/logs artifacts/test-results/html artifacts/gui/trace artifacts/gui/snapshots
run: mkdir -p artifacts/logs

- name: Run GUI gesture tests
uses: matlab-actions/run-build@v3
Expand All @@ -198,8 +216,6 @@ jobs:
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/junit.xml
artifacts/test-results/html/**
artifacts/gui/trace/**
artifacts/gui/snapshots/**
artifacts/logs/matlab.log
artifacts/test-results/**
artifacts/gui/**
artifacts/logs/**
14 changes: 9 additions & 5 deletions apps/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ Apps are first-class deliverables. Do not treat them as examples for a hidden pl

## Validation Routing

- Electrochem app change: `scripts/run_matlab_tests.sh --suite apps/electrochem`; add `--gui` for layout, launch, or callback wiring.
- DIC app change: `scripts/run_matlab_tests.sh --suite apps/dic --gui`.
- Image measurement app change: `scripts/run_matlab_tests.sh --suite apps/image_measurement --gui`.
- Wearable app change: `scripts/run_matlab_tests.sh --suite apps/wearable --gui`; add `--suite labkit/biosignal` when the biosignal facade contract may be affected.
- App entrypoint or boundary changes also run `scripts/run_matlab_tests.sh --suite project`.
- Electrochem app change: `buildtool testAppsElectrochem`; use
`buildtool testAppsElectrochemGui` for layout, launch, or callback wiring.
- DIC app change: `buildtool testAppsDicGui`.
- Image measurement app change: `buildtool testAppsImageMeasurement`; use
`buildtool testAppsImageMeasurementGui` for layout, launch, or callback wiring.
- Wearable app change: `buildtool testAppsWearableGui`; add
`buildtool testLabkitBiosignal` when the biosignal facade contract may be
affected.
- App entrypoint or boundary changes also run `buildtool testProject`.
4 changes: 2 additions & 2 deletions apps/electrochem/electrochemWorkflow.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
%ELECTROCHEMWORKFLOW Dispatch app-owned electrochem workflow helpers.
% Expected caller: electrochem app tests and migration-time workflow checks.
% Inputs are an app key, a workflow command, and command-specific arguments.
% Outputs match the selected app-owned helper. File side effects are limited to
% CSV export commands.
% Outputs match the selected app-owned helper. Side effects are limited to CSV
% export commands and app-owned plot drawing commands on caller axes.

switch string(appKey)
case "chronoOverlay"
Expand Down
6 changes: 4 additions & 2 deletions apps/electrochem/private/chronoOverlayWorkflow.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
% App-owned chrono overlay workflow helper dispatch. Expected caller:
% labkit_ChronoOverlay_app callbacks and workflow tests.
% Inputs are a command string plus the original helper arguments; outputs match
% the selected helper. This helper has no file side effects.
% the selected helper. Side effects are limited to drawing app-owned overlay
% plots on caller axes.
function varargout = chronoOverlayWorkflow(command, varargin)
%CHRONOOVERLAYWORKFLOW Dispatch app-owned chrono overlay helpers.
% Expected caller: labkit_ChronoOverlay_app callbacks and temporary compatibility
% workflow tests. Inputs are a command string plus the original helper arguments.
% Outputs match the selected helper. This helper has no file side effects.
% Outputs match the selected helper. Side effects are limited to drawing
% app-owned overlay plots on caller axes.

switch string(command)
case "alignByPulseGap"
Expand Down
23 changes: 19 additions & 4 deletions apps/electrochem/private/cicWorkflow.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
% App-owned CIC workflow helper dispatch. Expected caller: labkit_CIC_app
% callbacks and workflow tests. Inputs are a command
% string plus the original helper arguments; outputs match the selected helper.
% Side effects are limited to writeResultsCSV file writes.
% callbacks and workflow tests. Inputs are a command string plus the original
% helper arguments; outputs match the selected helper. Side effects are limited
% to CSV export writes and drawing app-owned plot annotations on caller axes.
function varargout = cicWorkflow(command, varargin)
%CICWORKFLOW Dispatch app-owned CIC analysis/export helpers.
% Expected caller: labkit_CIC_app callbacks and workflow tests.
% Inputs are a command string plus the original helper arguments. Outputs match
% the selected helper. Side effects are limited to writeResultsCSV file writes.
% the selected helper. Side effects are limited to CSV export writes and drawing
% app-owned plot annotations on caller axes.

switch string(command)
case "computeCIC"
Expand All @@ -17,6 +18,20 @@
varargout{1} = buildResultsTable(varargin{:});
case "writeResultsCSV"
[varargout{1:nargout}] = writeResultsCSV(varargin{:});
case "formatChargeDensity"
varargout{1} = formatChargeDensity(varargin{:});
case "formatMaybeNum"
varargout{1} = formatMaybeNum(varargin{:});
case "interp1Safe"
varargout{1} = interp1Safe(varargin{:});
case "shadeWindow"
shadeWindow(varargin{:});
case "addBaselineYLines"
addBaselineYLines(varargin{:});
case "addPaperStyleVTAnnotations"
addPaperStyleVTAnnotations(varargin{:});
case "addPaperStyleITAnnotations"
addPaperStyleITAnnotations(varargin{:});
otherwise
error('labkit:CIC:UnknownWorkflowCommand', ...
'Unknown CIC workflow helper command: %s.', command);
Expand Down
Loading
Loading