Skip to content

Commit

Permalink
A bunch of annoying logic to figure out whether admin is there
Browse files Browse the repository at this point in the history
Or I could just wait until it is in all live nightlies and never care
again, but oh well.
It's probably fine if other bindings do that.
  • Loading branch information
msullivan committed Nov 26, 2024
1 parent b5a8d19 commit dfdde79
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions gel/_testbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,22 @@ def _start_cluster(*, cleanup_atexit=True):
capture_output=True,
text=True,
)
print("VERSION", version_res.stdout)
is_gel = version_res.stdout.startswith('gel-server,')

role = 'admin' if is_gel else 'edgedb'
version_line = version_res.stdout
print("VERSION", version_line)
is_gel = version_line.startswith('gel-server,')

# The default role became admin in nightly build 9024 for 6.0
if is_gel:
if '6.0-dev' in version_line:
rev = int(version_line.split('.')[2])
has_admin = rev >= 9024
else:
has_admin = True
else:
has_admin = False

role = 'admin' if has_admin else 'edgedb'
args = [
gel_server,
"--temp-dir",
Expand Down

0 comments on commit dfdde79

Please sign in to comment.