Skip to content

Add incremental build support to ExampleDrivenTesterTask#14

Open
slahoti1 wants to merge 4 commits into
mainfrom
feature/incremental-build-support
Open

Add incremental build support to ExampleDrivenTesterTask#14
slahoti1 wants to merge 4 commits into
mainfrom
feature/incremental-build-support

Conversation

@slahoti1
Copy link
Copy Markdown
Collaborator

Summary

  • Add optional SourceFiles parameter to ExampleDrivenTesterTask. When provided, the task tracks source and example files as inputs and a .last_run stamp file as output, enabling buildtool's incremental build—skipping re-execution when
    nothing has changed.
  • Without SourceFiles, the task always runs (matching TestTask behavior).
  • Add tests covering incremental skip, re-run on source change, and property behavior.

Details

SourceFiles accepts a string array of folders containing source code under test. The task constructs input globs from both the example folders and source folders (**/.m, **/.mlx), and sets task.Outputs to a stamp file written after
successful execution.

OutputPath defaults to "test-report" (static) so that the output location is deterministic across runs—required for buildtool's up-to-date check.

Test plan

  • buildtool test passes (28 tests, 0 failures)
  • Incremental skip confirmed: second run prints "Skipped runExample (up-to-date)"
  • Source file modification triggers re-run
  • Without SourceFiles, task runs every time

Mukesh Angrakh and others added 4 commits April 9, 2026 10:12
- Set task Inputs to file globs (/**/*.m and /**/*.mlx) instead of
  folder paths so buildtool detects individual file changes
- Always set task Outputs to a .last_run stamp file so buildtool can
  determine up-to-date status regardless of CreateTestReport setting
- Write stamp file after successful test execution
- Always create OutputPath directory since stamp file needs it
- Add 7 new tests covering input tracking, output setup, stamp file
  creation, and incremental skip behavior

Closes #10

Amp-Thread-ID: https://ampcode.com/threads/T-019d430c-3162-70ce-bbf0-6143f9221e1f
Co-authored-by: Amp <amp@ampcode.com>
The timestamp-based default caused a new output folder on every
buildfile evaluation, so the stamp file was never found on subsequent
runs and the task always re-executed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Incremental build now only activates when SourceFiles is provided,
matching MathWorks TestTask behavior. Without SourceFiles, the task
always re-runs. This ensures examples are always exercised unless the
user explicitly opts in to skipping via tracked source dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove duplicate tExampleDrivenTesterTask_files folder and reuse
existing tExamplesTester_files fixtures. Add source/myFunc.m to
shared fixtures for SourceFiles tests. Update README with
incremental build usage example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant