diff --git a/_templates/job.temp b/_templates/job.temp index e8ce37658f0f12745bee16445498904c464fe929..a4203169c44f1831fd8b0a8d79044f60b3d51dd6 100644 --- a/_templates/job.temp +++ b/_templates/job.temp @@ -48,7 +48,7 @@ cd $SCRATCH mkdir -p python$$ cd python$$ -export CONTROL=CONTROL +export CONTROL=$PWD/CONTROL cat >$CONTROL<<EOF EOF diff --git a/documentation/FE_testing.txt b/documentation/FE_testing.txt new file mode 100644 index 0000000000000000000000000000000000000000..7ea18826964781f78c5684f561a8d4bf22ce0607 --- /dev/null +++ b/documentation/FE_testing.txt @@ -0,0 +1,13 @@ +Abhängigkeiten: +pytest +pytest-cov (https://pypi.org/project/pytest-cov/ ; https://pytest-cov.readthedocs.io/en/latest/) +coverage + +#Grundsätzlicher Befehl die Coverage des Testens zu überprüfen +pytest --cov=PATH_TO_PROJECT_SRC PATH_TO_TEST_SRC + +# einen test mit einem bestimmten marker nicht ausführen +pytest TestTools.py -m "not msuser_pw" + +# Tests mit einem bestimmten Marker ausführen +pytest TestTools.py -m "msuser_pw" \ No newline at end of file diff --git a/python/ControlFile.py b/python/ControlFile.py index d74c9d83b6886310ec65a93c74714bcf3457d7f7..9acfd75110e3ca657ff0453868d1880be4b4c0c8 100644 --- a/python/ControlFile.py +++ b/python/ControlFile.py @@ -424,7 +424,7 @@ class ControlFile(object): sys.exit(1) if self.request != 0: - marsfile = os.path.join(_config.PATH_RUN_DIR, + marsfile = os.path.join(self.inputdir, _config.FILE_MARS_REQUESTS) if os.path.isfile(marsfile): os.remove(marsfile) diff --git a/python/EcFlexpart.py b/python/EcFlexpart.py index d202572a81395cdd687136cad529935e02b6b2b8..ece03dc2d1dab1a3737c409a8ac1d0e5af3d9a32 100644 --- a/python/EcFlexpart.py +++ b/python/EcFlexpart.py @@ -205,6 +205,7 @@ class EcFlexpart(object): self.accuracy = c.accuracy self.level = c.level self.expver = c.expver + self.levelist = c.levelist # for gaussian grid retrieval self.glevelist = '1/to/' + c.level diff --git a/python/_config.py b/python/_config.py index 7ae76a6bd7803b9ca749b68d221dc5d3e5c50245..0270d978bb88eeb8d6aa8b64334bcac21d50b619 100644 --- a/python/_config.py +++ b/python/_config.py @@ -76,8 +76,14 @@ PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'run') PATH_RELATIVE_RUN_DIR = os.path.relpath(PATH_RUN_DIR, PATH_FLEXEXTRACT_DIR) # path to directory where all control files are stored -PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'control') -PATH_RELATIVE_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR) +if os.getenv('CONTROL') and '/' in os.getenv('CONTROL'): + # this is only needed if remote version with job script is used! + # because job is directly submitted from SCRATCH and because the + # CONTROL file is stored there, the normal path is not valid. + PATH_CONTROLFILES = os.getenv('CONTROL') +else: + PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'control') + PATH_RELATIVE_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR) # path to directory where all job scripts are stored PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'jobscripts') diff --git a/run/control/CONTROL.test b/run/control/CONTROL.test index b693ee4d1364bc38deb58739b3c8844f4ee5490c..41018e17505c698eb19dd05d488cae897a843baa 100644 --- a/run/control/CONTROL.test +++ b/run/control/CONTROL.test @@ -15,4 +15,4 @@ RESOL 63 GAUSS 1 ADDPAR 186/187/188/235/139/39 PREFIX EItest_ -ECTRANS 1 +ECTRANS 1 \ No newline at end of file diff --git a/run/jobscripts/job.ksh b/run/jobscripts/job.ksh index 6373f11b6eb6424da55426a44f88987b531b477a..c77cc78f44d73cceed54bdcb4dfb95e4118df89a 100644 --- a/run/jobscripts/job.ksh +++ b/run/jobscripts/job.ksh @@ -48,7 +48,7 @@ cd $SCRATCH mkdir -p python$$ cd python$$ -export CONTROL=CONTROL +export CONTROL=$PWD/CONTROL cat >$CONTROL<<EOF accuracy 24