Skip to content

test(agent-service): extend workflow-crud-tools and add a logger spec - #7026

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:test-agent-service-cov
Open

test(agent-service): extend workflow-crud-tools and add a logger spec#7026
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:test-agent-service-cov

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds 18 tests (17 -> 35). No source changes.

  • workflow-crud-tools.ts (~94% covered): the modifyOperator path where properties pass metadata validation (only the failing path was covered before), plus the input-port index guards — non-numeric key, negative index, and out-of-range index — each asserting the specific error message.
  • logger.ts (~57% covered, no test before): a new spec covering its level and formatting branches deterministically, with any stubbed global state restored.

Note: src/agent/prompts.ts was deliberately left alone — another open PR is already adding prompts.test.ts.

Any related issues, documentation, discussions?

Closes #7024.

How was this PR tested?

bun test src/agent/tools/workflow-crud-tools.spec.ts src/logger.spec.ts -> 35 pass, 0 fail (104 expect() calls). bunx prettier --check "src/**/*.{ts,js,json}" clean.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

Add 18 tests (no source changes): the modifyOperator validation-pass path and the
input-port index guards (non-numeric, negative, out-of-range) in workflow-crud-tools,
plus a new spec for logger.ts covering its level and formatting branches with any
stubbed global state restored.
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15
    You can notify them by mentioning @mengw15 in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.25%. Comparing base (a61702f) to head (55be8db).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7026      +/-   ##
============================================
+ Coverage     79.20%   79.25%   +0.04%     
  Complexity     3786     3786              
============================================
  Files          1160     1160              
  Lines         46118    46118              
  Branches       5114     5114              
============================================
+ Hits          36529    36549      +20     
+ Misses         7969     7949      -20     
  Partials       1620     1620              
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from a61702f
agent-service 77.42% <ø> (+0.65%) ⬆️
amber 72.43% <ø> (ø) Carriedforward from a61702f
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from a61702f
config-service 66.66% <ø> (ø) Carriedforward from a61702f
file-service 67.21% <ø> (ø) Carriedforward from a61702f
frontend 83.08% <ø> (ø) Carriedforward from a61702f
notebook-migration-service 78.94% <ø> (ø) Carriedforward from a61702f
pyamber 96.34% <ø> (ø) Carriedforward from a61702f
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from a61702f

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend agent-service workflow-crud-tools and add a logger spec

2 participants