allows the user to choose the location of the tests output data
This prevents pollution of git repository with temporary files and is done via a makefile variable TESTS_OUTPUT_DATA_PATH.
This commit is contained in:
parent
2505d69692
commit
13eb92c76e
|
@ -17,7 +17,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Testing the package...') {
|
stage('Testing the package...') {
|
||||||
steps {
|
steps {
|
||||||
sh 'make FIJI_ROOT_PATH=$(pwd)/Fiji.app RAW_IMAGES_ROOT_PATH=/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images test'
|
sh 'make FIJI_ROOT_PATH=$(pwd)/Fiji.app RAW_IMAGES_ROOT_PATH=/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images TESTS_OUTPUT_DATA_PATH=$TMP/$(whoami)/$JOB_NAME test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Building documentation...') {
|
stage('Building documentation...') {
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -3,6 +3,7 @@ FIJI_ROOT_PATH:=~/soft/Fiji.app
|
||||||
FIJI_EXE_PATH=$(FIJI_ROOT_PATH)/ImageJ-linux64
|
FIJI_EXE_PATH=$(FIJI_ROOT_PATH)/ImageJ-linux64
|
||||||
# RAW_IMAGES_ROOT_PATH:='/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images'
|
# RAW_IMAGES_ROOT_PATH:='/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images'
|
||||||
RAW_IMAGES_ROOT_PATH:=$(shell echo ~/work/lipase/raw-images)
|
RAW_IMAGES_ROOT_PATH:=$(shell echo ~/work/lipase/raw-images)
|
||||||
|
TESTS_OUTPUT_DATA_PATH:=$(shell echo ~/work/lipase/tmp)
|
||||||
LIB_SRC_FILES=$(shell find ./src/lipase -name "*.py")
|
LIB_SRC_FILES=$(shell find ./src/lipase -name "*.py")
|
||||||
PLUGINS_SRC_FILES=$(shell find ./src/ij-plugins -name "*.py")
|
PLUGINS_SRC_FILES=$(shell find ./src/ij-plugins -name "*.py")
|
||||||
LIPASE_VERSION=1.01
|
LIPASE_VERSION=1.01
|
||||||
|
@ -89,7 +90,8 @@ test0001: install
|
||||||
# on macosx : /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './test0001.py'
|
# on macosx : /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './test0001.py'
|
||||||
# /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './tests/test0001.py' "lipase_src_root_path='$(pwd)',raw_images_root_path='/Users/graffy/ownCloud/ipr/lipase/raw-images'"
|
# /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --ij2 --headless --run './tests/test0001.py' "lipase_src_root_path='$(pwd)',raw_images_root_path='/Users/graffy/ownCloud/ipr/lipase/raw-images'"
|
||||||
echo 2 > '/tmp/test_result.txt' ; \
|
echo 2 > '/tmp/test_result.txt' ; \
|
||||||
$(FIJI_EXE_PATH) --ij2 --headless --run './tests/test0001.py' "raw_images_root_path='$(RAW_IMAGES_ROOT_PATH)'" ; \
|
mkdir -p $(TESTS_OUTPUT_DATA_PATH)
|
||||||
|
$(FIJI_EXE_PATH) --ij2 --headless --run './tests/test0001.py' "raw_images_root_path='$(RAW_IMAGES_ROOT_PATH)',tests_output_data_path='$(TESTS_OUTPUT_DATA_PATH)'" ; \
|
||||||
ERROR_CODE=$$? ; \
|
ERROR_CODE=$$? ; \
|
||||||
echo "Fiji 's return code : $$ERROR_CODE" ; \
|
echo "Fiji 's return code : $$ERROR_CODE" ; \
|
||||||
ERROR_CODE=$$(cat '/tmp/test_result.txt') ; \
|
ERROR_CODE=$$(cat '/tmp/test_result.txt') ; \
|
||||||
|
@ -99,7 +101,7 @@ test0001: install
|
||||||
.PHONY: test0001
|
.PHONY: test0001
|
||||||
imgproc_tests: install
|
imgproc_tests: install
|
||||||
echo 2 > '/tmp/test_result.txt' ; \
|
echo 2 > '/tmp/test_result.txt' ; \
|
||||||
$(FIJI_EXE_PATH) --ij2 --headless --run './tests/improc_tests.py' ; \
|
$(FIJI_EXE_PATH) --ij2 --headless --run './tests/improc_tests.py' "tests_output_data_path='$(TESTS_OUTPUT_DATA_PATH)'" ; \
|
||||||
ERROR_CODE=$$? ; \
|
ERROR_CODE=$$? ; \
|
||||||
echo "Fiji 's return code : $$ERROR_CODE" ; \
|
echo "Fiji 's return code : $$ERROR_CODE" ; \
|
||||||
ERROR_CODE=$$(cat '/tmp/test_result.txt') ; \
|
ERROR_CODE=$$(cat '/tmp/test_result.txt') ; \
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
# # note: fiji's jython doesn't support encoding keyword
|
# # note: fiji's jython doesn't support encoding keyword
|
||||||
|
|
||||||
# https://imagej.net/Scripting_Headless
|
# https://imagej.net/Scripting_Headless
|
||||||
|
#@ String tests_output_data_path
|
||||||
|
|
||||||
import unittest # unittest2 doesn't exist in fiji
|
import unittest # unittest2 doesn't exist in fiji
|
||||||
import sys
|
import sys
|
||||||
|
@ -14,10 +15,11 @@ class ImProcTester(unittest.TestCase):
|
||||||
|
|
||||||
# we need to know if the test succeeded or not https://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method
|
# we need to know if the test succeeded or not https://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method
|
||||||
# CURRENT_RESULT = None # holds last result object passed to run method
|
# CURRENT_RESULT = None # holds last result object passed to run method
|
||||||
|
TESTS_OUTPUT_DATA_PATH = tests_output_data_path # eg '/tmp/lipase/tests-output-data' pylint: disable=undefined-variable
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
print("initializing ImProcTester instance")
|
print("initializing ImProcTester instance")
|
||||||
IImageEngine.set_instance(IJImageEngine(debugger=FileBasedDebugger('./debug-images')))
|
IImageEngine.set_instance(IJImageEngine(debugger=FileBasedDebugger('%s/debug-images' % self.TESTS_OUTPUT_DATA_PATH)))
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
print("uninitializing ImProcTester instance")
|
print("uninitializing ImProcTester instance")
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
# https://imagej.net/Scripting_Headless
|
# https://imagej.net/Scripting_Headless
|
||||||
#@ String raw_images_root_path
|
#@ String raw_images_root_path
|
||||||
|
#@ String tests_output_data_path
|
||||||
|
|
||||||
|
|
||||||
import unittest # unittest2 doesn't exist in fiji
|
import unittest # unittest2 doesn't exist in fiji
|
||||||
import sys
|
import sys
|
||||||
|
@ -23,13 +25,14 @@ from lipase.imagej.hdf5serializer import save_hdf5_file
|
||||||
class TestLipase(unittest.TestCase):
|
class TestLipase(unittest.TestCase):
|
||||||
|
|
||||||
RAW_IMAGES_ROOT_PATH = raw_images_root_path # eg '/Users/graffy/ownCloud/ipr/lipase/raw-images' pylint: disable=undefined-variable
|
RAW_IMAGES_ROOT_PATH = raw_images_root_path # eg '/Users/graffy/ownCloud/ipr/lipase/raw-images' pylint: disable=undefined-variable
|
||||||
|
TESTS_OUTPUT_DATA_PATH = tests_output_data_path # eg '/tmp/lipase/tests-output-data' pylint: disable=undefined-variable
|
||||||
|
|
||||||
# we need to know if the test succeeded or not https://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method
|
# we need to know if the test succeeded or not https://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method
|
||||||
# CURRENT_RESULT = None # holds last result object passed to run method
|
# CURRENT_RESULT = None # holds last result object passed to run method
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
print("initializing TestLipase instance")
|
print("initializing TestLipase instance")
|
||||||
IImageEngine.set_instance(IJImageEngine(debugger=FileBasedDebugger('./debug-images')))
|
IImageEngine.set_instance(IJImageEngine(debugger=FileBasedDebugger('%s/debug-images' % self.TESTS_OUTPUT_DATA_PATH)))
|
||||||
self.catalog = ImageCatalog(self.RAW_IMAGES_ROOT_PATH)
|
self.catalog = ImageCatalog(self.RAW_IMAGES_ROOT_PATH)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -102,7 +105,7 @@ class TestLipase(unittest.TestCase):
|
||||||
background_estimator = EmptyFrameBackgroundEstimator(empty_frame_index=39)
|
background_estimator = EmptyFrameBackgroundEstimator(empty_frame_index=39)
|
||||||
processor = GlobulesAreaEstimator(background_estimator=background_estimator, particle_threshold=2000.0)
|
processor = GlobulesAreaEstimator(background_estimator=background_estimator, particle_threshold=2000.0)
|
||||||
results = processor.detect_particles(visible_traps_sequence)
|
results = processor.detect_particles(visible_traps_sequence)
|
||||||
save_hdf5_file('results.h5', results)
|
save_hdf5_file('%s/results.h5' % self.TESTS_OUTPUT_DATA_PATH, results)
|
||||||
# results file could be checked with "h5dump --xml ./lipase.git/results.h5"
|
# results file could be checked with "h5dump --xml ./lipase.git/results.h5"
|
||||||
first_frame_measured_ratio = results['globules_area_ratio'][(0,)]
|
first_frame_measured_ratio = results['globules_area_ratio'][(0,)]
|
||||||
first_frame_expected_ratio = 0.008
|
first_frame_expected_ratio = 0.008
|
||||||
|
|
Loading…
Reference in New Issue