Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
refactor: remove tests that only restate constants or declarations (#7984)
Multica Evef83293d1de2b
diff --git a/server/cmd/multica/cmd_daemon_probe_test.go b/server/cmd/multica/cmd_daemon_probe_test.goindex 34dbfa4b6e..8e72fc680f 100644--- a/server/cmd/multica/cmd_daemon_probe_test.go+++ b/server/cmd/multica/cmd_daemon_probe_test.go@@ -15,12 +15,3 @@ func TestDaemonRuntimeProbeFromAgents(t *testing.T) {t.Fatalf("probe = %#v", probe)}}--func TestLoadConfigAllowNoAgentsIsOptIn(t *testing.T) {- // The production startup path does not set this override. Keep the probe's- // escape hatch explicit rather than weakening the daemon startup invariant.- var overrides daemon.Overrides- if overrides.AllowNoAgents {- t.Fatal("AllowNoAgents must default to false")- }-}diff --git a/server/cmd/multica/cmd_issue_test.go b/server/cmd/multica/cmd_issue_test.goindex aecfe82197..002377445a 100644--- a/server/cmd/multica/cmd_issue_test.go+++ b/server/cmd/multica/cmd_issue_test.go@@ -2742,26 +2742,6 @@ func TestRunIssueCommentList_DoesNotPrintShowingPreamble(t *testing.T) {}}-func TestValidIssueStatuses(t *testing.T) {- expected := map[string]bool{- "backlog": true,- "todo": true,- "in_progress": true,- "in_review": true,- "done": true,- "blocked": true,- "cancelled": true,- }- for _, s := range validIssueStatuses {- if !expected[s] {- t.Errorf("unexpected status in validIssueStatuses: %q", s)- }- }- if len(validIssueStatuses) != len(expected) {- t.Errorf("validIssueStatuses has %d entries, expected %d", len(validIssueStatuses), len(expected))- }-}-// TestValidateIssueStatus pins the post-MUL-6243 contract: the CLI validates// the SHAPE of a status key, not its membership. A workspace can define custom// statuses, so only the server knows the valid set; rejecting an unknown keydiff --git a/server/internal/daemon/hermes_provider_annotation_test.go b/server/internal/daemon/hermes_provider_annotation_test.goindex 5e511f023e..2839e8e5ad 100644--- a/server/internal/daemon/hermes_provider_annotation_test.go+++ b/server/internal/daemon/hermes_provider_annotation_test.go@@ -114,26 +114,3 @@ func TestAnnotationCannotChangeMachineDecisions(t *testing.T) {})}}--// TestAnnotationAvoidsPersistedRowGuards covers the one reader the test above-// cannot execute: the SQL text guards in pkg/db/queries/agent.sql, which scan-// agent_task_queue.error long after the daemon that wrote it is gone. Keep this-// list in sync with GetLastTaskSession / GetLastChatTaskSession — a hint that-// matched one of these would quietly exclude healthy sessions from resume.-func TestAnnotationAvoidsPersistedRowGuards(t *testing.T) {- t.Parallel()-- hint := strings.ToLower(hermesProviderUnconfiguredHint)- forbidden := []string{- "400", "invalid_request_error",- "image dimensions exceed max allowed size", "image.source.base64.data",- "could not resolve authentication method",- "must not be empty", "must be non-empty", "must have non-empty",- "non-empty content", "cannot be empty", "should not be empty",- }- for _, phrase := range forbidden {- if strings.Contains(hint, phrase) {- t.Errorf("hint contains %q, which a persisted-row resume guard matches on", phrase)- }- }-}diff --git a/server/internal/events/bus_test.go b/server/internal/events/bus_test.goindex 1cb84524fc..868ec235c4 100644--- a/server/internal/events/bus_test.go+++ b/server/internal/events/bus_test.go@@ -38,12 +38,6 @@ func TestPublishOnlyMatchingType(t *testing.T) {}}-func TestPublishNoSubscribersIsNoop(t *testing.T) {- bus := New()- // Should not panic- bus.Publish(Event{Type: "no:listeners"})-}-func TestPanicInHandlerDoesNotBreakOthers(t *testing.T) {bus := New()var secondCalled booldiff --git a/server/internal/integrations/channel/capability_test.go b/server/internal/integrations/channel/capability_test.goindex a4f103e433..2abb8c01d4 100644--- a/server/internal/integrations/channel/capability_test.go+++ b/server/internal/integrations/channel/capability_test.go@@ -43,25 +43,3 @@ func TestCapability_String(t *testing.T) {})}}--// TestCapability_BitsDistinct guards against two constants accidentally-// sharing a bit after an edit to the iota block.-func TestCapability_BitsDistinct(t *testing.T) {- all := []Capability{- CapText, CapRichCard, CapThreadReply, CapQuoteReply,- CapAttachment, CapVoice, CapTypingIndicator, CapMessageEdit,- }- var seen Capability- for i, c := range all {- if c == 0 {- t.Fatalf("capability index %d is zero", i)- }- if c&(c-1) != 0 {- t.Fatalf("capability index %d (%#x) is not a single bit", i, uint64(c))- }- if seen&c != 0 {- t.Fatalf("capability index %d (%#x) overlaps an earlier bit", i, uint64(c))- }- seen |= c- }-}diff --git a/server/internal/integrations/wecom/inbound_media_test.go b/server/internal/integrations/wecom/inbound_media_test.goindex 5a8abf88a3..2aa81dc775 100644--- a/server/internal/integrations/wecom/inbound_media_test.go+++ b/server/internal/integrations/wecom/inbound_media_test.go@@ -13,7 +13,6 @@ import ("context""encoding/json""log/slog"- "strings""testing""github.com/multica-ai/multica/server/internal/integrations/channel"@@ -239,17 +238,6 @@ func TestOwnText_MixedWithNothingReadableTakesTheReceipt(t *testing.T) {}}-// TestUnsupportedReceipt_DoesNotClaimTextOnly: the receipt used to say the-// bot only handles text. It now routes photos, files, videos and 图文混排, so-// a person who just watched it answer a screenshot must not then be told it-// handles text only.-func TestUnsupportedReceipt_DoesNotClaimTextOnly(t *testing.T) {- t.Parallel()- if strings.Contains(unsupportedMsgTypeReceipt, "只能处理文字") {- t.Errorf("receipt %q still claims text-only while image/file/video/mixed route", unsupportedMsgTypeReceipt)- }-}-// TestAVoiceNoteIsReadWhereverItArrives: WeCom runs the speech recognition on// its side and hands over the transcript, so a spoken sentence needs no// download and no key — it is words, and it is read like words whether itdiff --git a/server/internal/metrics/labels_test.go b/server/internal/metrics/labels_test.goindex e9bcf9d147..63fadc5eeb 100644--- a/server/internal/metrics/labels_test.go+++ b/server/internal/metrics/labels_test.go@@ -2,16 +2,6 @@ package metricsimport "testing"-func TestBusinessMetricLabelsRejectHighCardinalityNames(t *testing.T) {- for metric, labels := range businessMetricLabels {- for _, label := range labels {- if _, forbidden := forbiddenMetricLabels[label]; forbidden {- t.Fatalf("metric %s uses forbidden label %s", metric, label)- }- }- }-}-func TestNormalizeRuntimeProviderRecognizesKnownProviders(t *testing.T) {tests := []struct {input stringdiff --git a/server/internal/service/chat_quick_actions_generate_test.go b/server/internal/service/chat_quick_actions_generate_test.goindex 5a1496ddad..c702daf1a0 100644--- a/server/internal/service/chat_quick_actions_generate_test.go+++ b/server/internal/service/chat_quick_actions_generate_test.go@@ -4,7 +4,6 @@ import ("encoding/json""strings""testing"- "unicode""github.com/jackc/pgx/v5/pgtype"@@ -270,24 +269,3 @@ func TestRenderChatQuickActionsContextClosesWithTheLanguageRule(t *testing.T) {t.Fatalf("conversation and previous labels must survive intact:\n%s", out)}}--// Neither prompt may name or contain a language: that is what taught the model-// Chinese was on the table in the first place.-func TestChatQuickActionsPromptsNameNoLanguage(t *testing.T) {- for name, text := range map[string]string{- "system prompt": chatQuickActionsSystemPrompt,- "language rule": chatQuickActionsLanguageRule,- } {- for _, r := range text {- if unicode.Is(unicode.Han, r) || unicode.Is(unicode.Hiragana, r) ||- unicode.Is(unicode.Katakana, r) || unicode.Is(unicode.Hangul, r) {- t.Fatalf("%s must contain no CJK, found %q", name, r)- }- }- for _, named := range []string{"Chinese", "Japanese", "Korean", "English"} {- if strings.Contains(text, named) {- t.Fatalf("%s must not name a language, found %q", name, named)- }- }- }-}diff --git a/server/pkg/agent/claude_models_test.go b/server/pkg/agent/claude_models_test.goindex 227874bb95..bdf84d3b6a 100644--- a/server/pkg/agent/claude_models_test.go+++ b/server/pkg/agent/claude_models_test.go@@ -29,31 +29,6 @@ func loadClaudeListModelsFixture(t *testing.T, version string) []byte {return raw}-// TestClaudeListModelsArgs_Pinned locks the discovery argv. Every element is-// load-bearing and none is obvious from the call site, which is exactly when a-// pin earns its keep — dropping --verbose or the input format silently turns-// the probe into a session that never answers.-func TestClaudeListModelsArgs_Pinned(t *testing.T) {- t.Parallel()- want := []string{- "--print",- "--verbose",- "--input-format", "stream-json",- "--output-format", "stream-json",- "--strict-mcp-config",- }- if !reflect.DeepEqual(claudeListModelsArgs, want) {- t.Fatalf("claudeListModelsArgs drifted: got %v, want %v", claudeListModelsArgs, want)- }- // A model flag here would make discovery report the catalog for one model- // instead of the account's, and a prompt would bill a real API call.- for _, arg := range claudeListModelsArgs {- if arg == "--model" || arg == "-p" {- t.Errorf("discovery argv must not pin a model or pass a prompt: %v", claudeListModelsArgs)- }- }-}-func TestParseClaudeModelCatalog_RealCLIOutput(t *testing.T) {t.Parallel()infos, err := parseClaudeModelCatalog(loadClaudeListModelsFixture(t, "2.1.258"))diff --git a/server/pkg/agent/mcode_test.go b/server/pkg/agent/mcode_test.goindex 08fe81103c..8eef7e4a1c 100644--- a/server/pkg/agent/mcode_test.go+++ b/server/pkg/agent/mcode_test.go@@ -289,15 +289,6 @@ func TestMcodeLoadSessionWhenCapabilityAppears(t *testing.T) {}}-func TestMcodeBlockedArgsKeepACPTransportStable(t *testing.T) {- t.Parallel()- for _, arg := range []string{"acp", "login", "--region", "-h", "--help"} {- if _, ok := mcodeBlockedArgs[arg]; !ok {- t.Errorf("mcodeBlockedArgs missing %q", arg)- }- }-}-// A still-running MCode reports session/new failures as a JSON-RPC error, and// session/new is the call that launches mcpServers. Only transport-level exit// signals may be reported as "MiniMax Code ACP exited" — anything else mustdiff --git a/server/pkg/agent/qwenpaw_test.go b/server/pkg/agent/qwenpaw_test.goindex 6e46a02cde..39c588efe9 100644--- a/server/pkg/agent/qwenpaw_test.go+++ b/server/pkg/agent/qwenpaw_test.go@@ -221,22 +221,6 @@ func TestQwenpawListModels(t *testing.T) {}}-func TestQwenpawBlockedArgs(t *testing.T) {- t.Parallel()- if _, ok := qwenpawBlockedArgs["acp"]; !ok {- t.Fatal("expected acp to be in qwenpawBlockedArgs")- }- if qwenpawBlockedArgs["acp"] != blockedStandalone {- t.Fatalf("expected acp to be blockedStandalone, got %v", qwenpawBlockedArgs["acp"])- }- if _, ok := qwenpawBlockedArgs["--workspace"]; !ok {- t.Fatal("expected --workspace to be in qwenpawBlockedArgs")- }- if qwenpawBlockedArgs["--workspace"] != blockedWithValue {- t.Fatalf("expected --workspace to be blockedWithValue, got %v", qwenpawBlockedArgs["--workspace"])- }-}-func TestQwenpawUsesSessionLoad(t *testing.T) {// Verify that qwenpaw uses session/load (not session/resume) on resume.// QwenPaw's ACP server implements load_session, not session/resume.diff --git a/server/pkg/agent/zeroclaw_test.go b/server/pkg/agent/zeroclaw_test.goindex 605303eea1..c186c24af1 100644--- a/server/pkg/agent/zeroclaw_test.go+++ b/server/pkg/agent/zeroclaw_test.go@@ -367,21 +367,6 @@ func TestZeroclawResumeNotFound(t *testing.T) {}}-func TestZeroclawBlockedArgs(t *testing.T) {- t.Parallel()- if _, ok := zeroclawBlockedArgs["acp"]; !ok {- t.Fatal("expected acp to be in zeroclawBlockedArgs")- }- if zeroclawBlockedArgs["acp"] != blockedStandalone {- t.Fatalf("expected acp to be blockedStandalone, got %v", zeroclawBlockedArgs["acp"])- }- for _, flag := range []string{"--help", "-h", "login", "auth", "--login", "--auth"} {- if _, ok := zeroclawBlockedArgs[flag]; !ok {- t.Fatalf("expected %s to be in zeroclawBlockedArgs", flag)- }- }-}-func TestSelectZeroclawPermissionOptionRejectsLegacyChoice(t *testing.T) {t.Parallel()diff --git a/server/pkg/publicapi/v1/contract_test.go b/server/pkg/publicapi/v1/contract_test.goindex 00a4095f20..f201ae9102 100644--- a/server/pkg/publicapi/v1/contract_test.go+++ b/server/pkg/publicapi/v1/contract_test.go@@ -1,7 +1,6 @@package publicapiv1import (- "net/http""strings""testing"@@ -66,52 +65,3 @@ func TestOpenAPICoversCapabilityLedger(t *testing.T) {t.Fatal("Plugin-only person hook leaked into the public contract")}}--func TestOperationLedgerPinsSharedScopes(t *testing.T) {- want := map[string]string{- http.MethodGet + " " + PathIssue: "issues:read",- http.MethodPatch + " " + PathIssue: "issues:write",- http.MethodGet + " " + PathIssueComments: "comments:read",- http.MethodPost + " " + PathIssueComments: "comments:write",- }- for _, operation := range Operations {- if operation.Contract != ContractSharedResource {- continue- }- key := operation.Method + " " + operation.Path- if operation.Policy.Scope != want[key] {- t.Errorf("%s scope = %q, want %q", key, operation.Policy.Scope, want[key])- }- if len(operation.Policy.Credentials) != 4 {- t.Errorf("%s does not declare both user and Plugin credential families: %v", key, operation.Policy.Credentials)- }- if operation.Policy.Audit != AuditPlanned {- t.Errorf("%s audit status = %q, want %q until an audit sink is implemented", key, operation.Policy.Audit, AuditPlanned)- }- delete(want, key)- }- for key := range want {- t.Errorf("shared operation missing from ledger: %s", key)- }-}--func TestPluginExtensionsRejectUserCredentialsByContract(t *testing.T) {- for _, operation := range Operations {- if operation.Contract != ContractPluginExtension {- continue- }- for _, credential := range operation.Policy.Credentials {- if credential == CredentialUserOAuth || credential == CredentialPersonalAccess {- t.Errorf("%s %s exposes Plugin extension to %s", operation.Method, operation.Path, credential)- }- }- }-}--func TestOperationLedgerDeclaresAuditLifecycle(t *testing.T) {- for _, operation := range Operations {- if operation.Policy.Audit == "" {- t.Errorf("%s %s has no explicit audit lifecycle", operation.Method, operation.Path)- }- }-}