Skip to content

test: sonda do check go com import quebrado (não mergear) - #210

Closed
gomessguii wants to merge 1 commit into
developfrom
test/ci-go-check-probe
Closed

gomessguii wants to merge 1 commit into
developfrom
test/ci-go-check-probe

Conversation

@gomessguii

@gomessguii gomessguii commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Pull request de teste. Não fazer merge: será fechado assim que o check terminar.

Prova em runner real do terceiro critério do CRM-405: um _test.go com import que não resolve tem que reprovar o pull request.

O único arquivo adicionado, pkg/utils/ci_probe_test.go, importa github.com/evolution-foundation/evolution-go/pkg/config, que não existe neste module path (github.com/EvolutionAPI/evolution-go). O resultado esperado é go build ./... passar, go vet ./... reprovar e o check go ficar vermelho, bloqueando o merge.

Summary by Sourcery

Verify that the Go CI check blocks pull requests when test files contain unresolved imports.

CI:

  • Add a CI probe test with an unresolved import to verify that the Go check rejects pull requests containing broken test dependencies.

Tests:

  • Add a test fixture that intentionally imports a package unavailable under the module path.

@sourcery-ai

sourcery-ai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a non-mergeable CI probe whose unresolved test-only import should leave go build passing while causing go vet and the Go check to fail, validating the third CRM-405 criterion.

File-Level Changes

Change Details Files
Adds a deliberately failing Go test probe to verify CI rejects unresolved imports in test files.
  • Adds an empty test case with a blank import of a nonexistent module path.
  • Exercises the expected distinction between package build success and vet/check failure.
pkg/utils/ci_probe_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="pkg/utils/ci_probe_test.go" line_range="6" />
<code_context>
+import (
+	"testing"
+
+	_ "github.com/evolution-foundation/evolution-go/pkg/config"
+)
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The test package imports a module path that does not match the repository's `go.mod` module path, so `go vet ./...` fails while loading `pkg/utils`, and `go test ./...` fails for the same unresolved import.

**Triggers:** When CI runs `go vet ./...` or `go test ./...`.

**Suggested fix:** Remove this probe after the check is verified, or replace the import with the valid `github.com/EvolutionAPI/evolution-go/pkg/config` path for a passing test.

```suggestion
	_ "github.com/EvolutionAPI/evolution-go/pkg/config"
```
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: pkg/utils/ci_probe_test.go:6


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

import (
"testing"

_ "github.com/evolution-foundation/evolution-go/pkg/config"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): The test package imports a module path that does not match the repository's go.mod module path, so go vet ./... fails while loading pkg/utils, and go test ./... fails for the same unresolved import.

Triggers: When CI runs go vet ./... or go test ./....

Suggested fix: Remove this probe after the check is verified, or replace the import with the valid github.com/EvolutionAPI/evolution-go/pkg/config path for a passing test.

Suggested change
_ "github.com/evolution-foundation/evolution-go/pkg/config"
_ "github.com/EvolutionAPI/evolution-go/pkg/config"

@gomessguii

Copy link
Copy Markdown
Member Author

Sonda concluída: go build passou, go vet reprovou com no required module provides package e o merge ficou bloqueado. Fechado sem merge, como previsto.

@gomessguii gomessguii closed this Oct 1, 2026
@gomessguii
gomessguii deleted the test/ci-go-check-probe branch October 1, 2026 18:38
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.

1 participant