[miopen] Users/randyspauldingamd/gtest fixturemap#3706
Closed
randyspauldingamd wants to merge 4 commits intodevelopfrom
Closed
[miopen] Users/randyspauldingamd/gtest fixturemap#3706randyspauldingamd wants to merge 4 commits intodevelopfrom
randyspauldingamd wants to merge 4 commits intodevelopfrom
Conversation
…ndyspauldingamd/dep_parser_monorepo
| return ( | ||
| file_path.is_file() | ||
| and os.access(file_path, os.X_OK) | ||
| and not file_path.name.startswith('.') # skip hidden files |
Author
There was a problem hiding this comment.
TODO: detect gtest in the binary
7 tasks
Contributor
|
Imported to ROCm/rocm-libraries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
This is the 2nd step in applying the dependency parser to MIOpen (and by extension, all mathlibs in TheRock). It started from #3686. I wasn't able to get a clean diff, so this includes those changes as well.
The scenario is a repo that combines many (hundreds of) individual gtest files into a single test binary. The existing change detection can be adapted by using
--gtest_filterand re-mapping from "a list of test files that need to be ran" to "a list of gtest fixtures that need to be ran." In theory, this can be done statically by parsing all of the test files and extracting the fixture names directly from theTEST,TEST_F, andINSTANTIATE_TEST_SUITE_Pmacros. However, this isn’t straightforward in MIOpen, because many of the test names are built up with helper macros.Another option would be to use gtest internals to extract them at runtime. This is not ideal because these can change without warning.
Setting those solutions aside for now, another alternative is to build the discrete tests and run them all with
--gtest_list_tests. This requires much less lead effort since MIOpen does have this capability. This PR enables collection of the data, definition of the mapping file, and construction of thegtest_filter.all_gtest_fixtures.pywhich extracts all gtest fixtures from all executables in a single folder and constructs a flat map of executable name to the list of gtest fixtures it contains.selective_test_filter.py,--fixturemapwhich provides the filename and enables the filter construction.gtest_filterand adds it to the output json.Checklist
Please put an
xinto the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.clang-formaton all changed filesDiscussion
Workflow:
0. Create a symlink to dependency parser, ala:
sudo ln -s /home/<user>/repos/composable_kernel/script/dependency-parser /depmiopen/build_all)<miopen/build_all># ninja tests(this produces a few hundred gtest binaries)<miopen/build_all># python3 /dep/src/all_gtest_fixtures.py bin gtests.txtmiopen/build_one), run MIOpen CMake with MIOPEN_TEST_DISCRETE=OFF, and start building the single gtest binarymiopen_gtest<miopen/build_all># python3 /dep/main.py parse build/build.ninja<miopen/build_all># python3 /dep/main.py select enhanced_dependency_mapping.json <base_sha> <change_sha> --fixturemap gtests.txtalias gtf="python3 -c \"import json; print(json.load(open('tests_to_run.json'))['gtest_filter'])\""../build_one/bin/miopen_gtest --gtest_filter=$(gtf)