Skip to content

test_mod_file

Functions

configs

configs(mod_file)
Source code in tests/test_mod_file.py
20
21
22
@pytest.fixture
def configs(mod_file):
    return mod_file["configuration"]

grisli

grisli(configs)
Source code in tests/test_mod_file.py
35
36
37
@pytest.fixture
def grisli(configs):
    return configs["GRISLI"]

ioipsl

ioipsl(configs)
Source code in tests/test_mod_file.py
25
26
27
@pytest.fixture
def ioipsl(configs):
    return configs["IOIPSL_PLUS"]

ipslcm7

ipslcm7(configs)
Source code in tests/test_mod_file.py
30
31
32
@pytest.fixture
def ipslcm7(configs):
    return configs["IPSLCM7.0"]

mod_file

mod_file()
Source code in tests/test_mod_file.py
 8
 9
10
11
12
@pytest.fixture
def mod_file():
    root = Path(__file__).parent.resolve()
    with open(root / "examples" / "mod.def.r7473") as f:
        return load(f)

nemo_v40

nemo_v40(configs)
Source code in tests/test_mod_file.py
40
41
42
@pytest.fixture
def nemo_v40(configs):
    return configs["NEMO_v4.0"]

repos

repos(mod_file)
Source code in tests/test_mod_file.py
15
16
17
@pytest.fixture
def repos(mod_file):
    return mod_file["repository"]

test_configuration

test_configuration(configs)
Source code in tests/test_mod_file.py
48
49
def test_configuration(configs):
    assert len(configs) == 62

test_git_path_repository

test_git_path_repository(repos)
Source code in tests/test_mod_file.py
67
68
69
70
71
72
def test_git_path_repository(repos):
    # Test local repo with a path
    assert repos[24] == {
        "type": "git",
        "clone_url": "/ccc/work/cont003/igcmg/igcmg/IGCM/LIC/ELMERICE/elmerfem",
    }

test_git_repository

test_git_repository(repos)
Source code in tests/test_mod_file.py
51
52
53
54
55
56
def test_git_repository(repos):
    # Test classic git repo
    assert repos[7] == {
        "type": "git",
        "clone_url": "https://gitlab.in2p3.fr/ipsl/projets/nemogcm/nemo.git",
    }

test_grisli_configuration

test_grisli_configuration(grisli)
Source code in tests/test_mod_file.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
def test_grisli_configuration(grisli):
    # GRISLI configuration is interesting to test, because it has
    # identical name of the second and the third components: GRISLI
    # This is the use case that forbids us from using dictionary to
    # store componets by their name ;(
    assert grisli == {
        "description": ["GRISLI stand-alone for Antarctica icesheets (prototype)"],
        "components": [
            {
                "name": "libIGCM",
                "variant": "trunk/libIGCM",
                "revision": "HEAD",
                "repository": 10,
                "modipsl_dir": ".",
            },
            {
                "name": "GRISLI",
                "variant": "branches/xios",
                "revision": "HEAD",
                "repository": 26,
                "modipsl_dir": "modeles",
            },
            {
                "name": "GRISLI",
                "variant": "CONFIG/GRISLI",
                "revision": "HEAD",
                "repository": 8,
                "modipsl_dir": "config",
            },
            {
                "name": "XIOS",
                "variant": "XIOS3_2902",
                "revision": "243e0b53",
                "repository": 12,
                "modipsl_dir": "modeles",
            },
        ],
    }

test_ioipsl_config

test_ioipsl_config(ioipsl)
Source code in tests/test_mod_file.py
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def test_ioipsl_config(ioipsl):
    # Test parsing of the configuration description
    assert ioipsl == {
        "description": [
            "IOIPSL contains source for library and for rebuild",
            "IOIPSL last tagged public version",
        ],
        "components": [
            {
                "name": "IOIPSL",
                "variant": "IOIPSL/tags/v2_2_5",
                "revision": "HEAD",
                "repository": 8,
                "modipsl_dir": "modeles",
            }
        ],
    }

test_ipslcm7_config

test_ipslcm7_config(ipslcm7)
Source code in tests/test_mod_file.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
def test_ipslcm7_config(ipslcm7):
    # Test parsing of the configuration description
    assert ipslcm7 == {
        "description": [
            "IPSLCM7.0 1st coupled configuration in CM7 family",
            "With this configuration icosa grid or reg grid can be used (user choice)",
            "IPSLCM7 can be use in full coupled configuration or with forced subconfiguration",
            "Regular subconfiguration (without ocean) give same results than with IPSLCM6.2.4",
            "NEMO v4.2.2",
            "XIOS2 branches/XIOS2 07f8fdd9 (SVN : XIOS2/trunk revision 2626)",
            "IOIPSL tags v2_2_5",
            "DYNAMICO master 73d9b2d9",
            "ICOSA_LMDZ rev 4858",
            "LMDZ6 trunk revision 4938",
            "ORCHIDEE_2_2 default : branches/ORCHIDEE_2_2 revision 8572",
            "ORCHIDEE_4 optional  : trunk revision 8571",
            "INCA6 trunk revison  1151",
            "OASIS3-MCT 2.0_branch (rev 1818 Cerfacs server, rev 6331 IPSL server)",
            "CONFIG/IPSLCM7 rev 6881",
            "libIGCM trunk rev 1659",
        ],
        "components": [
            {
                "name": "DYNAMICO",
                "variant": "master",
                "revision": "73d9b2d9",
                "repository": 21,
                "modipsl_dir": "modeles",
            },
            {
                "name": "ICOSA_LMDZ",
                "variant": "ICOSA_LMDZ",
                "revision": "4897",
                "repository": 20,
                "modipsl_dir": "modeles",
            },
            {
                "name": "IOIPSL",
                "variant": "IOIPSL/tags/v2_2_5",
                "revision": "6644",
                "repository": 8,
                "modipsl_dir": "modeles",
            },
            {
                "name": "ORCHIDEE_2_2",
                "variant": "branches/ORCHIDEE_2_2/ORCHIDEE",
                "revision": "8572",
                "repository": 14,
                "modipsl_dir": "modeles",
            },
            {
                "name": "ORCHIDEE_4",
                "variant": "trunk/ORCHIDEE",
                "revision": "8571",
                "repository": 14,
                "modipsl_dir": "modeles",
            },
            {
                "name": "oasis3-mct",
                "variant": "CPL/oasis3-mct/branches/OASIS3-MCT_5.0_branch",
                "revision": "6331",
                "repository": 8,
                "modipsl_dir": ".",
            },
            {
                "name": "LMDZ",
                "variant": "LMDZ6/trunk",
                "revision": "4938",
                "repository": 20,
                "modipsl_dir": "modeles",
            },
            {
                "name": "IPSLCM7",
                "variant": "CONFIG/UNIFORM/v7/IPSLCM7",
                "revision": "6886",
                "repository": 8,
                "modipsl_dir": "config",
            },
            {
                "name": "ORCHIDEE_OL_2_2",
                "variant": "branches/ORCHIDEE_2_2/ORCHIDEE_OL",
                "revision": "8572",
                "repository": 14,
                "modipsl_dir": "config",
            },
            {
                "name": "ORCHIDEE_OL_4",
                "variant": "trunk/ORCHIDEE_OL",
                "revision": "8571",
                "repository": 14,
                "modipsl_dir": "config",
            },
            {
                "name": "libIGCM",
                "variant": "trunk/libIGCM",
                "revision": "1659",
                "repository": 10,
                "modipsl_dir": ".",
            },
            {
                "name": "NEMO",
                "variant": "4.2.2",
                "revision": "7f5d8137",
                "repository": 22,
                "modipsl_dir": "modeles",
            },
            {
                "name": "INCA",
                "variant": "INCA",
                "revision": "INCA6@1151",
                "repository": 9,
                "modipsl_dir": "modeles",
            },
            {
                "name": "XIOS",
                "variant": "XIOS2",
                "revision": "07f8fdd9",
                "repository": 12,
                "modipsl_dir": "modeles",
            },
        ],
    }

test_nemo_v40_confguration

test_nemo_v40_confguration(nemo_v40)
Source code in tests/test_mod_file.py
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
def test_nemo_v40_confguration(nemo_v40):
    # NEMO_v4.0 is interesting to test, because it doesn't contain
    # the last optional column which usually contains duplicated
    # names of components (we don't parse it anyway).
    assert nemo_v40 == {
        "description": [
            "NEMOGCM v4.0.7, first version of NEMOv4 ( Initially NEMO_v6.5 )",
            "libIGCM trunk rev 1534",
            "XIOS branches/XIOS2 4b547204 (SVN : XIOS/trunk revision 1866)",
        ],
        "components": [
            {
                "name": "libIGCM",
                "variant": "trunk/libIGCM",
                "revision": "1581",
                "repository": 10,
                "modipsl_dir": ".",
            },
            {
                "name": "NEMO",
                "variant": "r4.0.7",
                "revision": "baad91e5",
                "repository": 7,
                "modipsl_dir": "modeles",
            },
            {
                "name": "NEMO_v6",
                "variant": "CONFIG/UNIFORM/v6/NEMO_v6.5",
                "revision": "6400",
                "repository": 8,
                "modipsl_dir": "config",
            },
            {
                "name": "XIOS",
                "variant": "XIOS2",
                "revision": "4b547204",
                "repository": 12,
                "modipsl_dir": "modeles",
            },
        ],
    }

test_repository

test_repository(repos)
Source code in tests/test_mod_file.py
45
46
def test_repository(repos):
    assert len(repos) == 19

test_svn_repository

test_svn_repository(repos)
Source code in tests/test_mod_file.py
59
60
61
62
63
64
def test_svn_repository(repos):
    # Test classic svn repo with --username flag
    assert repos[10] == {
        "type": "svn",
        "clone_url": "--username icmc_users https://forge.ipsl.fr/libigcm/svn",
    }

test_svn_ssh_repository

test_svn_ssh_repository(repos)
Source code in tests/test_mod_file.py
75
76
77
78
79
80
def test_svn_ssh_repository(repos):
    # Test repo over svn+ssh protocol
    assert repos[26] == {
        "type": "svn",
        "clone_url": "svn+ssh://<login>@forge.ipsl.fr/ipsl/forge/projets/grisli/svn/",
    }