Skip to content

Add unit tests for 6 low-coverage modules (89 new tests)#156

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781644882-add-unit-tests-low-coverage
Open

Add unit tests for 6 low-coverage modules (89 new tests)#156
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781644882-add-unit-tests-low-coverage

Conversation

@devin-ai-integration

Copy link
Copy Markdown

What Changed

Added 89 new unit tests across 6 test files targeting modules that previously had 0% or very low function/line coverage:

Module Prev Function Cov Prev Line Cov Tests Added
src/subagents/linter.ts 0% 14% 17
src/subagents/audit.ts 0% 2% 9
src/scheduler/human.ts 40% 26% 23
src/agent/prompt-blocks/evolved.ts 0% 0% 14
src/agent/message-param-utils.ts 50% 9% 14
src/chat/storage.ts 41% 44% 12

Why

Coverage analysis revealed these modules had the lowest test coverage in the codebase. All contain pure logic or simple I/O that is straightforward to unit test without external dependencies.

How I Tested

bun test                # 2740 tests pass (89 new), 0 failures
bun run lint            # Clean
bun run typecheck       # Clean

Each new test file also passes independently:

bun test src/subagents/__tests__/linter.test.ts
bun test src/subagents/__tests__/audit.test.ts
bun test src/scheduler/__tests__/human.test.ts
bun test src/agent/prompt-blocks/__tests__/evolved.test.ts
bun test src/agent/__tests__/message-param-utils.test.ts
bun test src/chat/__tests__/storage.test.ts

Checklist

  • Tests pass (bun test)
  • Lint passes (bun run lint)
  • Typecheck passes (bun run typecheck)
  • No secrets or .env files included
  • Files stay under 300 lines
  • No Cardinal Rule violations (TypeScript does plumbing only, the Agent SDK does reasoning)
  • No default exports or barrel files added

Link to Devin session: https://app.devin.ai/sessions/83c3044c5f0e4769a1195f4e810df92b
Requested by: @mcheemaa

Add 89 new tests across 6 test files covering modules that previously
had 0% or very low function/line coverage:

- src/subagents/linter.ts: Shell red-list detection, size limits, heading checks
- src/subagents/audit.ts: Record and list subagent audit log entries
- src/scheduler/human.ts: Cron-to-English, interval formatting, at schedules
- src/agent/prompt-blocks/evolved.ts: Evolved config section assembly
- src/agent/message-param-utils.ts: Text extraction and content wrapping
- src/chat/storage.ts: Attachment file I/O operations

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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