Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.3.0rc2
- Check path validity for browser with is_file()
- Add option --verify_local in choreo_diagnose and fix local reporting logic
v1.3.0rc1
- We now look for old download path as well as new download path
v1.3.0rc0
Expand Down
5 changes: 3 additions & 2 deletions src/choreographer/browsers/chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,12 @@ def __init__(

if not self.path:
self.path = Chromium.find_browser(skip_local=self.skip_local)
if not self.path:
if not self.path or not Path(self.path).is_file():
raise ChromeNotFoundError(
"Browser not found. You can use get_chrome() or "
"choreo_get_chrome from bash. please see documentation. "
f"Local copy ignored: {self.skip_local}.",
f"Local copy ignored: {self.skip_local}. ",
f"Path calculated:: {self.path}.",
)
_logger.info(f"Found chromium path: {self.path}")

Expand Down
11 changes: 10 additions & 1 deletion src/choreographer/cli/_cli_utils_no_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ def diagnose() -> None:
)
parser.add_argument("--no-run", dest="run", action="store_false")
parser.add_argument("--show", dest="headless", action="store_false")
parser.add_argument(
"--verify_local",
dest="verify_local",
action="store_true",
)
parser.set_defaults(run=True)
parser.set_defaults(headless=True)
parser.set_defaults(verify_local=False)
args, _ = parser.parse_known_args()
run = args.run
headless = args.headless
verify_local = args.verify_local
fail = []
print("*".center(50, "*"))
print("SYSTEM:".center(50, "*"))
Expand All @@ -56,12 +63,14 @@ def diagnose() -> None:
print("BROWSER:".center(50, "*"))
try:
local_path = Chromium.find_browser(skip_local=False, verify_local=True)
if not local_path or Path(local_path).exists():
if not local_path or not Path(local_path).exists():
print(f"Local doesn't exist at {local_path}")
else:
print(f"Found local: {local_path}")
except RuntimeError:
print("Didn't find local.")
if verify_local:
raise
browser_path = Chromium.find_browser(skip_local=True)
print(browser_path)
print("*".center(50, "*"))
Expand Down