Skip to content

Uniform test root path#1435

Merged
JanFSchulte merged 4 commits intomainfrom
uniform-test_root_path
Feb 12, 2026
Merged

Uniform test root path#1435
JanFSchulte merged 4 commits intomainfrom
uniform-test_root_path

Conversation

@jmitrevs
Copy link
Contributor

Description

The keras v3 api tests currently put all the results in the /tmp directory, unlike every other test. This PR just makes it uniform, putting the results in Path(__file__).parent.

I also added v3 to the folder name to not conflict with the v2 versions of the tests.

Type of change

  • Other (Specify) - housekeeping

Tests

Test Configuration:

Checklist

  • I have read the guidelines for contributing.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.

@JanFSchulte JanFSchulte merged commit 2bfb0ae into main Feb 12, 2026
5 checks passed
@JanFSchulte JanFSchulte deleted the uniform-test_root_path branch February 12, 2026 15:59
JanFSchulte pushed a commit that referenced this pull request Feb 13, 2026
* Add utility functions for generating unique test case identifiers in pytest

- Introduced `get_pytest_case_id` and `get_pytest_baseline_name` functions in `conftest.py` to create unique identifiers for parametrized test cases and baseline files.
- Updated multiple test files to utilize these functions for generating output directory names, ensuring consistency and avoiding collisions in test outputs.
- Refactored test function signatures to include the `request` parameter where necessary for accessing the pytest request context.

* pre-commit fixes

* Refactor pytest utility functions for unique test case identifiers

- Introduced `_sanitize_test_id` function to handle sanitization of test identifiers for file paths.
- Updated test files to utilize the new `get_pytest_case_id` function for generating baseline file names, ensuring uniformity in output directory naming.
- Removed obsolete baseline files and added new ones to reflect updated test cases.

* Uniform test root path (#1435) it is actually overridden by my contribution

* pre-commit fixes

* Refactor test case identifier handling in pytest

- Replaced the `get_pytest_case_id` function with a new fixture `test_case_id` to streamline the generation of unique identifiers for test cases.
- Updated multiple test files to utilize the new `test_case_id` fixture, ensuring consistent output directory naming across tests.
- Removed obsolete references to the old identifier function.

* Refactor test function signatures to use `test_case_id`

- Updated the `garnet_models` and `garnet_stack_models` fixtures to replace the `request` parameter with `test_case_id` f

* Refactor pytest fixtures and update baseline files

- Changed the `scope` of some pytest fixtures from 'module' to default.
- Updated the `_sanitize_test_id` function to remove the prefix 'hls4ml/test/pytest/'.
- New mapping of old baselines json file to new naming style.

* Update CI template to include all tar.gz files in the pytest directory

- Modified the paths in the CI template to match all tar.gz files under the test/pytest directory instead of a specific pattern, required with the new naming convention.

---------

Co-authored-by: Jovan Mitrevski <jmitrevs@fnal.gov>
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.

2 participants