Commit Graph

4 Commits

Author SHA1 Message Date
Raphael Torquato 26165be2d5
test: add unit tests for validate() and NewFromMap() functions (#3086)
This addresses issue #416 by adding comprehensive unit tests for the
config utility functions:

- TestValidate: Tests validation logic for MinInstances/MaxInstances,
  Workers count, ConnectionPooler instances, and user conflicts
- TestNewFromMap: Tests config creation from map with defaults,
  custom values, duration/boolean/map/slice parsing, and panic behavior
- TestMain: Sets OPERATOR_NAMESPACE env var for testing outside K8s

The tests cover both valid configurations and error cases.

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-02 10:45:44 +02:00
Oleksii Kliukin 086ead03f5 Warn about attempts to use escape quotes. 2017-11-22 10:43:35 +01:00
Oleksii Kliukin 6b2f5071f7 Special case for search_path in user options.
- search_path accepts a list of values that cannot be quoted, as
  quoting would make PostgreSQL interpret the result as a single
  value. Since we require quoting of values with commas in the
  operator's configMap in order to avoid confusing them with the
  separate map entities, we need to strip those quotes before
  passing the value to PostgreSQL.
- make ftm run
2017-11-22 10:43:35 +01:00
Oleksii Kliukin 2079d811b4 Add tests for the string splitting function. 2017-11-22 10:43:35 +01:00