Skip to content
Snippets Groups Projects
Commit 8b463d56 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent bc3b0189
No related branches found
No related tags found
No related merge requests found
......@@ -32,4 +32,9 @@ pipelines:
- git lfs pull
- git lfs checkout
- python3 make/setuprepository.py
#- python3 tests/test_init.py
#- CI=True
#- export CI
- python3 -m nose2 discover tests "test_*.py" > test-reports/test-report.txt
import os, sys, pathlib, re
from eotimeseriesviewer import DIR_REPO
DIR_REPO = pathlib.Path(DIR_REPO)
DIR_TESTS = DIR_REPO / 'tests'
assert os.path.isdir(DIR_TESTS)
PATH_RUNTESTS_BAT = DIR_REPO / 'runtests.bat'
PATH_RUNTESTS_SH = DIR_REPO / 'runtests.sh'
jUnitXML = r'nose2-junit.xml'
PREFACE_BAT = \
"""
:: use this script to run unit tests locally
::
set CI=True
python3 make/setuprepository.py
"""
PREFACE_SH = \
"""
# use this script to run unit tests locally
#
python3 make/setuprepository.py
"""
dirOut = 'test-reports/today'
linesBat = [PREFACE_BAT]
linesSh = [PREFACE_SH]
linesBat.append('mkdir {}'.format(dirOut.replace('/', '\\')))
linesSh.append('mkdir {}'.format(dirOut))
bnDirTests = os.path.basename(DIR_TESTS)
for file in os.scandir(DIR_TESTS):
if file.is_file() and re.search(r'^test_.*\.py$', file.name):
bn = os.path.basename(file)
bn = os.path.splitext(bn)[0]
lineBat = 'python3 -m nose2 -s {3} {0} & move {1} {2}/{0}.xml'.format(bn, jUnitXML, dirOut, bnDirTests)
lineSh = 'python3 -m nose2 -s {3} {0} | mv {1} {2}/{0}.xml'.format(bn, jUnitXML, dirOut, bnDirTests)
linesBat.append(lineBat)
linesSh.append(lineSh)
with open(PATH_RUNTESTS_BAT, 'w', encoding='utf-8') as f:
f.write('\n'.join(linesBat))
with open(PATH_RUNTESTS_SH, 'w', encoding='utf-8') as f:
f.write('\n'.join(linesSh))
::mkdir test-reports
:: use this script to run unit tests locally
::
set CI=True
@echo off
call :sub >test-report.txt
exit /b
python3 make/setuprepository.py
:sub
python -m nose2 --verbose discover tests "test_*.py"
mkdir test-reports\today
python3 -m nose2 -s tests test_fileFormatLoading & move nose2-junit.xml test-reports/today/test_fileFormatLoading.xml
python3 -m nose2 -s tests test_init & move nose2-junit.xml test-reports/today/test_init.xml
python3 -m nose2 -s tests test_inmemorydata & move nose2-junit.xml test-reports/today/test_inmemorydata.xml
python3 -m nose2 -s tests test_labeling & move nose2-junit.xml test-reports/today/test_labeling.xml
python3 -m nose2 -s tests test_layerproperties & move nose2-junit.xml test-reports/today/test_layerproperties.xml
python3 -m nose2 -s tests test_main & move nose2-junit.xml test-reports/today/test_main.xml
python3 -m nose2 -s tests test_mapcanvas & move nose2-junit.xml test-reports/today/test_mapcanvas.xml
python3 -m nose2 -s tests test_maptools & move nose2-junit.xml test-reports/today/test_maptools.xml
python3 -m nose2 -s tests test_mapvisualization & move nose2-junit.xml test-reports/today/test_mapvisualization.xml
python3 -m nose2 -s tests test_pixelloader & move nose2-junit.xml test-reports/today/test_pixelloader.xml
python3 -m nose2 -s tests test_qgis_environment & move nose2-junit.xml test-reports/today/test_qgis_environment.xml
python3 -m nose2 -s tests test_qgis_interaction & move nose2-junit.xml test-reports/today/test_qgis_interaction.xml
python3 -m nose2 -s tests test_resources & move nose2-junit.xml test-reports/today/test_resources.xml
python3 -m nose2 -s tests test_sensorvisualization & move nose2-junit.xml test-reports/today/test_sensorvisualization.xml
python3 -m nose2 -s tests test_settings & move nose2-junit.xml test-reports/today/test_settings.xml
python3 -m nose2 -s tests test_stackedbandinput & move nose2-junit.xml test-reports/today/test_stackedbandinput.xml
python3 -m nose2 -s tests test_temporalprofiles & move nose2-junit.xml test-reports/today/test_temporalprofiles.xml
python3 -m nose2 -s tests test_timeseries & move nose2-junit.xml test-reports/today/test_timeseries.xml
python3 -m nose2 -s tests test_utils & move nose2-junit.xml test-reports/today/test_utils.xml
\ No newline at end of file
# use this script to run unit tests locally
#
python3 make/setuprepository.py
mkdir test-reports/today
python3 -m nose2 -s tests test_fileFormatLoading | mv nose2-junit.xml test-reports/today/test_fileFormatLoading.xml
python3 -m nose2 -s tests test_init | mv nose2-junit.xml test-reports/today/test_init.xml
python3 -m nose2 -s tests test_inmemorydata | mv nose2-junit.xml test-reports/today/test_inmemorydata.xml
python3 -m nose2 -s tests test_labeling | mv nose2-junit.xml test-reports/today/test_labeling.xml
python3 -m nose2 -s tests test_layerproperties | mv nose2-junit.xml test-reports/today/test_layerproperties.xml
python3 -m nose2 -s tests test_main | mv nose2-junit.xml test-reports/today/test_main.xml
python3 -m nose2 -s tests test_mapcanvas | mv nose2-junit.xml test-reports/today/test_mapcanvas.xml
python3 -m nose2 -s tests test_maptools | mv nose2-junit.xml test-reports/today/test_maptools.xml
python3 -m nose2 -s tests test_mapvisualization | mv nose2-junit.xml test-reports/today/test_mapvisualization.xml
python3 -m nose2 -s tests test_pixelloader | mv nose2-junit.xml test-reports/today/test_pixelloader.xml
python3 -m nose2 -s tests test_qgis_environment | mv nose2-junit.xml test-reports/today/test_qgis_environment.xml
python3 -m nose2 -s tests test_qgis_interaction | mv nose2-junit.xml test-reports/today/test_qgis_interaction.xml
python3 -m nose2 -s tests test_resources | mv nose2-junit.xml test-reports/today/test_resources.xml
python3 -m nose2 -s tests test_sensorvisualization | mv nose2-junit.xml test-reports/today/test_sensorvisualization.xml
python3 -m nose2 -s tests test_settings | mv nose2-junit.xml test-reports/today/test_settings.xml
python3 -m nose2 -s tests test_stackedbandinput | mv nose2-junit.xml test-reports/today/test_stackedbandinput.xml
python3 -m nose2 -s tests test_temporalprofiles | mv nose2-junit.xml test-reports/today/test_temporalprofiles.xml
python3 -m nose2 -s tests test_timeseries | mv nose2-junit.xml test-reports/today/test_timeseries.xml
python3 -m nose2 -s tests test_utils | mv nose2-junit.xml test-reports/today/test_utils.xml
\ No newline at end of file
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