Repository navigation
Done
Labels
Description
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
Current State
- File:
pkg/console/render_test.go(639 LOC, 22 test functions) - Source:
pkg/console/render.go(807 LOC) - testify usage: 78
assert.*, only 1require.*; 3t.Runuses
Strengths
t.Parallel()used; table-driven tests forTestParseConsoleTag,TestIsZeroValue,TestFormatFieldValue.- Good boundary coverage in
TestFormatNumberand embedded-struct cases.
Prioritized Improvements
1. Missing / high-value tests
FormatTokens(render.go:739) has no tests anywhere inpkg/console; add a table-driven test including 0, 999, 1000, 9999, 1_000_000 and negatives.RenderStructWithOptionsis only exercised indirectly (stream_contract_test.go,table_width_test.go); add direct cases forMaxWidthandStderroptions with slices of structs and maps.FormatNumbernegative inputs are untested.RenderStructwith non-struct/nil/any(nil)input, unexported fields, and unsupported kinds (chan/func) has no tests.
2. Testify assertion upgrades
Details
- Use
require.*for preconditions whose failure makes later asserts meaningless (e.g. non-empty output beforestrings.Contains/line-splitting checks inTestRenderStruct_*,TestRenderSlice_*). Currently only line 585 does this. - Prefer
assert.Contains/assert.NotContainsoverstrings.Contains+assert.Truewhere present. - Add
assert.Empty/assert.NotEmptyfor output checks where applicable.
// before
assert.True(t, strings.Contains(output, "Run ID"))
// after
require.NotEmpty(t, output)
assert.Contains(t, output, "Run ID")3. Table-driven refactors
Details
TestFormatNumberloop has not.Run; use named subtests so failures are isolated:
for _, tt := range tests {
t.Run(strconv.Itoa(tt.input), func(t *testing.T) {
t.Parallel()
assert.Equal(t, tt.expected, FormatNumber(tt.input))
})
}- Merge
TestRenderStruct_EmbeddedStruct,_EmbeddedStructOmitEmptyAndPointer,_NestedEmbeddedStructandTestRenderSlice_*EmbeddedStructvariants into tables of (input, wantContains, wantNotContains). - Add
t.Parallel()inside subtests inTestIsZeroValue/TestFormatFieldValue. - Add zero-value cases for
isZeroValue: map, nil interface, struct, float 0.0, empty array.
4. Organization / readability
Details
- Group tests by function (
RenderStruct,RenderSlice, formatting helpers) and move shared test types next to their usage. - Name
TestFormatTag_*tests after the function under test for discoverability.
Acceptance Checklist
-
FormatTokensandRenderStructWithOptionstests added -
require.*used for preconditions -
TestFormatNumberconverted to named subtests - Embedded-struct tests consolidated into tables
-
make test-unitpasses
Generated by 🧪 Daily Testify Uber Super Expert · copilot · auto · ~15 AIC · ⊞ 9.1K · ◷
- expires on Nov 4, 2026, 10:07 AM UTC-08:00
Reacted by Copilot
Activity
github-actions commentedon Nov 3, 2026
🍪 Issue Monster selected this for Cloclo
I've identified this issue as a good candidate for automated resolution and requested a Cloclo workflow run to fix it.
If dispatch succeeds, Cloclo will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
github-actions commentedon Nov 3, 2026
🍪 Issue Monster selected this for Cloclo
I have identified this issue as a good candidate for automated resolution and requested a Cloclo workflow run to fix it.
If dispatch succeeds, Cloclo will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
github-actions commentedon Nov 3, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, Copilot will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪