Skip to content

Commit 9046454

Browse files
committed
Test build memory limits
1 parent b5d0a7a commit 9046454

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

binderhub/tests/test_build.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,31 @@ def test_sticky_builds_affinity():
201201
].preference.match_expressions[0].values[0] in ("node-a", "node-b")
202202

203203

204+
def test_build_memory_limits():
205+
# Setup some mock objects for the response from the k8s API
206+
mock_k8s_api = _list_image_builder_pods_mock()
207+
208+
build = KubernetesBuildExecutor(
209+
q=mock.MagicMock(),
210+
api=mock_k8s_api,
211+
name="test_build",
212+
namespace="build_namespace",
213+
repo_url="repo",
214+
ref="ref",
215+
build_image="image",
216+
image_name="name",
217+
push_secret="",
218+
memory_limit="2T",
219+
memory_request="123G",
220+
git_credentials="",
221+
docker_host="http://mydockerregistry.local",
222+
node_selector={},
223+
sticky_builds=True,
224+
)
225+
assert build.memory_limit == 2199023255552
226+
assert build.memory_request == 132070244352
227+
228+
204229
def test_git_credentials_passed_to_podspec_upon_submit():
205230
git_credentials = """{
206231
"client_id": "my_username",

0 commit comments

Comments
 (0)