Skip to content

test: add unit tests for previously uncovered server components#6301

Open
nitrocode with Copilot wants to merge 5 commits into
mainfrom
copilot/enhance-unit-test-coverage
Open

test: add unit tests for previously uncovered server components#6301
nitrocode with Copilot wants to merge 5 commits into
mainfrom
copilot/enhance-unit-test-coverage

Conversation

Copilot AI commented Mar 10, 2026

Copy link
Copy Markdown
Contributor
  • Fix misleading test name TestAutomerge_EmptyProjects_DoesNotMergeTestAutomerge_EmptyProjects_VacuouslyMerges (empty projects loop is vacuously satisfied, so merge IS called)
  • Remove conflicting comment ("nothing to merge") that contradicts the test assertion and the real behavior
  • Verified all TestAutomerge_* tests pass

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…configured_vcs_client

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit tests for missing coverage areas Add unit tests for ClientProxy, AutoMerger, PullReqStatusFetcher, and NotConfiguredVCSClient Mar 10, 2026
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Copilot AI changed the title Add unit tests for ClientProxy, AutoMerger, PullReqStatusFetcher, and NotConfiguredVCSClient test: add unit tests for previously uncovered server components Mar 10, 2026
@nitrocode nitrocode marked this pull request as ready for review March 15, 2026 05:29
Copilot AI review requested due to automatic review settings March 15, 2026 05:29
@dosubot dosubot Bot added the go Pull requests that update Go code label Mar 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds focused unit/internal tests around VCS client wrappers/proxies and a couple of unexported events helpers to improve confidence in routing, error propagation, and filtering behavior.

Changes:

  • Add unit tests for vcs.PullReqStatusFetcher covering success, error paths, and argument passing.
  • Add unit tests for vcs.ClientProxy, vcs.NotConfiguredVCSClient, and common.InstrumentedClient behavior/error propagation.
  • Add internal-package tests for events.AutoMerger and events.DBUpdater.updateDB (filtering DirNotExistErr results).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/events/vcs/pull_status_fetcher_test.go Tests PR approval/mergeability status fetching, including error wrapping and arg forwarding.
server/events/vcs/proxy_test.go Tests ClientProxy dispatching to the correct underlying VCS client and error propagation.
server/events/vcs/not_configured_vcs_client_test.go Tests placeholder client error/no-op behaviors and error message host identification.
server/events/vcs/common/instrumented_client_test.go Tests InstrumentedClient passthrough behavior and special-case no-op for UpdateStatus when pull.Num==0.
server/events/db_updater_internal_test.go Internal tests for updateDB filtering of DirNotExistErr before DB update calls.
server/events/automerger_internal_test.go Internal tests for AutoMerger merge/comment behavior and enablement helper logic.

Comment thread server/events/automerger_internal_test.go Outdated
Comment thread server/events/automerger_internal_test.go Outdated
…nal_test.go

- Rename TestAutomerge_EmptyProjects_DoesNotMerge to
  TestAutomerge_EmptyProjects_VacuouslyMerges to accurately reflect
  that an empty projects list is vacuously all-applied and thus merges
- Remove the contradictory comment "nothing to check, nothing to merge"
  that conflicted with the assertion that MergePull IS called

Agent-Logs-Url: https://github.com/runatlantis/atlantis/sessions/73a4bbb8-87ee-4bab-b5d1-0056880ce236

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Copilot AI requested a review from nitrocode May 15, 2026 12:11
@github-actions github-actions Bot removed the size/m label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants