Skip to content

Commit 950c644

Browse files
committed
fix test
1 parent 919e913 commit 950c644

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

conftest.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import random
32
import sys
43

54
import pytest
@@ -35,35 +34,11 @@ def beaker(workspace_name):
3534
return beaker_client
3635

3736

38-
def _get_free_cluster(beaker: Beaker) -> str:
39-
choices = [
40-
"ai2/general-cirrascale",
41-
"ai2/allennlp-cirrascale",
42-
"ai2/aristo-cirrascale",
43-
"ai2/mosaic-cirrascale",
44-
"ai2/s2-cirrascale",
45-
]
46-
random.shuffle(choices)
47-
for cluster in choices:
48-
utilization = beaker.cluster.utilization(cluster)
49-
if utilization.queued_jobs == 0:
50-
logger.info("Found suitable on-prem cluster '%s'", cluster)
51-
return cluster
52-
return "ai2/general-cirrascale"
53-
54-
55-
@pytest.fixture()
56-
def beaker_cluster_name(beaker: Beaker) -> str:
57-
return _get_free_cluster(beaker)
58-
59-
6037
if __name__ == "__main__":
6138
beaker_client = Beaker.from_env()
6239
assert len(sys.argv) == 2
6340
fixture = sys.argv[-1]
6441
if fixture == "run_name":
6542
print(_get_unique_name())
66-
elif fixture == "cluster":
67-
print(_get_free_cluster(beaker_client))
6843
else:
6944
raise ValueError(f"Bad fixture argument '{fixture}'")

tests/main_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_version():
1414
assert VERSION in result.stdout
1515

1616

17-
def test_dry_run(workspace_name: str, beaker_cluster_name: str, run_name: str):
17+
def test_dry_run(workspace_name: str, run_name: str):
1818
result = subprocess.run(
1919
[
2020
"gantry",
@@ -26,8 +26,6 @@ def test_dry_run(workspace_name: str, beaker_cluster_name: str, run_name: str):
2626
run_name,
2727
"--workspace",
2828
workspace_name,
29-
"--cluster",
30-
beaker_cluster_name,
3129
"--yes",
3230
"--",
3331
"python",

0 commit comments

Comments
 (0)