Commit Graph

5 Commits

Author SHA1 Message Date
Kefu Chai
1632fbbef9 test/cql-pytest: match error message formated using {fmt}
currently, our homebrew formatter formats `std::map` like

{{k1, v1}, {k2, v2}}

while {fmt} formats a map like:

{k1: v1, k2: v2}

and if the type of key/value is string, {fmt} quotes it, so a

compaction strategy option is formatted like

{"max_threshold": "1"}

before switching the formatter to the ones supported by {fmt},
let's update the test to match with the new format. this should
reduce the overhead of reviewing the change of switching the
formatter. we can revert this change, and use a simpler approach
after the change of formatter lands.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-29 08:07:59 +08:00
Kefu Chai
8f47fcedf6 test/cql-pytest: extract scylla_error() for not allowed options test
currently, our homebrew formatter formats `std::map` like

{{k1, v1}, {k2, v2}}

while {fmt} formats a map like:

{k1: v1, k2: v2}

and if the type of key/value is string, {fmt} quotes it, so a

compaction strategy option is formatted like

{"max_threshold": "1"}

as we are switching to the formatters provided by {fmt}, would be
better to support its convention directly.

so, in this change, to prepare the change, before migrating to
{fmt}, let's refactor the test to support both formats by
extracting a helper to format the error message, so that we can
change it to emit both formats.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-29 08:03:02 +08:00
Ferenc Szili
455959b80e cql-pytest/test_compaction_strategy_validation.py
Adds the check for the wording of the validation error on invalid
values of unchecked_tombstone_compaction
2024-03-22 11:22:56 +01:00
Nadav Har'El
c4d3e08987 test/cql-pytest: partial fix for test_compaction_strategy_validation.py on Cassandra
Yet another test file in cql-pytest which failed when run on Cassandra
(via test/cql-pytest/run-cassandra).

This patch is only a partial fix - it fixes trivial differences in error
messages, but some potentially-real differences remain so three of the
tests still fail:

1. Trying to set tombstone_threshold to 5.5 is an error in ScyllaDB
   ("must be between 0.0 and 1.0") but allowed in Cassandra.

2. Trying to set bucket_low to 0.0 is an error in ScyllaDB, giving the
   wrong-looking error message "must be between 0.0 and 1.0" (so 0.0 should
   have been fine?!) but allowed in Cassandra.

3. Trying to set timestamp_resolution to SECONDS is an error in ScyllaDB
   ("invalid timestamp resolution SECONDS") but allowed in Cassandra.
   I don't think anybody wants to actually use "SECONDS", but it seems
   legal in Cassandra, so do we need to support it?

The patch also simplifies the test to use cql-pytest's util.py, instead
of cassandra_tests/porting.py. The latter was meant to make porting
existing Cassandra tests easier - not for writing new ones - and made
using a regular expression for testing error messages harder so I
switched to using pytest.raises() whose "match=" accepts a regular
expression.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2023-11-14 21:27:12 +02:00
Aleksandra Martyniuk
14598fdfdd test: add test for compaction strategy validation 2023-09-13 16:59:40 +02:00