fix(email): unbreak factory_test.go after #333 merge glitch by cristim · Pull Request #337 · LeanerCloud/cloud-commitments-cli · GitHub
Skip to content

fix(email): unbreak factory_test.go after #333 merge glitch - #337

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/email-factory-test-merge-glitch
May 11, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/email-factory-test-merge-glitch

Conversation

@cristim

@cristim cristim commented May 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Reproduction

git checkout origin/feat/multicloud-web-frontend
gofmt -l internal/email/factory_test.go
# internal/email/factory_test.go:309:2: missing ',' before newline in argument list
# internal/email/factory_test.go:312:6: expected '(', found TestNewSenderWithConfig_AWS
# ...

Or check the failing pre-commit step on any open PR against the base — same error shape.

Test plan

Summary by CodeRabbit

  • Tests
    • Improved environment variable cleanup and restoration in email factory tests for more robust test isolation.

Review Change Stack

PR #333 (closes #332) landed a botched merge of `unset_falls_through`
in TestNewSenderFromEnvironment_EmailEnabled — two overlapping copies
of the same sub-test ended up concatenated (one missing its closing
braces, one preceded by stray fragments), plus duplicate
`ctx :=` / `sender, err :=` lines. The result didn't parse:

  gofmt -l internal/email/factory_test.go
  internal/email/factory_test.go:309:2: missing ',' before newline ...
  internal/email/factory_test.go:312:6: expected '(', found TestNewSenderWithConfig_AWS

This trips `gofmt` and `go vet` in the pre-commit workflow on every
open PR against `feat/multicloud-web-frontend` (e.g. #326, #335, #336).

Keep the `prev/hadPrev` version of the sub-test (the one that actually
does `os.Unsetenv` first, which is the case the test name describes),
drop the orphaned `orig/hadOrig` fragment, and remove the duplicate
ctx/sender declarations.

Verified locally: gofmt clean, `go vet ./internal/email/...` clean,
`go test ./internal/email/...` 306 tests pass.
@cristim cristim added triaged Item has been triaged priority/p0 Drop everything; same-day fix severity/high Significant harm urgency/now Drop other things impact/all-users Affects every user effort/xs Trivial / one-liner type/bug Defect labels May 11, 2026
@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

@cristim

cristim commented May 11, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/all-users Affects every user priority/p0 Drop everything; same-day fix severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/now Drop other things

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant