Skip to content

Commit dfdde79

Browse files
committed
A bunch of annoying logic to figure out whether admin is there
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.
1 parent b5a8d19 commit dfdde79

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

gel/_testbase.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,22 @@ def _start_cluster(*, cleanup_atexit=True):
9696
capture_output=True,
9797
text=True,
9898
)
99-
print("VERSION", version_res.stdout)
100-
is_gel = version_res.stdout.startswith('gel-server,')
10199

102-
role = 'admin' if is_gel else 'edgedb'
100+
version_line = version_res.stdout
101+
print("VERSION", version_line)
102+
is_gel = version_line.startswith('gel-server,')
103+
104+
# The default role became admin in nightly build 9024 for 6.0
105+
if is_gel:
106+
if '6.0-dev' in version_line:
107+
rev = int(version_line.split('.')[2])
108+
has_admin = rev >= 9024
109+
else:
110+
has_admin = True
111+
else:
112+
has_admin = False
113+
114+
role = 'admin' if has_admin else 'edgedb'
103115
args = [
104116
gel_server,
105117
"--temp-dir",

0 commit comments

Comments
 (0)