-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix several tests on Windows. #11048
Conversation
Most of these were comparing paths using string comparison, which breaks when comparing Unix paths with Windows paths or comparing symlinks with realpaths.
self.assertEqual( | ||
config, | ||
BenchmarkConfig(root_benchmark_dir=os.path.join(self.build_dir.name, | ||
"benchmark_suites"), | ||
benchmark_results_dir=os.path.join( | ||
per_commit_tmp_dir, "benchmark-results"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test got messy to update, since BenchmarkConfig
calls os.path.realpath
in many places.
This led to failures when comparing paths like
'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\tmpm6qhk0oy\\benchmark_suites'
'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpm6qhk0oy\\benchmark_suites'
Could we just add a way to "assert equal, after canonicalizing all paths"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we stored pathlib.Path
objects instead of strings, the comparisons should be safer too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the current solution. We should refactor the tool to take pathlib.Path instead eventually. Can you file a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build_tools/python/e2e_test_artifacts/cmake_generator/iree_rule_generator.py
Outdated
Show resolved
Hide resolved
build_tools/python/e2e_test_artifacts/cmake_generator/iree_rule_generator_test.py
Outdated
Show resolved
Hide resolved
self.assertEqual( | ||
config, | ||
BenchmarkConfig(root_benchmark_dir=os.path.join(self.build_dir.name, | ||
"benchmark_suites"), | ||
benchmark_results_dir=os.path.join( | ||
per_commit_tmp_dir, "benchmark-results"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the current solution. We should refactor the tool to take pathlib.Path instead eventually. Can you file a bug?
…1032) Progress on #11009, depends on #11048 Changes: * `build_runtime` + `test_runtime` -> `build_test_runtime` (overhead from repository cloning, artifact upload, and artifact download was taking longer than just running the tests from the same job) * `build_runtime_windows` -> `build_test_runtime_windows` * Runs on `managed-windows-cpu` (larger build machine) * Runs tests, instead of just builds (now that all runtime tests pass on Windows) * Runs on presubmit now too, instead of just postsubmit (the build appears to be stable) Sample run: https://github.com/iree-org/iree/actions/runs/3412369869/jobs/5677798847
Most of these were comparing paths using string comparison, which breaks when comparing Unix paths with Windows paths or comparing symlinks with realpaths.