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

test condition in gitlab CI

parent c6aca4c8
......@@ -172,27 +172,27 @@ article:
image:
name: pycif/pycif-ubuntu:0.1
entrypoint: [""]
# before_script:
## - apt-get update
# - pip freeze
before_script:
# - apt-get update
- pip freeze
script:
- echo AAAAAAAAAAAAAAAAAAAAAAAAaaa
- echo ${CI_COMMIT_BRANCH}
- echo AAAAAAAAAAAAAAAAAAAAAAAAaaa
- echo ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
- echo AAAAAAAAAAAAAAAAAAAAAAAAaaa
- 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)"
# after_script:
# - mkdir -p coverage
# - xmlstarlet sel -t -v "//coverage/@line-rate" reports/coverage.xml > coverage/.current_coverage
# - calc() { awk "BEGIN{print $*}"; }
# - percent_coverage=`cat coverage/.current_coverage`
# - tot_coverage=`calc ${percent_coverage}*100`
# - echo 'TOTAL COVERAGE:'" ${tot_coverage}%"
# - mv coverage_raw/coverage/.coverage coverage_raw/.coverage.article
# coverage: '/^TOTAL COVERAGE: ([0-9\.]+\%)$/'
- |
if [ ${CI_COMMIT_BRANCH} == "LSCE" ]; then
tox -e py38 -e coverage -- -m "(dummy and article and inversion and not adjtltest and not uncertainties)
or (fwd and ref_config) or (allsimulations)";
else
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:
- mkdir -p coverage
- xmlstarlet sel -t -v "//coverage/@line-rate" reports/coverage.xml > coverage/.current_coverage
- calc() { awk "BEGIN{print $*}"; }
- percent_coverage=`cat coverage/.current_coverage`
- tot_coverage=`calc ${percent_coverage}*100`
- echo 'TOTAL COVERAGE:'" ${tot_coverage}%"
- mv coverage_raw/coverage/.coverage coverage_raw/.coverage.article
coverage: '/^TOTAL COVERAGE: ([0-9\.]+\%)$/'
artifacts:
when: always
paths:
......
......@@ -16,10 +16,10 @@ export PYCIF_DATATEST=/home/chimereges/PYCIF_TEST_DATA/
export PYCIF_PLATFORM=LSCE
###
# 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="(fwd and ref_config)"
mark="test_in_ci and dummy"
#mark="test_in_ci and dummy"
#mark="test_in_ci and chimere"
#mark="chimere and argfrsd and fwd"
#mark="tm5 and test_in_ci and fwd"
......
......@@ -44,7 +44,7 @@ def build_H(controlvect, obsvect, base_dir):
"{}/obsvect_{:04d}/{}/{}/monitor.nc"\
.format(base_dir, idim, comp, trcr)
data = read_datastore(monitor_file)
hloc.loc[:, idim] = data.loc[:, "sim"].values
hloc.loc[:, idim] = data.loc[:, ("maindata", "sim")].values
jacobian[(comp, trcr)] = hloc
harray[tracer.ypointer: tracer.ypointer + tracer.dim, :] = \
......
......@@ -40,7 +40,7 @@ def build_Hx(obsvect, ensemble_dir, x_sample):
"{}/H_matrix/obsvect_{:04d}/{}/{}/monitor.nc"\
.format(ensemble_dir, isample, comp, trcr)
data = read_datastore(monitor_file)
hloc.loc[:, isample] = data.loc[:, "sim"].values
hloc.loc[:, isample] = data.loc[:, ("maindata", "sim")].values
jacobian[(comp, trcr)] = hloc
harray[tracer.ypointer: tracer.ypointer + tracer.dim, :] = \
......
......@@ -39,11 +39,20 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
# from forward to make computation faster
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
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"]\
["parameters"]["CH4"]["hresol"] == "hpixels":
nsimmax = 25
nsimmax = int(2.5 * nsimmax)
elif config["datavect"]["components"]["flux"]\
["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