Skip to content

Commit

Permalink
add test for executable size
Browse files Browse the repository at this point in the history
  • Loading branch information
sullyj3 committed Aug 4, 2024
1 parent 9efeade commit e3f2309
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import subprocess
import json
import pytest
import warnings

from contextlib import contextmanager

Expand Down Expand Up @@ -95,5 +96,18 @@ def test_sand_operations(daemon, client_socket, test_input, expected_output):
response = msg_and_response(test_input, client_socket)
assert response == expected_output, f"Test failed. Expected {expected_output}, got {response}"

'''
Need to get this down. I think by eliminating any `import Lean`.
Hopefully we'll be able to make the warn_threshold the fail_threshold
'''
def test_executable_size():
exe_size = os.path.getsize("./.lake/build/bin/sand")
warn_threshold = 15_000_000
if exe_size > warn_threshold:
warnings.warn(f"Sand executable size is more than 20MB")

fail_threshold = 100_000_000
assert exe_size < fail_threshold, f"Sand executable size is more than 100MB"

if __name__ == "__main__":
pytest.main([__file__])

0 comments on commit e3f2309

Please sign in to comment.