Skip to content

Commit c75e31f

Browse files
authored
testing: speed up exr-decreasingy test (#5121)
This test did more than was really necessary. It resized a small image (twice) to get big images, but the contents didn't matter, so just using a gradient is good enough. Also, we can check results just by using the hash of the image contents, don't need to do extra idiff calls. It's barely noticeable on a regular release build, since the whole test was only a couple seconds on my laptop and maybe 15 seconds on the GH runners. But for the CI "sanitize" test, this cuts about 30 seconds from this test! Every little bit helps, the sanitize tests are usually the last to complete in a CI run. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent ac3a9e7 commit c75e31f

File tree

3 files changed

+26
-73
lines changed

3 files changed

+26
-73
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
increasingY.exr : 4080 x 3072, 3 channel, half openexr
2+
SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856
3+
increasingY-copy.exr : 4080 x 3072, 3 channel, half openexr
4+
SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856
5+
decreasingY.exr : 4080 x 3072, 3 channel, half openexr
6+
SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856
7+
decreasingY-copy.exr : 4080 x 3072, 3 channel, half openexr
8+
SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856
Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,8 @@
1-
Reading increasingY-resize.exr
2-
increasingY-resize.exr : 4080 x 3072, 3 channel, half openexr
3-
channel list: R, G, B
4-
compression: "zip"
5-
Orientation: 1 (normal)
6-
PixelAspectRatio: 1
7-
ResolutionUnit: "in"
8-
screenWindowCenter: 0, 0
9-
screenWindowWidth: 1
10-
XResolution: 72
11-
YResolution: 72
12-
oiio:subimages: 1
13-
openexr:lineOrder: "increasingY"
14-
Reading increasingY-copy.exr
1+
increasingY.exr : 4080 x 3072, 3 channel, half openexr
2+
SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB
153
increasingY-copy.exr : 4080 x 3072, 3 channel, half openexr
16-
channel list: R, G, B
17-
compression: "zip"
18-
Orientation: 1 (normal)
19-
PixelAspectRatio: 1
20-
ResolutionUnit: "in"
21-
screenWindowCenter: 0, 0
22-
screenWindowWidth: 1
23-
XResolution: 72
24-
YResolution: 72
25-
oiio:subimages: 1
26-
openexr:lineOrder: "increasingY"
27-
Reading decreasingY-resize.exr
28-
decreasingY-resize.exr : 4080 x 3072, 3 channel, half openexr
29-
channel list: R, G, B
30-
compression: "zip"
31-
Orientation: 1 (normal)
32-
PixelAspectRatio: 1
33-
ResolutionUnit: "in"
34-
screenWindowCenter: 0, 0
35-
screenWindowWidth: 1
36-
XResolution: 72
37-
YResolution: 72
38-
oiio:subimages: 1
39-
openexr:lineOrder: "decreasingY"
40-
Reading decreasingY-copy.exr
4+
SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB
5+
decreasingY.exr : 4080 x 3072, 3 channel, half openexr
6+
SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB
417
decreasingY-copy.exr : 4080 x 3072, 3 channel, half openexr
42-
channel list: R, G, B
43-
compression: "zip"
44-
Orientation: 1 (normal)
45-
PixelAspectRatio: 1
46-
ResolutionUnit: "in"
47-
screenWindowCenter: 0, 0
48-
screenWindowWidth: 1
49-
XResolution: 72
50-
YResolution: 72
51-
oiio:subimages: 1
52-
openexr:lineOrder: "decreasingY"
53-
Comparing "increasingY-copy.exr" and "decreasingY-copy.exr"
54-
PASS
55-
Comparing "increasingY-resize.exr" and "decreasingY-resize.exr"
56-
PASS
8+
SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB

testsuite/openexr-decreasingy/run.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,24 @@
1414
redirect = " >> out.txt 2>&1 "
1515

1616
# Create reference images stored in increasingY order (default)
17-
# Resizing to a large image size to ensure scanline chunking logic is triggered.
18-
command += oiiotool("../common/tahoe-tiny.tif --resize 4080x3072 -o increasingY-resize.exr")
19-
command += info_command("increasingY-resize.exr", safematch=True, hash=False)
20-
command += oiiotool("increasingY-resize.exr -o increasingY-copy.exr")
21-
command += info_command("increasingY-copy.exr", safematch=True, hash=False)
17+
# Use a large image size to ensure scanline chunking logic is triggered.
18+
command += oiiotool("-pattern:type=half fill:topleft=1,0,0:topright=0,1,0:bottomleft=0,0,1:bottomright=1,1,1 4080x3072 3 -o increasingY.exr")
19+
command += info_command("increasingY.exr", safematch=True, hash=True, verbose=False)
20+
# Just do a straight copy of it via oiiotool, all default operations
21+
command += oiiotool("increasingY.exr -o increasingY-copy.exr")
22+
command += info_command("increasingY-copy.exr", safematch=True, hash=True, verbose=False)
2223

23-
# Create an image in decreasing order via resizing (Tests ImageOutput::write_image() logic)
24-
command += oiiotool("../common/tahoe-tiny.tif --resize 4080x3072 --attrib openexr:lineOrder decreasingY -o decreasingY-resize.exr")
25-
command += info_command("decreasingY-resize.exr", safematch=True, hash=False)
24+
# Create an image in decreasing order (Tests ImageOutput::write_image() logic)
25+
command += oiiotool("-pattern:type=half fill:topleft=1,0,0:topright=0,1,0:bottomleft=0,0,1:bottomright=1,1,1 4080x3072 3 --attrib openexr:lineOrder decreasingY -o decreasingY.exr")
26+
command += info_command("decreasingY.exr", safematch=True, hash=True, verbose=False)
2627

2728
# Create an image in decreasing order via copying a reference image. (Tests ImageBuf::write() logic)
28-
command += oiiotool("decreasingY-resize.exr --attrib openexr:lineOrder decreasingY -o decreasingY-copy.exr")
29-
command += info_command("decreasingY-copy.exr", safematch=True, hash=False)
29+
command += oiiotool("decreasingY.exr --attrib openexr:lineOrder decreasingY -o decreasingY-copy.exr")
30+
command += info_command("decreasingY-copy.exr", safematch=True, hash=True, verbose=False)
3031

31-
# They should match
32-
command += diff_command("increasingY-copy.exr", "decreasingY-copy.exr")
33-
command += diff_command("increasingY-resize.exr", "decreasingY-resize.exr")
32+
# The hashes should all match!
3433

3534
# Outputs to check against references.
36-
# This makes sure the images look the same since the line order is a storage detail and should not
37-
# change how the image actually looks. These comparisons help verify chunk order and scanlines are
38-
# processed properly.
3935
outputs = [
4036
"out.txt"
4137
]
42-
43-
44-
#print "Running this command:\n" + command + "\n"

0 commit comments

Comments
 (0)