MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / _resolve_bazel_path

Function _resolve_bazel_path

py/conftest.py:197–214  ·  view source on GitHub ↗

Resolve a path through Bazel Rlocation if the given path does not exist on disk. When running under Bazel, paths from ctx.expand_location are relative to the execroot (e.g. 'external/+ext+repo/binary') which may not resolve from the test process CWD. Rlocation maps them to their absolut

(path)

Source from the content-addressed store, hash-verified

195
196
197def _resolve_bazel_path(path):
198 """Resolve a path through Bazel Rlocation if the given path does not exist on disk.
199
200 When running under Bazel, paths from ctx.expand_location are relative to
201 the execroot (e.g. 'external/+ext+repo/binary') which may not resolve from
202 the test process CWD. Rlocation maps them to their absolute runfiles location.
203 """
204 if not path:
205 return path
206 cleaned = path.strip("'")
207 if Path(cleaned).exists():
208 return path
209 if Runfiles is not None and cleaned.startswith("external/"):
210 r = Runfiles.Create()
211 resolved = r.Rlocation(cleaned.removeprefix("external/"))
212 if resolved:
213 return resolved
214 return path
215
216
217# Maps the test driver name to its (browserName, vendor options key).

Callers 7

chromium_driverMethod · 0.90
chromium_driverMethod · 0.90
driver_finderFunction · 0.90
_pinned_grid_argsFunction · 0.85
browser_pathMethod · 0.85
driver_pathMethod · 0.85
driver_executableFunction · 0.85

Calls 2

existsMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected