Skip to content

test: refactor reload test#930

Merged
burningalchemist merged 1 commit intomasterfrom
testing/reload
Mar 21, 2026
Merged

test: refactor reload test#930
burningalchemist merged 1 commit intomasterfrom
testing/reload

Conversation

@burningalchemist
Copy link
Owner

This pull request refactors the test configuration generation in reload_test.go to use strongly-typed Go structs and YAML marshaling instead of manual string formatting. This makes the configuration generation more robust and maintainable. It also adds minor improvements to test logging and disables logging output during tests.

Test configuration improvements:

  • Rewrote the writeConfig helper to build the YAML config using Go struct types and yaml.Marshal, replacing the previous string concatenation approach. This reduces errors and improves maintainability.
  • Updated call sites to the new writeConfig signature, which now infers the number of targets from the provided directories.

Test reliability and output:

  • Added a TestMain function to set the default logger to discard output, preventing unwanted log messages during test runs. [1] [2]
  • Improved the error message in the goroutine leak check for clarity.

Minor code hygiene:

  • Fixed a bug in setupCSVDirs where the loop incorrectly ranged over an integer instead of the directory slice.

@burningalchemist burningalchemist changed the title test: improve reload_test test: rearrange reload test Mar 21, 2026
@burningalchemist burningalchemist changed the title test: rearrange reload test test: refactor reload test Mar 21, 2026
@burningalchemist burningalchemist merged commit fa1cd1a into master Mar 21, 2026
3 checks passed
@burningalchemist burningalchemist deleted the testing/reload branch March 21, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant