Commit 18fb3674 authored by Antoine Berchet's avatar Antoine Berchet
Browse files

Test artifacts

parent b83dc8bc
......@@ -70,7 +70,7 @@ pages:
# - cp -r docs/build/html .public/
# - mv .public public
- ls -R
- cat artifact_test.txt
- cat artifact_tests/*
artifacts:
paths:
- public
......@@ -89,19 +89,22 @@ article:
# - pip freeze
script:
# - python3 setup.py install
# - pytest -s -m "(dummy and article and inversion and not adjtltest) or (fwd and ref_config)" --html reports/pytest.html --self-contained-html ./
- rm -f artifact_test.txt
- echo ARTICLE > artifact_test.txt
- >
pytest -s -m "(dummy and article and inversion and not adjtltest) or (fwd and ref_config)"
--html reports/pytest.html --self-contained-html --basetemp=/tmp/pytest/ ./
- rm -rf artifact_tests
- mkdir artifact_tests
- echo ARTICLE > artifact_tests/article
after_script:
- cp -r examples configs_article_artifacts
- cp -r /tmp/pytest/examples configs_article_artifacts
- mkdir figures_artifacts
- cp ${PYTEST_CURRENT_TEST}/*pdf figures_artifacts/
- cp /tmp/pytest/*pdf figures_artifacts/
artifacts:
when: always
paths:
- configs_article_artifacts
- figures_artifacts
- artifact_test.txt
- artifact_tests
only:
- pytests
......@@ -129,13 +132,14 @@ tests:
# - mv PYCIF_DATA_TEST /tmp/
script:
# - tox -e py38 -e coverage
- rm -f artifact_test.txt
- echo TESTS > artifact_test.txt
- rm -rf artifact_tests
- mkdir artifact_tests
- echo TESTS > artifact_tests/test
after_script:
# - mkdir -p coverage
# - xmlstarlet sel -t -v "//coverage/@line-rate" reports/coverage.xml > coverage/.current_coverage
# - echo 'TOTAL COVERAGE:'" $(cat coverage/.current_coverage)%"
- cp -r examples configs_artifacts
- cp -r /tmp/pytest/examples configs_artifacts
coverage: '/^TOTAL COVERAGE: ([0-9\.]+\%)$/'
artifacts:
when: always
......@@ -144,7 +148,7 @@ tests:
- reports/coverage/
- coverage/.current_coverage
- configs_artifacts
- artifact_test.txt
- artifact_tests
......
verbose: 2
logfile: pycif.logtest
workdir: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum40
workdir: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum0
datei: 2010-01-01
datef: 2010-01-05 00:00:00
datef: 2010-01-02 00:00:00
mode:
increments: 0.2
incrmode: cst
......@@ -39,10 +39,9 @@ model:
plugin:
name: dummy
version: std
reload_H: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum40/../H_matrix.pickle
save_H: true
obsvect:
dir_obsvect: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum40/../ref_obsvect/
dir_obsvect: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum0/../ref_obsvect/
dump_type: nc
plugin:
name: standard
......@@ -76,11 +75,11 @@ datavect:
sin: null
variable: zlon
hcorrelations: &id001
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum40/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_adjtltest_dum0/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
sigma: 200000.0
sigma: 500
hresol: hpixels
nlev: 1
period: 5D
......
......@@ -30,7 +30,7 @@ model:
version: std
save_H: true
obsvect:
dir_obsvect: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con7/../ref_obsvect/
dir_obsvect: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con7/../ref_obsvect/
dump_type: nc
plugin:
name: standard
......@@ -84,7 +84,7 @@ datavect:
square: null
variable: zlon
hcorrelations:
dircorrel: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con7/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con7/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
......@@ -119,7 +119,7 @@ datavect:
square: null
variable: zlon
hcorrelations:
dircorrel: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con7/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con7/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
......
......@@ -41,7 +41,7 @@ model:
version: std
save_H: true
obsvect:
dir_obsvect: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con6/../ref_obsvect/
dir_obsvect: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con6/../ref_obsvect/
dump_type: nc
plugin:
name: standard
......@@ -87,7 +87,7 @@ datavect:
sin: null
variable: zlon
hcorrelations: &id001
dircorrel: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con6/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con6/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
......@@ -149,7 +149,7 @@ datavect:
square: null
variable: zlon
hcorrelations:
dircorrel: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con6/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con6/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
......
......@@ -40,7 +40,7 @@ model:
version: std
save_H: true
obsvect:
dir_obsvect: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con2/../ref_obsvect/
dir_obsvect: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con2/../ref_obsvect/
dump_type: nc
plugin:
name: standard
......@@ -74,7 +74,7 @@ datavect:
sin: null
variable: zlon
hcorrelations: &id001
dircorrel: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con2/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con2/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
......
......@@ -29,7 +29,7 @@ model:
version: std
save_H: true
obsvect:
dir_obsvect: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con3/../ref_obsvect/
dir_obsvect: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con3/../ref_obsvect/
dump_type: nc
plugin:
name: standard
......@@ -71,7 +71,7 @@ datavect:
square: null
variable: zlon
hcorrelations:
dircorrel: /tmp/pytest-of-aberchet/pytest-3/test_integration_fwd_dummy_con3/datavect/
dircorrel: /tmp/pytest-of-aberchet/pytest-0/test_integration_fwd_dummy_con3/datavect/
dump_hcorr: true
evalmin: 0
landsea: false
......
import os
from pathlib import Path
import pytest
from pycif.utils.yml import ordered_dump
......@@ -56,9 +57,11 @@ def dummy_config_adjtltest(dummy_config_inversion, request):
+ ("fullperiod" if request.param.get("tresol", "5D") else
"subperiod")
current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
example_dir = \
os.path.abspath(os.path.join(current_dir, "../../../examples/dummy/"))
# current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# example_dir = \
# os.path.abspath(os.path.join(current_dir, "../../../examples/dummy/"))
example_dir = tmpdir_str + "../examples/dummy"
Path(example_dir).mkdir(parents=True, exist_ok=True)
dummy_config_file = \
os.path.join(example_dir, "config_adjtltest_{}.yml".format(tag))
......
......@@ -4,6 +4,7 @@ import pandas as pd
import pytest
import shutil
import xarray as xr
from pathlib import Path
from pycif.utils.yml import ordered_dump
......@@ -88,9 +89,11 @@ def dummy_config_fwd(ref_dummy, request):
"/tmp/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt"
# Dump configuration into CIF examples
current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
example_dir = \
os.path.abspath(os.path.join(current_dir, "../../../examples/dummy/"))
# current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# example_dir = \
# os.path.abspath(os.path.join(current_dir, "../../../examples/dummy/"))
example_dir = tmpdir_str + "../examples/dummy"
Path(example_dir).mkdir(parents=True, exist_ok=True)
dummy_config_file = \
os.path.join(example_dir, "config_fwd_{}.yml".format(tag))
......
import pytest
import os
from pathlib import Path
from pycif.utils.yml import ordered_dump
from pycif.utils.classes.setup import Setup
......@@ -57,9 +58,11 @@ def test_integration_adjtltest(dummy_config_inversion, settings):
+ ("fullperiod" if settings.get("tresol", "5D") else
"subperiod")
current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
example_dir = \
os.path.abspath(os.path.join(current_dir, "../../examples/dummy/"))
# current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# example_dir = \
# os.path.abspath(os.path.join(current_dir, "../../examples/dummy/"))
example_dir = tmpdir + "../examples/dummy"
Path(example_dir).mkdir(parents=True, exist_ok=True)
dummy_config_file = \
os.path.join(example_dir, "config_adjtltest_{}.yml".format(tag))
......
......@@ -4,6 +4,7 @@ import shutil
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
from pathlib import Path
import pytest
......@@ -149,9 +150,11 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
"" if settings["mode"] != "4dvar"
else settings["minimizer"])
current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
example_dir = \
os.path.abspath(os.path.join(current_dir, "../../examples/dummy/"))
# current_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# example_dir = \
# os.path.abspath(os.path.join(current_dir, "../../examples/dummy/"))
example_dir = tmpdir + "../examples/dummy"
Path(example_dir).mkdir(parents=True, exist_ok=True)
dummy_config_file = \
os.path.join(example_dir, "config_{}.yml".format(tag))
......
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