Skip to content

test(queue): add job metadata and queue message serialization tests#2050

Closed
jdfalk wants to merge 2 commits into
mainfrom
codex/increase-go-test-coverage-above-80%
Closed

test(queue): add job metadata and queue message serialization tests#2050
jdfalk wants to merge 2 commits into
mainfrom
codex/increase-go-test-coverage-above-80%

Conversation

@jdfalk

@jdfalk jdfalk commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Increase Go test coverage by adding focused unit tests for queue job implementations in pkg/queue while avoiding the previously-tested types.go file.
  • Picked pkg/queue/jobs.go (randomized selection) because it contains job metadata, message serialization, and execution paths that exercise multiple components.

Description

  • Added pkg/queue/jobs_test.go with unit tests covering SingleFileJob and BatchFilesJob metadata, QueueMessage payload serialization, and Description()/ID()/Type() behaviors.
  • Added tests that verify QueueMessage payloads are marshalled to jobpb.TranslationJob via anypb.UnmarshalTo using proto.UnmarshalOptions.
  • Added tests asserting Execute returns path validation errors for relative (invalid) paths to exercise integration with security.ValidateAndSanitizePath without changing production code.
  • No production files were modified; this PR only adds tests.

Testing

  • Ran go test ./pkg/queue which completed successfully.
  • The new test file is pkg/queue/jobs_test.go and it passed locally under the repository test run.

Files that may be involved or touched by other contributors to avoid conflicts: pkg/queue/jobs.go, pkg/queue/queue.go, pkg/queue/message.go (protobuf wrappers), pkg/subtitles/translatefile.go, pkg/translator/translator.go, pkg/security/security.go, and the generated proto types under pkg/jobpb.


Codex Task

Add unit tests for queue job metadata, message serialization, and validation errors.

Files changed:
- pkg/queue/jobs_test.go - add coverage for single and batch job metadata, queue message payloads, and path validation errors
@jdfalk jdfalk added the codex Created or modified by AI/automation agents label Jan 18, 2026 — with ChatGPT Codex Connector
@jdfalk

jdfalk commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot rebase and force push this and fix the merge conflicts from the rebase.

Copilot AI commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

@jdfalk I've opened a new pull request, #2054, to work on those changes. Once the pull request is ready, I'll request review from you.

Refine queue job tests with subtests and additional description assertions while keeping coverage on queue message payloads and validation errors.

Files changed:
- pkg/queue/jobs_test.go - refine subtests and description assertions for single and batch jobs
@jdfalk jdfalk closed this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Created or modified by AI/automation agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants