Skip to content

Add unit tests for executor-assignment module#256

Closed
nikolasdehor wants to merge 1 commit intoSynkraAI:mainfrom
nikolasdehor:test/executor-assignment-coverage
Closed

Add unit tests for executor-assignment module#256
nikolasdehor wants to merge 1 commit intoSynkraAI:mainfrom
nikolasdehor:test/executor-assignment-coverage

Conversation

@nikolasdehor
Copy link
Contributor

@nikolasdehor nikolasdehor commented Feb 18, 2026

Summary

  • Add 42 unit tests for the executor-assignment orchestration module
  • Cover keyword-based story type detection, executor/quality gate assignment, validation, and utility functions
  • No mocks needed — pure function tests

Test Coverage

Area Tests Key Scenarios
Constants 4 Table structure, field validation
detectStoryType 13 All types, edge cases, scoring
assignExecutor 8 All types, unknown fallback
assignExecutorFromContent 2 Combined flow
validateExecutorAssignment 10 All validation rules
Utility functions 5 Types, configs, work type map
Total 42

Test plan

  • All 42 tests pass
  • No external dependencies or mocks needed
  • Tests all exported functions and constants

Closes #305

Copilot AI review requested due to automatic review settings February 18, 2026 19:48
@vercel
Copy link

vercel bot commented Feb 18, 2026

@nikolasdehor is attempting to deploy a commit to the Pedro Valério Lopez's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Warning

Rate limit exceeded

@nikolasdehor has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Jest unit test coverage for the .aios-core/core/orchestration/executor-assignment module to validate story-type detection and executor/quality-gate assignment behaviors.

Changes:

  • Introduces comprehensive unit tests for exported constants and utility functions.
  • Adds coverage for detectStoryType, assignExecutor, assignExecutorFromContent, and validateExecutorAssignment.
  • Verifies expected executor/quality gate mappings and validation error cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jest.resetAllMocks();
jest.spyOn(console, 'warn').mockImplementation();
});

Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

beforeEach creates a new jest.spyOn(console, 'warn') but the spy is never restored. Since jest.resetAllMocks() does not restore the original implementation, this can leave console.warn mocked across the suite and may break subsequent spyOn calls. Add an afterEach(() => jest.restoreAllMocks()) (or console.warn.mockRestore()), and consider replacing resetAllMocks() with clearAllMocks() if you only need call-history resets.

Suggested change
afterEach(() => {
jest.restoreAllMocks();
});

Copilot uses AI. Check for mistakes.
@nikolasdehor
Copy link
Contributor Author

Consolidated into #426

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.

Add unit tests for executor-assignment module

2 participants