Commit Graph

3 Commits

Author SHA1 Message Date
scnerd
d0a1dcbd6c docs(queue): add comments to test functions for consistency
All six test functions now have // TestFoo verifies... comments
matching the project's existing convention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00
scnerd
8b3f25f801 refactor(queue): use testify assertions and t.Setenv in queue tests
Switch from raw t.Errorf to testify/assert for consistency with the
rest of the codebase. Use t.Setenv() instead of manual os.Setenv/defer
os.Unsetenv for automatic cleanup. Simplify table structs where min
and max are always equal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00
scnerd
1ab08ddc11 test(queue): add unit tests for QUEUE_WORKERS env var behavior
Add tests verifying that getOptimalWorkerCount() respects the
QUEUE_WORKERS environment variable and that NewTaskQueue() should
allow QUEUE_WORKERS to override the hardcoded legacy worker count.

Includes a failing test (TestNewTaskQueue_EnvOverridesLegacy) that
reproduces the bug where QUEUE_WORKERS is always overridden by the
hardcoded legacyWorkers parameter.

Ref: rishikanthc/Scriberr#379

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00