Skip to content

Commit

Permalink
adds comment for refactoring in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitaluthra1 committed Jul 5, 2024
1 parent da73c35 commit e46ab93
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/cache/metadata/stat_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ var expiration = someTime.Add(time.Second)

type StatCacheTest struct {
suite.Suite
cache testHelperCache
cache testHelperCache
//t.cache is the wrapper class on top of metadata.StatCache.
//This approach tests wrapper methods instead of directly testing actual functionality, compromising the safety net.
//For instance: If the helper class changes internally and stops calling stat cache methods, tests won't fail,
//hence tests are not being safety net capturing behaviour change of actual functionality.
//added stat cache to test metadata.StatCache directly, removing unnecessary wrappers for accurate unit testing.
//Changing every test will increase the scope and actual hns work will be affected, so taking cautious call to just add new test in refactored way in first go,
//we can update rest of tests slowly later.
statCache metadata.StatCache
}

Expand Down

0 comments on commit e46ab93

Please sign in to comment.