Skip to content

test(shared): Add workflow expression coverage#9421

Merged
ccastrotrejo merged 3 commits into
Azure:mainfrom
ccastrotrejo:ccastrotrejo-microsoft-test-critical-code-paths
Jul 17, 2026
Merged

test(shared): Add workflow expression coverage#9421
ccastrotrejo merged 3 commits into
Azure:mainfrom
ccastrotrejo:ccastrotrejo-microsoft-test-critical-code-paths

Conversation

@ccastrotrejo

@ccastrotrejo ccastrotrejo commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

The workflow expression scanner, parser, and builder are foundational Logic Apps business logic but previously lacked direct unit coverage. This PR adds 67 focused tests for their established behavior without modifying production code.

The tests cover tokenization and expression limits, literals and nested functions, dereferences and safe navigation, alias-path handling, template interpolation, serialization, round trips, and error paths.

Impact of Change

  • Users: No user-facing behavior changes.
  • Developers: Adds regression protection and executable documentation for workflow expression handling.
  • System: Test-only change with no runtime, API, dependency, or architecture impact.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: Biome checks passed; targeted expression tests passed (67/67) with 100% statements/functions/lines and 98.75% branch coverage; full @microsoft/logic-apps-shared suite passed (953 tests, no type errors); GitHub Actions run 29615327286 completed successfully, including vscode-e2e-summary.

Contributors

@ccastrotrejo

Screenshots/Videos

N/A

ccastrotrejo and others added 2 commits July 17, 2026 17:25
Add focused coverage for expression scanning, parsing, building, error handling, dereferences, and template interpolation without changing production behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8899acf2-8354-47c0-a93b-5394e4043078
Undo the unrelated localization extraction produced by the test commit hook so the branch remains test-only.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8899acf2-8354-47c0-a93b-5394e4043078
Copilot AI review requested due to automatic review settings July 17, 2026 21:27
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: test(shared): Add workflow expression coverage
  • Issue: None — uses the valid test(scope): prefix and clearly describes the change.
  • Recommendation: No change needed.

Commit Type

  • Exactly one type selected: test - Test-related changes.
  • This correctly matches the diff, which adds only *.spec.ts files under libs/logic-apps-shared/.../expression/__test__/.

Risk Level

  • Low selected in the body and the risk:low label is present — both consistent.
  • This matches the advised estimate: the diff is test-only (three new spec files, no production code touched), so there is no runtime, API, dependency, or user-facing impact. Low is correct.

What & Why

  • Current: Explains that the scanner, parser, and builder lacked direct unit coverage and that 67 focused tests were added without modifying production code.
  • Issue: None — clear and specific.
  • Recommendation: No change needed.

Impact of Change

  • All three audiences addressed (Users: none; Developers: regression protection/executable docs; System: test-only, no runtime impact).
  • Recommendation:
    • Users: No user-facing behavior changes (accurate).
    • Developers: Adds regression protection for expression handling (accurate).
    • System: Test-only, no runtime/API/dependency impact (accurate).

Test Plan

  • Unit tests added/updated is checked and confirmed in the diff (builder/parser/scanner specs). Verification details (67/67 passing, full shared suite green) are provided. Passes CHECK TESTS.

Contributors


Screenshots/Videos

  • Not required — the diff only adds test files and touches no visual UI components. N/A is appropriate.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level Low is correct (test-only)
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests confirmed in diff
Contributors No change needed
Screenshots/Videos Not applicable

All checks pass — this test-only PR is compliant and cleared to merge.


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Fri, 17 Jul 2026 22:12:05 GMT

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds focused Vitest unit coverage for the workflow expression scanner/parser/builder in logic-apps-shared, capturing existing behavior and edge cases without changing production code.

Changes:

  • Added scanner tests covering tokenization, punctuation, identifiers, numeric and string literal handling, whitespace, and error cases.
  • Added parser tests covering literals, nested functions, dereferences (including safe navigation), alias-path splitting, and template interpolation parsing.
  • Added builder tests covering expression/template serialization, escaping rules, dereference emission, and parse→build canonical round-trips.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
libs/logic-apps-shared/src/parsers/lib/expression/test/scanner.spec.ts New unit coverage for ExpressionScanner tokenization and scanner error behaviors.
libs/logic-apps-shared/src/parsers/lib/expression/test/parser.spec.ts New unit coverage for ExpressionParser AST output across literals, functions, dereferences, alias paths, and templates.
libs/logic-apps-shared/src/parsers/lib/expression/test/builder.spec.ts New unit coverage for ExpressionBuilder serialization and canonical round-trips.

@ccastrotrejo ccastrotrejo added risk:low Low risk change with minimal impact and removed needs-pr-update labels Jul 17, 2026
@ccastrotrejo ccastrotrejo changed the title test(shared): Cover workflow expression parsing test(shared): Add workflow expression coverage Jul 17, 2026
@ccastrotrejo
ccastrotrejo enabled auto-merge (squash) July 17, 2026 22:13
@ccastrotrejo
ccastrotrejo merged commit 72d1c97 into Azure:main Jul 17, 2026
62 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants