Skip to content

ROCgdb test script review#117

Open
lumachad wants to merge 8 commits intoamd-stagingfrom
users/lumachad/amd-staging/ci_script_improvements
Open

ROCgdb test script review#117
lumachad wants to merge 8 commits intoamd-stagingfrom
users/lumachad/amd-staging/ci_script_improvements

Conversation

@lumachad
Copy link
Copy Markdown
Collaborator

@lumachad lumachad commented May 7, 2026

This PR contains a few improvements and changes based on previews reviews. We should go through the entire code and make sure everyone is happy.

Fix test_rocgdb.py optimization flag parsing with spaces

Quote optimization flags in CFLAGS_FOR_TARGET to prevent shell argument
splitting when values contain spaces (e.g., "--optimization=-O3 -g").

Add ROCgdb test ignore list JSON configuration and generation

Replace hardcoded XFAILED_TESTS dictionary with JSON-based ignore list
management by creating a new rocgdb_ignore_list.json file containing the
update list of ignore entries. Add load_ignore_list_from_json() to read ignore
lists from JSON files and generate_ignore_list() to export test failures
as ignore lists.

Introduce --ignore-list-file option to specify custom ignore list locations
and --output-ignore-list-file option to export failures to JSON format.
Update print_configuration() to display the ignore list file status.

This enables dynamic ignore list management and allows regenerating ignore
lists from test run failures for easier maintenance.

Remove unused suffix from CATEGORY_DISPLAY configuration

Simplified the category display dictionary from tuples of (prefix, suffix)
to just prefix values, since the suffix was never used.

Fix _run_command docstring to clarify exit/raise behavior

The function only exits with code 1 when error_msg is provided. When
error_msg is None, it re-raises the CalledProcessError instead. Also
clarified that failure means non-zero exit status.

Rename --dump-failed-test-log to --skip-failed-test-log for clarity

The original flag name was misleading: specifying --dump-failed-test-log
actually disabled the log dump due to action="store_false". Rename to
--skip-failed-test-log to match the actual behavior, making the interface
more intuitive.

Clarify --tests help text to document automatic /*.exp expansion

The --tests argument accepts both individual .exp files and directories.
When a directory is provided, the expand_test_paths function automatically
appends /*.exp to find all test files. Update the help text to document
this behavior so users know they don't need to add the suffix manually.

Move timeout and max-retries validation to argparse type functions

Replace manual validation checks with custom type functions passed to
add_argument. This follows standard argparse patterns and provides
immediate validation feedback when arguments are parsed.

Added _positive_int() for --max-failed-retries and _timeout_value()
for --timeout, removing the redundant manual checks after parse_args().

Change tests parameter from string to List[str] for better type safety

Refactor cleanup_old_entries and update_results to accept List[str]
instead of space-separated strings. The run_tests function now works
with lists internally and only joins to space-separated format when
needed for the make command.

This improves type safety and makes the code clearer by keeping the
space-separated string conversion at the boundary where it's required.

lumachad and others added 8 commits May 7, 2026 06:14
Quote optimization flags in CFLAGS_FOR_TARGET to prevent shell argument
splitting when values contain spaces (e.g., "--optimization=-O3 -g").

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Replace hardcoded XFAILED_TESTS dictionary with JSON-based ignore list
management by creating a new rocgdb_ignore_list.json file containing the
update list of ignore entries. Add load_ignore_list_from_json() to read ignore
lists from JSON files and generate_ignore_list() to export test failures
as ignore lists.

Introduce --ignore-list-file option to specify custom ignore list locations
and --output-ignore-list-file option to export failures to JSON format.
Update print_configuration() to display the ignore list file status.

This enables dynamic ignore list management and allows regenerating ignore
lists from test run failures for easier maintenance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplified the category display dictionary from tuples of (prefix, suffix)
to just prefix values, since the suffix was never used.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
The function only exits with code 1 when error_msg is provided. When
error_msg is None, it re-raises the CalledProcessError instead. Also
clarified that failure means non-zero exit status.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
The original flag name was misleading: specifying --dump-failed-test-log
actually disabled the log dump due to action="store_false". Rename to
--skip-failed-test-log to match the actual behavior, making the interface
more intuitive.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
The --tests argument accepts both individual .exp files and directories.
When a directory is provided, the expand_test_paths function automatically
appends /*.exp to find all test files. Update the help text to document
this behavior so users know they don't need to add the suffix manually.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Replace manual validation checks with custom type functions passed to
add_argument. This follows standard argparse patterns and provides
immediate validation feedback when arguments are parsed.

Added _positive_int() for --max-failed-retries and _timeout_value()
for --timeout, removing the redundant manual checks after parse_args().

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Refactor cleanup_old_entries and update_results to accept List[str]
instead of space-separated strings. The run_tests function now works
with lists internally and only joins to space-separated format when
needed for the make command.

This improves type safety and makes the code clearer by keeping the
space-separated string conversion at the boundary where it's required.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
@lumachad lumachad requested a review from lancesix May 7, 2026 13:37
@lumachad lumachad self-assigned this May 7, 2026
@lumachad lumachad requested a review from a team as a code owner May 7, 2026 13:37
@lumachad
Copy link
Copy Markdown
Collaborator Author

lumachad commented May 7, 2026

FYI, the changes in the testing script won't be reflected in the CI. Manual testing required.

@lumachad lumachad added the ci:skip Skip all pre-commit / CI jobs while the label is up label May 7, 2026
@lumachad
Copy link
Copy Markdown
Collaborator Author

lumachad commented May 7, 2026

Marking ci:skip as this won't get auto-tested anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:skip Skip all pre-commit / CI jobs while the label is up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant