You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5d18e2d
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(soak): split the complex functions of the soak tester and of the cleanup command (#319)
Tests pin the behavior before the refactor: the error texts of the config validation, the defaults, the metric descriptions, the order of the API calls of Delete, fetch, rotateOffline and collect, golden plans of newPlan and planAutoscale, the window of execute, and the output of the cleanup command. The golden files were written on the base code.
Mutations.validate, Config.setDefaults, Config.validate, Mutator.execute, Mutator.fetch, newPlan, planResources, planAutoscale, stuckChange, rotateOffline, Observer.apply, Observer.collect, Instance.Delete, metrics.New, run and runCleanup are split into helpers, so that each has a cyclomatic complexity of at most 15, a cognitive complexity of at most 20 and at most 80 lines. The reads of the instance move to mutator/fetch.go and the reads of the pods to observer/pods.go (moved code unchanged), so that each file has fewer than 800 lines. TestDeleteOrder ends its waits after a number of calls, so that it does not depend on the speed of the machine.
No change of logic, messages or the order of API calls. Left over: validateVersions, Chaos.validate, validateChain, Observer.observeMaster and validateAutoscale are still above 15. Not tested: the rest of run, which needs a cluster.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G4mmyo3sqLwf23m5FE2nBE
0 commit comments