dan jatnieks created CASSANDRA-21225:
----------------------------------------

             Summary: Port dtest upgrade test filtering and logger fixes from 
DataStax fork
                 Key: CASSANDRA-21225
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21225
             Project: Apache Cassandra
          Issue Type: Improvement
          Components: Test/dtest/python
            Reporter: dan jatnieks


Port commit {{115c35e1890888c33278eeeca7a90e0386a0076c}} from the DataStax 
cassandra-dtest fork to Apache cassandra-dtest. This commit adds composable 
filtering options for the upgrade test matrix and fixes logger bugs.
h3. Summary

This change adds CLI options to narrow the upgrade test matrix scope while 
preserving existing {{VersionSelectionStrategy}} behavior, enabling targeted 
testing of specific upgrade paths without running the full matrix. It also 
fixes logger formatting bugs that could cause test failures.
h3. Changes
h4. 1. Add CLI filter options ({{{}conftest.py{}}})

{{{}--upgrade-source-filter{}}}: Comma-separated list of source version names 
to test
{{{}--upgrade-target-filter{}}}: Comma-separated list of target version names 
to test
Filters narrow results after applying {{--upgrade-version-selection}} strategy
h4. 2. Implement two-step filtering ({{{}upgrade_tests/upgrade_manifest.py{}}})

The {{build_upgrade_pairs()}} function now:

Applies {{VersionSelectionStrategy}} based on {{--upgrade-version-selection}} 
(e.g., {{{}INDEV{}}}, {{{}BOTH{}}}, {{{}ALL{}}})
Filters source versions (if {{--upgrade-source-filter}} specified)
Filters target versions (if {{--upgrade-target-filter}} specified)
Removes entries with no valid destinations after filtering
Logs the applied strategy and filters for debugging
h4. 3. Fix logger.error format bugs 
({{{}upgrade_tests/upgrade_through_versions_test.py{}}})

Fixed {{logger.error()}} calls to use {{exc_info=True}} instead of passing 
exception as positional argument
Added {{timeout=30}} parameter to {{session.execute()}} in {{data_checker()}} 
to prevent indefinite hangs
Impact: Previously, incorrect {{logger.error()}} usage could cause 
{{{}TypeError{}}}, preventing the {{raise}} statement from executing and 
leaving subprocesses running in a broken state
h4. 4. Add version compatibility check ({{{}dtest_setup.py{}}})

Remove {{storage_compatibility_mode}} config option for Cassandra versions < 
5.0 (this option only exists in 5.0+)
h3. Example Usage

Test all indev→indev upgrade paths (existing behavior):
{code:bash}
pytest upgrade_tests/ --upgrade-version-selection=indev
{code}
Test only indev sources upgrading to trunk:
{code:bash}
pytest upgrade_tests/ --upgrade-version-selection=indev 
--upgrade-target-filter=trunk
{code}
Test specific source upgrading to specific target:
{code:bash}
pytest upgrade_tests/ --upgrade-source-filter=cassandra-3.0 
--upgrade-target-filter=cassandra-4.0
{code}
h3. Files Changed

{{conftest.py}} - Add CLI options
{{dtest_setup.py}} - Add version compatibility check
{{upgrade_tests/upgrade_manifest.py}} - Implement filtering logic
{{upgrade_tests/upgrade_through_versions_test.py}} - Fix logger bugs and add 
timeout
h3. Original Commit

DataStax fork commit: {{115c35e1890888c33278eeeca7a90e0386a0076c}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to