Skip to content
Snippets Groups Projects
Commit bf513903 authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

Strip tests, but keep "make check" working


This patch reverts commit 831b017e,
which stopped stripping the tests in order to fix "make check", and
instead just fixes the latter.

The fix is trivial: "make check" finds the list of tests not from the
image or the manifest, but from the list of files in build/release/tests.
So all we need to do is to subtract from that list the list of *-stripped.so.

As to the question *why* to strip the tests:

In the past, several people raised the desire to include our tests on some
production images (not just the "make image=tests" one). The rationale behind
this is that if the image encounters unexpected problems on some cloud, we
can run the included tests to see if something if it can find a problem.

I'm not sure this is a compelling reason to include tests in every image,
but let's at least not rule the option to include them on some image.

The difference in size between the stripped and unstripped tests is huge:
Currently, unstripped tests total 18 MB, while the stripped are just 2.2 MB.
That's more than 8 times smaller! We can easily imagine that in the future
we'll have more tests - perhaps many, many more tests, making this difference
even more significant.

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent e902d578
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,8 @@ blacklist = [
java_test = Test('java', '/java.so -cp /tests/java/tests.jar:/tests/java/isolates.jar \
-Disolates.jar=/tests/java/isolates.jar org.junit.runner.JUnitCore io.osv.AllTests')
standard_tests = [StandardOSvTest(os.path.basename(x)) for x in glob.glob('build/release/tests/tst-*.so')]
test_files = set(glob.glob('build/release/tests/tst-*.so')) - set(glob.glob('build/release/tests/*-stripped.so'))
standard_tests = [StandardOSvTest(os.path.basename(x)) for x in test_files]
tests = sorted([java_test] + standard_tests, key=attrgetter('name'))
def scan_errors(s):
......
......@@ -90,16 +90,10 @@ def upload(osv, manifest, depends):
+ cpio_field(0, 8) # check
+ filename + '\0')
def is_strippable(filename):
if not filename.endswith(".so"):
return False
if os.path.basename(filename).startswith("tst-"):
return False
return filename[0] != "/" or filename.startswith(os.getcwd())
def strip_file(filename):
stripped_filename = filename
if is_strippable(filename):
if(filename.endswith(".so") and \
(filename[0] != "/" or filename.startswith(os.getcwd()))):
stripped_filename = filename[:-3] + "-stripped.so"
if(not os.path.exists(stripped_filename) \
or (os.path.getmtime(stripped_filename) < \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment