Skip to content

Conversation

DyanB
Copy link
Contributor

@DyanB DyanB commented Aug 25, 2025

Reference issue: Link

This PR takes care of some of the issues listed in Issue 291

Removed Absolute Paths
Test artifacts can now be retained in a specific directory of your choice / default temp directory

Copy link
Contributor

@stupendoussuperpowers stupendoussuperpowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. This should solve #334.

@rennergade rennergade requested a review from Karan-05 August 25, 2025 18:22
except FileNotFoundError:
pass

# Remove artifacts directory if it was temp and not requested to keep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the script crashes between creating the temp and here, will this linger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have handled script crashing issues by encompassing the cleanup logic in the finally block.

# Prepare artifacts root
created_temp_dir = False
if artifacts_dir_arg:
artifacts_root = artifacts_dir_arg.resolve()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the artifacts dir is requested but not writable, this will behave unexpectedly. Perhaps a try/except would help on it to make sure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added a test for writability and have enclosed directory creation with try/except blocks

parser.add_argument("--testfiles", type=Path, nargs = "+", help="Run one or more specific test files")
parser.add_argument("--debug", action="store_true", help="Enable detailed stdout/stderr output for subprocesses")
parser.add_argument("--artifacts-dir", type=Path, help="Directory to store build artifacts (default: temp dir)")
parser.add_argument("--keep-artifacts", action="store_true", help="Keep artifacts directory after run for troubleshooting")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that clean-results and keep-artifacts are mutually exclusive, conceptually, but there's nothing that prevents a user from asking for both right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added a check so that the user does not provide contradictory flags.

@rennergade rennergade changed the title Got rid of absolute paths and added usage of temp directory to store test artifacts when needed tests: get rid of absolute paths and add usage of temp directory to store test artifacts when needed Aug 26, 2025
@Karan-05
Copy link

test_result.get(f"number_of_{error_types[error_type]}", 0)

The Store counters by machine keys (e.g. number_of_Lind_wasm_Timeout) created in get_empty_result(), but the HTML loops use the labels from error_types:
So we could use
test_result.get(f"number_of_{error_type}", 0)

Copy link
Member

@m-hemmings m-hemmings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concerns look to have been addressed, looks good to me

@rennergade rennergade merged commit 37315f9 into main Sep 11, 2025
2 checks passed
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.

6 participants