Commit ba329dd3 authored by Antoine Berchet's avatar Antoine Berchet
Browse files

test condition in gitlab CI

parent c6aca4c8
...@@ -172,27 +172,27 @@ article: ...@@ -172,27 +172,27 @@ article:
image: image:
name: pycif/pycif-ubuntu:0.1 name: pycif/pycif-ubuntu:0.1
entrypoint: [""] entrypoint: [""]
# before_script: before_script:
## - apt-get update # - apt-get update
# - pip freeze - pip freeze
script: script:
- echo AAAAAAAAAAAAAAAAAAAAAAAAaaa - |
- echo ${CI_COMMIT_BRANCH} if [ ${CI_COMMIT_BRANCH} == "LSCE" ]; then
- echo AAAAAAAAAAAAAAAAAAAAAAAAaaa tox -e py38 -e coverage -- -m "(dummy and article and inversion and not adjtltest and not uncertainties)
- echo ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} or (fwd and ref_config) or (allsimulations)";
- echo AAAAAAAAAAAAAAAAAAAAAAAAaaa else
- if [ ${CI_COMMIT_BRANCH} == "new_classes" ]; then echo "TTTTTTTTTTTTTTTTTTTTTTTTT"; fi; tox -e py38 -e coverage -- -m "(dummy and article and inversion and not adjtltest and not uncertainties)
or (fwd and ref_config)";
#- tox -e py38 -e coverage -- -m "(dummy and article and inversion and not adjtltest and not uncertainties) or (fwd and ref_config)" fi;
# after_script: after_script:
# - mkdir -p coverage - mkdir -p coverage
# - xmlstarlet sel -t -v "//coverage/@line-rate" reports/coverage.xml > coverage/.current_coverage - xmlstarlet sel -t -v "//coverage/@line-rate" reports/coverage.xml > coverage/.current_coverage
# - calc() { awk "BEGIN{print $*}"; } - calc() { awk "BEGIN{print $*}"; }
# - percent_coverage=`cat coverage/.current_coverage` - percent_coverage=`cat coverage/.current_coverage`
# - tot_coverage=`calc ${percent_coverage}*100` - tot_coverage=`calc ${percent_coverage}*100`
# - echo 'TOTAL COVERAGE:'" ${tot_coverage}%" - echo 'TOTAL COVERAGE:'" ${tot_coverage}%"
# - mv coverage_raw/coverage/.coverage coverage_raw/.coverage.article - mv coverage_raw/coverage/.coverage coverage_raw/.coverage.article
# coverage: '/^TOTAL COVERAGE: ([0-9\.]+\%)$/' coverage: '/^TOTAL COVERAGE: ([0-9\.]+\%)$/'
artifacts: artifacts:
when: always when: always
paths: paths:
......
...@@ -16,10 +16,10 @@ export PYCIF_DATATEST=/home/chimereges/PYCIF_TEST_DATA/ ...@@ -16,10 +16,10 @@ export PYCIF_DATATEST=/home/chimereges/PYCIF_TEST_DATA/
export PYCIF_PLATFORM=LSCE export PYCIF_PLATFORM=LSCE
### ###
# select a subset of tests to run by using the tags ("mark") # select a subset of tests to run by using the tags ("mark")
#mark="(dummy and article and inversion and not adjtltest and not uncertainties) or (fwd and ref_config)" mark="(dummy and article and inversion and not adjtltest and not uncertainties) or (fwd and ref_config) or (toto)"
#mark="(dummy and article and inversion and not adjtltest and uncertainties) or (fwd and ref_config)" #mark="(dummy and article and inversion and not adjtltest and uncertainties) or (fwd and ref_config)"
#mark="(fwd and ref_config)" #mark="(fwd and ref_config)"
mark="test_in_ci and dummy" #mark="test_in_ci and dummy"
#mark="test_in_ci and chimere" #mark="test_in_ci and chimere"
#mark="chimere and argfrsd and fwd" #mark="chimere and argfrsd and fwd"
#mark="tm5 and test_in_ci and fwd" #mark="tm5 and test_in_ci and fwd"
......
...@@ -44,7 +44,7 @@ def build_H(controlvect, obsvect, base_dir): ...@@ -44,7 +44,7 @@ def build_H(controlvect, obsvect, base_dir):
"{}/obsvect_{:04d}/{}/{}/monitor.nc"\ "{}/obsvect_{:04d}/{}/{}/monitor.nc"\
.format(base_dir, idim, comp, trcr) .format(base_dir, idim, comp, trcr)
data = read_datastore(monitor_file) data = read_datastore(monitor_file)
hloc.loc[:, idim] = data.loc[:, "sim"].values hloc.loc[:, idim] = data.loc[:, ("maindata", "sim")].values
jacobian[(comp, trcr)] = hloc jacobian[(comp, trcr)] = hloc
harray[tracer.ypointer: tracer.ypointer + tracer.dim, :] = \ harray[tracer.ypointer: tracer.ypointer + tracer.dim, :] = \
......
...@@ -40,7 +40,7 @@ def build_Hx(obsvect, ensemble_dir, x_sample): ...@@ -40,7 +40,7 @@ def build_Hx(obsvect, ensemble_dir, x_sample):
"{}/H_matrix/obsvect_{:04d}/{}/{}/monitor.nc"\ "{}/H_matrix/obsvect_{:04d}/{}/{}/monitor.nc"\
.format(ensemble_dir, isample, comp, trcr) .format(ensemble_dir, isample, comp, trcr)
data = read_datastore(monitor_file) data = read_datastore(monitor_file)
hloc.loc[:, isample] = data.loc[:, "sim"].values hloc.loc[:, isample] = data.loc[:, ("maindata", "sim")].values
jacobian[(comp, trcr)] = hloc jacobian[(comp, trcr)] = hloc
harray[tracer.ypointer: tracer.ypointer + tracer.dim, :] = \ harray[tracer.ypointer: tracer.ypointer + tracer.dim, :] = \
......
...@@ -39,11 +39,20 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig): ...@@ -39,11 +39,20 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
# from forward to make computation faster # from forward to make computation faster
config["model"]["reload_H"] = "{}/../H_matrix.pickle".format(tmpdir) config["model"]["reload_H"] = "{}/../H_matrix.pickle".format(tmpdir)
# Changing mode # Update number of simulations depending on pytests options
marker = pytestconfig.getoption('-m')
nsimmax = 10 nsimmax = 10
montecarlo = settings.get("montecarlo", 10)
nsample = settings.get("nsample", 5)
if "allsimulations" not in marker:
nsimmax = 4
montecarlo = 4
nsample = 1
# Changing mode
if config["datavect"]["components"]["flux"]\ if config["datavect"]["components"]["flux"]\
["parameters"]["CH4"]["hresol"] == "hpixels": ["parameters"]["CH4"]["hresol"] == "hpixels":
nsimmax = 25 nsimmax = int(2.5 * nsimmax)
elif config["datavect"]["components"]["flux"]\ elif config["datavect"]["components"]["flux"]\
["parameters"]["CH4"]["hresol"] == "global" \ ["parameters"]["CH4"]["hresol"] == "global" \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment