From dfb91b3523377ccb81e395cb4237e7df4275340c Mon Sep 17 00:00:00 2001 From: Philippe Bourgau Date: Tue, 8 Oct 2024 17:38:43 +0200 Subject: [PATCH] [#809] Add "//FIXME SMELL" comments in the code To experiment tracking technical debt in the code. - add FIXME comments for 2 smells we stumbled on when coding #674 --- src/engine/tcr_test.go | 1 + src/report/reporter_test_util.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/engine/tcr_test.go b/src/engine/tcr_test.go index 0f7761d7..24c49d2a 100644 --- a/src/engine/tcr_test.go +++ b/src/engine/tcr_test.go @@ -398,6 +398,7 @@ func Test_tcr_cycle_end_state(t *testing.T) { } } +// FIXME SMELL: This test factory method is getting complicated with too many parameters. Consider refactoring to Builders. func initTCREngineWithFakesWithFileDiffs( p *params.Params, toolchainFailures toolchain.Operations, diff --git a/src/report/reporter_test_util.go b/src/report/reporter_test_util.go index 268fefee..c5c747d6 100644 --- a/src/report/reporter_test_util.go +++ b/src/report/reporter_test_util.go @@ -130,6 +130,10 @@ func (sniffer *Sniffer) Stop() { } } +// FIXME SMELL: Duplicated assertion code in tests. Consider improving the reporter fake as a real mock with +// check method and better error reporting, ex: report.assertWarning... instead of setting up the sniffer +// then asserting count matches + // GetAllMatches returns a slice containing all matching messages captured by the sniffer func (sniffer *Sniffer) GetAllMatches() []Message { return sniffer.captured