Open
test: add unit tests for previously uncovered server components#6301
Conversation
…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
Contributor
There was a problem hiding this comment.
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.PullReqStatusFetchercovering success, error paths, and argument passing. - Add unit tests for
vcs.ClientProxy,vcs.NotConfiguredVCSClient, andcommon.InstrumentedClientbehavior/error propagation. - Add internal-package tests for
events.AutoMergerandevents.DBUpdater.updateDB(filteringDirNotExistErrresults).
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. |
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestAutomerge_EmptyProjects_DoesNotMerge→TestAutomerge_EmptyProjects_VacuouslyMerges(empty projects loop is vacuously satisfied, so merge IS called)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.