Repository navigation
imagej/image-ops2 test speedups - #65
Conversation
Significantly speeds up tests
It is unnecessarily costly to load these images before EVERY test, especially since they are unused in many tests.
| public abstract class AbstractOpTest{ | ||
|
|
||
| protected static OpEnvironment ops; | ||
| protected static OpEnvironment ops = new DefaultOpEnvironment(); |
There was a problem hiding this comment.
Maybe add final here, just in case?
There was a problem hiding this comment.
Done in 62aa496. @hinerm Do you see any problem with doing this? I am not sure, but I could imagine that pushing the data structure construction earlier, to class initialization time rather than whenever JUnit calls the BeforeClass methods, could potentially alter behavior? Everything does still pass for me locally though.
There was a problem hiding this comment.
I am not sure, but I could imagine that pushing the data structure construction earlier, to class initialization time rather than whenever JUnit calls the BeforeClass methods, could potentially alter behavior?
That's a good point, but since it's only in the tests, we can change it later if we find that it's an issue, no?
There was a problem hiding this comment.
since it's only in the tests, we can change it later if we find that it's an issue, no?
Definitely; that was my thinking as well.
| public abstract class AbstractOpTest{ | ||
|
|
||
| protected static OpEnvironment ops; | ||
| protected static OpEnvironment ops = new DefaultOpEnvironment(); |
There was a problem hiding this comment.
Done in 62aa496. @hinerm Do you see any problem with doing this? I am not sure, but I could imagine that pushing the data structure construction earlier, to class initialization time rather than whenever JUnit calls the BeforeClass methods, could potentially alter behavior? Everything does still pass for me locally though.
Reduces imagej-ops unit test time required by a factor of three.
See scijava/scijava#102