summaryrefslogtreecommitdiff
path: root/python-aiida-export-migration-tests.spec
blob: 0e39023270ac938a890a9c9055dc5f4701675d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
224
225
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
264
265
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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
%global _empty_manifest_terminate_build 0
Name:		python-aiida-export-migration-tests
Version:	0.9.0
Release:	1
Summary:	Export archives for migration tests for AiiDA
License:	MIT Licence
URL:		https://github.com/aiidateam/aiida-export-migration-tests
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/ea/90/1c9c13f2fdfa96602c8d72732f1c52d22c352e42e710981d7fb0b6dbe7bf/aiida-export-migration-tests-0.9.0.tar.gz
BuildArch:	noarch


%description
# Testing of AiiDA export file migrations

Test modules for migration of [AiiDA](http://www.aiida.net) export files.

Can be installed by adding `testing` package, when installing AiiDA:

```shell
pip install aiida-core[testing]
```

> **Note**: This only works for AiiDA *v1.0.0* and newer.

Historical table of version comparisons between releases of this module and AiiDA, including when tests for the different export versions are first included.

| This module | AiiDA | Export versions (when first included) |
| ----------- | ----- | ------------------------------------- |
| [0.9.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.9.0) | to be released | 0.9 |
| [0.8.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.8.0) | [1.0.1](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.1) | 0.8 |
| [0.7.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.7.0) | [1.0.0b4](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b4) | 0.6, 0.7 |
| 0.6.0 | [1.0.0b4](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b4) | |
| [0.5.2](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.2) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | |
| [0.5.1](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.1) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | |
| [0.5.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.0) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | 0.4 -> 0.5 |
| [0.1.1](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.1.1) | [1.0.0b2](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b2) | |
| [0.1.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.1.0) | [1.0.0b2](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b2) | 0.1 -> 0.2 ; 0.2 -> 0.3 ; 0.3 -> 0.4 |

## Q&A

**Q: Why not include these test archives in the core of AiiDA?**  
**A:** In order to not take up unneccesary disk space, when installing AiiDA, these test archives have been separated out of [aiida-core](https://github.com/aiidateam/aiida-core).
Furthermore, the legacy export versions will never change, i.e., the incremental migration functions need only be thoroughly tested once, and will therefore not be affected by changes to the core of the AiiDA code in any way.

**Q: What happens when the export version is upped?**  
**A:** A new export archive file will be added to this repo as well as a new test-filled file (to [aiida-core](https://github.com/aiidateam/aiida-core) under `tests.tools.importexport.migration.`).

**Q: What if the import system changes in AiiDA core?**  
**A:** This repo is only for storing the export archives and their creation workflows for different export versions.
All tests can be found in [aiida-core](https://github.com/aiidateam/aiida-core).

## Release notes

### 0.9.0 (April 2020)

**AiiDA version**: _To be released_

Update repository with export archive for export version 0.9.
The file follows the naming of previous export version files having the suffix `_manual`, since it was not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.8_manual.aiida` has been the unpacked, updated manually, and repacked.
This means the latest "proper" export file is `export_v0.4.aiida`.

Changes are expected to be released with AiiDA version 1.2.0.

*New file*: `export_v0.9_manual.aiida`

### 0.8.0 (November 2019)

**AiiDA version**: _1.0.0_

Update repository with export archive for export version 0.8.
The file follows the naming of previous export version files having the suffix `_manual`, since it was not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.7_manual.aiida` has been the unpacked, updated manually, and repacked.
This means the latest "proper" export file is `export_v0.4.aiida`.

Changes are expected to be released with AiiDA version 1.0.1.

*New file*: `export_v0.8_manual.aiida`

### 0.7.0 (July 2019)

**AiiDA version**: _1.0.0b4_

Update repository with export archive for export versions 0.6 and 0.7.  
These files are named differently, having the suffix `_manual`, since they were not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.4.aiida` has been the unpacked, updated manually, and repacked.

The file `export_v0.5.aiida` has also been made this way, and will therefore have its name changed accordingly.

*New files*:

- `export_v0.5_manual.aiida` (only the filename has been altered)
- `export_v0.6_manual.aiida`
- `export_v0.7_manual.aiida`

### 0.6.0 (July 2019)

**AiiDA version**: _1.0.0b4_

This version was never released.

### 0.5.2 (June 2019)

**AiiDA version**: _1.0.0b3_

Remove test files according to issue [#6](https://github.com/aiidateam/aiida-export-migration-tests/issues/6).
The files have been moved to [aiida-core](https://github.com/aiidateam/aiida-core) under `aiida.backends.tests.tools.importexport.migration.`.
As explained in the issue, the problem of having tests that concern files in [aiida-core](https://github.com/aiidateam/aiida-core), is that they cannot be skipped with a helpful message using `unittest.skip(<message>)`.

This repository has now become the keeper of the export archives and the workflows that created them.
Hence, it should only ever be touched, when a new export version is introduced in AiiDA, and a new archive must be added.

### 0.5.1 (June 2019)

**AiiDA version**: _1.0.0b3_

Update imports from aiida-core in accordance with the restructuring of the import/export-module.
For a reference, this was done in aiida-core PR [#3052](https://github.com/aiidateam/aiida-core/pull/3052).

### 0.5.0 (June 2019)

**AiiDA version**: _1.0.0b3_

Update version number of this repository to reflect the current `EXPORT_VERSION` in `aiida-core`.  
The version number is now as follows: `<EXPORT_VERSION>.<patch>`

Implement initial change related to the update of `EXPORT_VERSION` from 0.4 to 0.5:

- _Migration [0034](https://github.com/aiidateam/aiida-core/blob/b8eaffca3c448d1242eded845aa118b4bc1ae1a9/aiida/backends/djsite/db/migrations/0034_drop_node_columns_nodeversion_public.py)_: Remove fields/columns `"nodeversion"` and `"public"` from the `DbNode` model.
- _Migration [0036](https://github.com/aiidateam/aiida-core/blob/af56391b5bdfbbc3e1d0ef7d36180128bb28f695/aiida/backends/djsite/db/migrations/0036_drop_computer_transport_params.py)_: Remove field/column `"transport_params"` from the `DbComputer` model.

_Note_: The newly created `export_v0.5.aiida` under `/aiida-export-migration-tests/archives` is _not_ actually created from an AiiDA workflow, but instead a migration of `export_v0.4.aiida`.
This is because the changes between the versions are insignificant for the outcome of the workflow, and that only very minor changes have occurred.

### 0.1.1 (May 2019)

**AiiDA version**: _1.0.0b2_

Minor fixes due to changes in [aiida-core](https://github.com/aiidateam/aiida-core).

Folder `fixtures` changes name to `archives` to match the same change happening for aiida-core.  
The simple AiiDA export archives in aiida-core representing the different export versions have changed names:

- `export_v0.1_no_UPF.aiida` -> `export_v0.1_simple.aiida`
- `export_v0.2_no_UPF.aiida` -> `export_v0.2_simple.aiida`
- `export_v0.3_no_UPF.aiida` -> `export_v0.3_simple.aiida`
- `export_v0.4_no_UPF.aiida` -> `export_v0.4_simple.aiida`

A change in the conversion message included in `metadata.json` files, when a migration has been successfully performed, introduces the version of AiiDA into the message. In order to have the tests be version-agnostic, the `conversion_info` key has to be handled specially in the relevant tests.  
When migrating an archive, it is asserted that the correct conversion message appears in the migrated archive, and the `conversion_info` item is then popped from both the migrated archive and the archive imported for comparison.

### 0.1.0 (April 2019)

**AiiDA version**: _1.0.0b2_

First release.

Tests for step-wise export migrations from versions 0.1, 0.2, and 0.3.  
Representative export files created in specialized [Quantum Mobile](https://materialscloud.org/work/quantum-mobile) virtual machines by @yakutovicha to test currently known migrations from the basis of what could be exported at the time of the different export versions.

Table of version comparisons (similar to the one in [aiida-core](https://github.com/aiidateam/aiida-core) PR [#2478](https://github.com/aiidateam/aiida-core/pull/2478)).

| Export version | AiiDA version | AiiDA version release date | Found changed in commit |
| -------------- | ------------- | -------------------------- | ----------------------- |
| ~~v0.1~~* | ~~0.6.0.1~~ | ~~01.03.2016~~ | ~~as exported by 0.6.0~~ |
| v0.2 | 0.9.1 | 01.09.2017 | [189e29fea4c7f4213d0be0914d55cccaa581c364](https://github.com/aiidateam/aiida-core/commit/189e29fea4c7f4213d0be0914d55cccaa581c364) (v0.7.0) |
| v0.3 | 0.12.3 | 04.03.2019 | [788d3206e0eaaf062d1a13710aaa64a18a0bbbcd](https://github.com/aiidateam/aiida-core/commit/788d3206e0eaaf062d1a13710aaa64a18a0bbbcd) (v0.10.0rc1) |
| v0.4 | 1.0.0b2 | 09.04.2019 | [1673ec28e8b594693a0ee4cdec82669e72abcc4c](https://github.com/aiidateam/aiida-core/commit/1673ec28e8b594693a0ee4cdec82669e72abcc4c) (v1.0.0b1) |

\*Due to the following reasons, we decided **not** to invest an effort in making the representative archive migration for 0.1:

1. The earliest version released on PyPi is 0.8.0rc1 (22.03.2017).
1. The previous stable version (AiiDA 0.5.0) was not working in a virtual environment.
1. The migration from v0.1 to v0.2 is small and quite simple.
   If an export file should be found that cannot be properly migrated, due to this step, it can be migrated manually with little effort.

## Representative export files creation

To create the representative export files, a simple workflow was developed by @yakutovicha that runs two consequtive [QuantumESPRESSO](https://www.quantum-espresso.org) PW calculations.
First an SCF calculation, followed by an MD calculation.

The workflows can be found in the repository's folder `.qm`, and correspond to the following export versions and [Quantum Mobile](https://github.com/marvel-nccr/quantum-mobile/releases/) editions:

| Export version | Workflow | Run workflow script | Quantum Mobile |
| -------------- | -------- | ------------------- | -------------- |
| ~~v0.1~~* | - | - | - |
| v0.2 | [wf.py](aiida-export-migration-tests/.qm/wf.py) | [run_wf.py](aiida-export-migration-tests/.qm/run_wf.py) | [historical_aiida_0.9.1](https://github.com/marvel-nccr/quantum-mobile/tree/historical_aiida_0.9.1) |
| v0.3 | [wf.py](aiida-export-migration-tests/.qm/wf.py) | [run_wf.py](aiida-export-migration-tests/.qm/run_wf.py) | [v19.03.0](https://github.com/marvel-nccr/quantum-mobile/releases/tag/19.03.0) |
| v0.4 | [wf_aiida_1_0.py](aiida-export-migration-tests/.qm/wf_aiida_1_0.py) | [run_wf_aiida_1_0.py](aiida-export-migration-tests/.qm/run_wf_aiida_1_0.py) | _in development_ |

\*See section _Release notes#0.1.0 (April 2019)_.

They contain the following AiiDA node types (according to AiiDA **1.0.0**):

| Node type | Parent-type tree, up to `Node` |
| --------- | -------- |
| Float | NumericType -> BaseType/Data -> Node |
| Int | NumericType -> BaseType/Data -> Node |
| Dict | Data -> Node |
| FolderData | Data -> Node |
| RemoteData | Data -> Node |
| StructureData | Data -> Node |
| UpfData | SinglefileData -> Data -> Node |
| KpointsData | ArrayData -> Data -> Node |
| BandsData | KpointsData -> ArrayData -> Data -> Node |
| TrajectoryData | ArrayData -> Data -> Node |
| Code | Data -> Node |
| WorkChainNode | WorkflowNode -> ProcessNode -> Node |
| CalcJobNode | CalculationNode -> ProcessNode -> Node |

%package -n python3-aiida-export-migration-tests
Summary:	Export archives for migration tests for AiiDA
Provides:	python-aiida-export-migration-tests
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-aiida-export-migration-tests
# Testing of AiiDA export file migrations

Test modules for migration of [AiiDA](http://www.aiida.net) export files.

Can be installed by adding `testing` package, when installing AiiDA:

```shell
pip install aiida-core[testing]
```

> **Note**: This only works for AiiDA *v1.0.0* and newer.

Historical table of version comparisons between releases of this module and AiiDA, including when tests for the different export versions are first included.

| This module | AiiDA | Export versions (when first included) |
| ----------- | ----- | ------------------------------------- |
| [0.9.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.9.0) | to be released | 0.9 |
| [0.8.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.8.0) | [1.0.1](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.1) | 0.8 |
| [0.7.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.7.0) | [1.0.0b4](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b4) | 0.6, 0.7 |
| 0.6.0 | [1.0.0b4](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b4) | |
| [0.5.2](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.2) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | |
| [0.5.1](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.1) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | |
| [0.5.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.0) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | 0.4 -> 0.5 |
| [0.1.1](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.1.1) | [1.0.0b2](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b2) | |
| [0.1.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.1.0) | [1.0.0b2](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b2) | 0.1 -> 0.2 ; 0.2 -> 0.3 ; 0.3 -> 0.4 |

## Q&A

**Q: Why not include these test archives in the core of AiiDA?**  
**A:** In order to not take up unneccesary disk space, when installing AiiDA, these test archives have been separated out of [aiida-core](https://github.com/aiidateam/aiida-core).
Furthermore, the legacy export versions will never change, i.e., the incremental migration functions need only be thoroughly tested once, and will therefore not be affected by changes to the core of the AiiDA code in any way.

**Q: What happens when the export version is upped?**  
**A:** A new export archive file will be added to this repo as well as a new test-filled file (to [aiida-core](https://github.com/aiidateam/aiida-core) under `tests.tools.importexport.migration.`).

**Q: What if the import system changes in AiiDA core?**  
**A:** This repo is only for storing the export archives and their creation workflows for different export versions.
All tests can be found in [aiida-core](https://github.com/aiidateam/aiida-core).

## Release notes

### 0.9.0 (April 2020)

**AiiDA version**: _To be released_

Update repository with export archive for export version 0.9.
The file follows the naming of previous export version files having the suffix `_manual`, since it was not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.8_manual.aiida` has been the unpacked, updated manually, and repacked.
This means the latest "proper" export file is `export_v0.4.aiida`.

Changes are expected to be released with AiiDA version 1.2.0.

*New file*: `export_v0.9_manual.aiida`

### 0.8.0 (November 2019)

**AiiDA version**: _1.0.0_

Update repository with export archive for export version 0.8.
The file follows the naming of previous export version files having the suffix `_manual`, since it was not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.7_manual.aiida` has been the unpacked, updated manually, and repacked.
This means the latest "proper" export file is `export_v0.4.aiida`.

Changes are expected to be released with AiiDA version 1.0.1.

*New file*: `export_v0.8_manual.aiida`

### 0.7.0 (July 2019)

**AiiDA version**: _1.0.0b4_

Update repository with export archive for export versions 0.6 and 0.7.  
These files are named differently, having the suffix `_manual`, since they were not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.4.aiida` has been the unpacked, updated manually, and repacked.

The file `export_v0.5.aiida` has also been made this way, and will therefore have its name changed accordingly.

*New files*:

- `export_v0.5_manual.aiida` (only the filename has been altered)
- `export_v0.6_manual.aiida`
- `export_v0.7_manual.aiida`

### 0.6.0 (July 2019)

**AiiDA version**: _1.0.0b4_

This version was never released.

### 0.5.2 (June 2019)

**AiiDA version**: _1.0.0b3_

Remove test files according to issue [#6](https://github.com/aiidateam/aiida-export-migration-tests/issues/6).
The files have been moved to [aiida-core](https://github.com/aiidateam/aiida-core) under `aiida.backends.tests.tools.importexport.migration.`.
As explained in the issue, the problem of having tests that concern files in [aiida-core](https://github.com/aiidateam/aiida-core), is that they cannot be skipped with a helpful message using `unittest.skip(<message>)`.

This repository has now become the keeper of the export archives and the workflows that created them.
Hence, it should only ever be touched, when a new export version is introduced in AiiDA, and a new archive must be added.

### 0.5.1 (June 2019)

**AiiDA version**: _1.0.0b3_

Update imports from aiida-core in accordance with the restructuring of the import/export-module.
For a reference, this was done in aiida-core PR [#3052](https://github.com/aiidateam/aiida-core/pull/3052).

### 0.5.0 (June 2019)

**AiiDA version**: _1.0.0b3_

Update version number of this repository to reflect the current `EXPORT_VERSION` in `aiida-core`.  
The version number is now as follows: `<EXPORT_VERSION>.<patch>`

Implement initial change related to the update of `EXPORT_VERSION` from 0.4 to 0.5:

- _Migration [0034](https://github.com/aiidateam/aiida-core/blob/b8eaffca3c448d1242eded845aa118b4bc1ae1a9/aiida/backends/djsite/db/migrations/0034_drop_node_columns_nodeversion_public.py)_: Remove fields/columns `"nodeversion"` and `"public"` from the `DbNode` model.
- _Migration [0036](https://github.com/aiidateam/aiida-core/blob/af56391b5bdfbbc3e1d0ef7d36180128bb28f695/aiida/backends/djsite/db/migrations/0036_drop_computer_transport_params.py)_: Remove field/column `"transport_params"` from the `DbComputer` model.

_Note_: The newly created `export_v0.5.aiida` under `/aiida-export-migration-tests/archives` is _not_ actually created from an AiiDA workflow, but instead a migration of `export_v0.4.aiida`.
This is because the changes between the versions are insignificant for the outcome of the workflow, and that only very minor changes have occurred.

### 0.1.1 (May 2019)

**AiiDA version**: _1.0.0b2_

Minor fixes due to changes in [aiida-core](https://github.com/aiidateam/aiida-core).

Folder `fixtures` changes name to `archives` to match the same change happening for aiida-core.  
The simple AiiDA export archives in aiida-core representing the different export versions have changed names:

- `export_v0.1_no_UPF.aiida` -> `export_v0.1_simple.aiida`
- `export_v0.2_no_UPF.aiida` -> `export_v0.2_simple.aiida`
- `export_v0.3_no_UPF.aiida` -> `export_v0.3_simple.aiida`
- `export_v0.4_no_UPF.aiida` -> `export_v0.4_simple.aiida`

A change in the conversion message included in `metadata.json` files, when a migration has been successfully performed, introduces the version of AiiDA into the message. In order to have the tests be version-agnostic, the `conversion_info` key has to be handled specially in the relevant tests.  
When migrating an archive, it is asserted that the correct conversion message appears in the migrated archive, and the `conversion_info` item is then popped from both the migrated archive and the archive imported for comparison.

### 0.1.0 (April 2019)

**AiiDA version**: _1.0.0b2_

First release.

Tests for step-wise export migrations from versions 0.1, 0.2, and 0.3.  
Representative export files created in specialized [Quantum Mobile](https://materialscloud.org/work/quantum-mobile) virtual machines by @yakutovicha to test currently known migrations from the basis of what could be exported at the time of the different export versions.

Table of version comparisons (similar to the one in [aiida-core](https://github.com/aiidateam/aiida-core) PR [#2478](https://github.com/aiidateam/aiida-core/pull/2478)).

| Export version | AiiDA version | AiiDA version release date | Found changed in commit |
| -------------- | ------------- | -------------------------- | ----------------------- |
| ~~v0.1~~* | ~~0.6.0.1~~ | ~~01.03.2016~~ | ~~as exported by 0.6.0~~ |
| v0.2 | 0.9.1 | 01.09.2017 | [189e29fea4c7f4213d0be0914d55cccaa581c364](https://github.com/aiidateam/aiida-core/commit/189e29fea4c7f4213d0be0914d55cccaa581c364) (v0.7.0) |
| v0.3 | 0.12.3 | 04.03.2019 | [788d3206e0eaaf062d1a13710aaa64a18a0bbbcd](https://github.com/aiidateam/aiida-core/commit/788d3206e0eaaf062d1a13710aaa64a18a0bbbcd) (v0.10.0rc1) |
| v0.4 | 1.0.0b2 | 09.04.2019 | [1673ec28e8b594693a0ee4cdec82669e72abcc4c](https://github.com/aiidateam/aiida-core/commit/1673ec28e8b594693a0ee4cdec82669e72abcc4c) (v1.0.0b1) |

\*Due to the following reasons, we decided **not** to invest an effort in making the representative archive migration for 0.1:

1. The earliest version released on PyPi is 0.8.0rc1 (22.03.2017).
1. The previous stable version (AiiDA 0.5.0) was not working in a virtual environment.
1. The migration from v0.1 to v0.2 is small and quite simple.
   If an export file should be found that cannot be properly migrated, due to this step, it can be migrated manually with little effort.

## Representative export files creation

To create the representative export files, a simple workflow was developed by @yakutovicha that runs two consequtive [QuantumESPRESSO](https://www.quantum-espresso.org) PW calculations.
First an SCF calculation, followed by an MD calculation.

The workflows can be found in the repository's folder `.qm`, and correspond to the following export versions and [Quantum Mobile](https://github.com/marvel-nccr/quantum-mobile/releases/) editions:

| Export version | Workflow | Run workflow script | Quantum Mobile |
| -------------- | -------- | ------------------- | -------------- |
| ~~v0.1~~* | - | - | - |
| v0.2 | [wf.py](aiida-export-migration-tests/.qm/wf.py) | [run_wf.py](aiida-export-migration-tests/.qm/run_wf.py) | [historical_aiida_0.9.1](https://github.com/marvel-nccr/quantum-mobile/tree/historical_aiida_0.9.1) |
| v0.3 | [wf.py](aiida-export-migration-tests/.qm/wf.py) | [run_wf.py](aiida-export-migration-tests/.qm/run_wf.py) | [v19.03.0](https://github.com/marvel-nccr/quantum-mobile/releases/tag/19.03.0) |
| v0.4 | [wf_aiida_1_0.py](aiida-export-migration-tests/.qm/wf_aiida_1_0.py) | [run_wf_aiida_1_0.py](aiida-export-migration-tests/.qm/run_wf_aiida_1_0.py) | _in development_ |

\*See section _Release notes#0.1.0 (April 2019)_.

They contain the following AiiDA node types (according to AiiDA **1.0.0**):

| Node type | Parent-type tree, up to `Node` |
| --------- | -------- |
| Float | NumericType -> BaseType/Data -> Node |
| Int | NumericType -> BaseType/Data -> Node |
| Dict | Data -> Node |
| FolderData | Data -> Node |
| RemoteData | Data -> Node |
| StructureData | Data -> Node |
| UpfData | SinglefileData -> Data -> Node |
| KpointsData | ArrayData -> Data -> Node |
| BandsData | KpointsData -> ArrayData -> Data -> Node |
| TrajectoryData | ArrayData -> Data -> Node |
| Code | Data -> Node |
| WorkChainNode | WorkflowNode -> ProcessNode -> Node |
| CalcJobNode | CalculationNode -> ProcessNode -> Node |

%package help
Summary:	Development documents and examples for aiida-export-migration-tests
Provides:	python3-aiida-export-migration-tests-doc
%description help
# Testing of AiiDA export file migrations

Test modules for migration of [AiiDA](http://www.aiida.net) export files.

Can be installed by adding `testing` package, when installing AiiDA:

```shell
pip install aiida-core[testing]
```

> **Note**: This only works for AiiDA *v1.0.0* and newer.

Historical table of version comparisons between releases of this module and AiiDA, including when tests for the different export versions are first included.

| This module | AiiDA | Export versions (when first included) |
| ----------- | ----- | ------------------------------------- |
| [0.9.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.9.0) | to be released | 0.9 |
| [0.8.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.8.0) | [1.0.1](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.1) | 0.8 |
| [0.7.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.7.0) | [1.0.0b4](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b4) | 0.6, 0.7 |
| 0.6.0 | [1.0.0b4](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b4) | |
| [0.5.2](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.2) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | |
| [0.5.1](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.1) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | |
| [0.5.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.5.0) | [1.0.0b3](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b3) | 0.4 -> 0.5 |
| [0.1.1](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.1.1) | [1.0.0b2](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b2) | |
| [0.1.0](https://github.com/aiidateam/aiida-export-migration-tests/releases/tag/v0.1.0) | [1.0.0b2](https://github.com/aiidateam/aiida-core/releases/tag/v1.0.0b2) | 0.1 -> 0.2 ; 0.2 -> 0.3 ; 0.3 -> 0.4 |

## Q&A

**Q: Why not include these test archives in the core of AiiDA?**  
**A:** In order to not take up unneccesary disk space, when installing AiiDA, these test archives have been separated out of [aiida-core](https://github.com/aiidateam/aiida-core).
Furthermore, the legacy export versions will never change, i.e., the incremental migration functions need only be thoroughly tested once, and will therefore not be affected by changes to the core of the AiiDA code in any way.

**Q: What happens when the export version is upped?**  
**A:** A new export archive file will be added to this repo as well as a new test-filled file (to [aiida-core](https://github.com/aiidateam/aiida-core) under `tests.tools.importexport.migration.`).

**Q: What if the import system changes in AiiDA core?**  
**A:** This repo is only for storing the export archives and their creation workflows for different export versions.
All tests can be found in [aiida-core](https://github.com/aiidateam/aiida-core).

## Release notes

### 0.9.0 (April 2020)

**AiiDA version**: _To be released_

Update repository with export archive for export version 0.9.
The file follows the naming of previous export version files having the suffix `_manual`, since it was not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.8_manual.aiida` has been the unpacked, updated manually, and repacked.
This means the latest "proper" export file is `export_v0.4.aiida`.

Changes are expected to be released with AiiDA version 1.2.0.

*New file*: `export_v0.9_manual.aiida`

### 0.8.0 (November 2019)

**AiiDA version**: _1.0.0_

Update repository with export archive for export version 0.8.
The file follows the naming of previous export version files having the suffix `_manual`, since it was not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.7_manual.aiida` has been the unpacked, updated manually, and repacked.
This means the latest "proper" export file is `export_v0.4.aiida`.

Changes are expected to be released with AiiDA version 1.0.1.

*New file*: `export_v0.8_manual.aiida`

### 0.7.0 (July 2019)

**AiiDA version**: _1.0.0b4_

Update repository with export archive for export versions 0.6 and 0.7.  
These files are named differently, having the suffix `_manual`, since they were not produced properly, i.e., through a new workflow run in AiiDA.
Instead, the export file `export_v0.4.aiida` has been the unpacked, updated manually, and repacked.

The file `export_v0.5.aiida` has also been made this way, and will therefore have its name changed accordingly.

*New files*:

- `export_v0.5_manual.aiida` (only the filename has been altered)
- `export_v0.6_manual.aiida`
- `export_v0.7_manual.aiida`

### 0.6.0 (July 2019)

**AiiDA version**: _1.0.0b4_

This version was never released.

### 0.5.2 (June 2019)

**AiiDA version**: _1.0.0b3_

Remove test files according to issue [#6](https://github.com/aiidateam/aiida-export-migration-tests/issues/6).
The files have been moved to [aiida-core](https://github.com/aiidateam/aiida-core) under `aiida.backends.tests.tools.importexport.migration.`.
As explained in the issue, the problem of having tests that concern files in [aiida-core](https://github.com/aiidateam/aiida-core), is that they cannot be skipped with a helpful message using `unittest.skip(<message>)`.

This repository has now become the keeper of the export archives and the workflows that created them.
Hence, it should only ever be touched, when a new export version is introduced in AiiDA, and a new archive must be added.

### 0.5.1 (June 2019)

**AiiDA version**: _1.0.0b3_

Update imports from aiida-core in accordance with the restructuring of the import/export-module.
For a reference, this was done in aiida-core PR [#3052](https://github.com/aiidateam/aiida-core/pull/3052).

### 0.5.0 (June 2019)

**AiiDA version**: _1.0.0b3_

Update version number of this repository to reflect the current `EXPORT_VERSION` in `aiida-core`.  
The version number is now as follows: `<EXPORT_VERSION>.<patch>`

Implement initial change related to the update of `EXPORT_VERSION` from 0.4 to 0.5:

- _Migration [0034](https://github.com/aiidateam/aiida-core/blob/b8eaffca3c448d1242eded845aa118b4bc1ae1a9/aiida/backends/djsite/db/migrations/0034_drop_node_columns_nodeversion_public.py)_: Remove fields/columns `"nodeversion"` and `"public"` from the `DbNode` model.
- _Migration [0036](https://github.com/aiidateam/aiida-core/blob/af56391b5bdfbbc3e1d0ef7d36180128bb28f695/aiida/backends/djsite/db/migrations/0036_drop_computer_transport_params.py)_: Remove field/column `"transport_params"` from the `DbComputer` model.

_Note_: The newly created `export_v0.5.aiida` under `/aiida-export-migration-tests/archives` is _not_ actually created from an AiiDA workflow, but instead a migration of `export_v0.4.aiida`.
This is because the changes between the versions are insignificant for the outcome of the workflow, and that only very minor changes have occurred.

### 0.1.1 (May 2019)

**AiiDA version**: _1.0.0b2_

Minor fixes due to changes in [aiida-core](https://github.com/aiidateam/aiida-core).

Folder `fixtures` changes name to `archives` to match the same change happening for aiida-core.  
The simple AiiDA export archives in aiida-core representing the different export versions have changed names:

- `export_v0.1_no_UPF.aiida` -> `export_v0.1_simple.aiida`
- `export_v0.2_no_UPF.aiida` -> `export_v0.2_simple.aiida`
- `export_v0.3_no_UPF.aiida` -> `export_v0.3_simple.aiida`
- `export_v0.4_no_UPF.aiida` -> `export_v0.4_simple.aiida`

A change in the conversion message included in `metadata.json` files, when a migration has been successfully performed, introduces the version of AiiDA into the message. In order to have the tests be version-agnostic, the `conversion_info` key has to be handled specially in the relevant tests.  
When migrating an archive, it is asserted that the correct conversion message appears in the migrated archive, and the `conversion_info` item is then popped from both the migrated archive and the archive imported for comparison.

### 0.1.0 (April 2019)

**AiiDA version**: _1.0.0b2_

First release.

Tests for step-wise export migrations from versions 0.1, 0.2, and 0.3.  
Representative export files created in specialized [Quantum Mobile](https://materialscloud.org/work/quantum-mobile) virtual machines by @yakutovicha to test currently known migrations from the basis of what could be exported at the time of the different export versions.

Table of version comparisons (similar to the one in [aiida-core](https://github.com/aiidateam/aiida-core) PR [#2478](https://github.com/aiidateam/aiida-core/pull/2478)).

| Export version | AiiDA version | AiiDA version release date | Found changed in commit |
| -------------- | ------------- | -------------------------- | ----------------------- |
| ~~v0.1~~* | ~~0.6.0.1~~ | ~~01.03.2016~~ | ~~as exported by 0.6.0~~ |
| v0.2 | 0.9.1 | 01.09.2017 | [189e29fea4c7f4213d0be0914d55cccaa581c364](https://github.com/aiidateam/aiida-core/commit/189e29fea4c7f4213d0be0914d55cccaa581c364) (v0.7.0) |
| v0.3 | 0.12.3 | 04.03.2019 | [788d3206e0eaaf062d1a13710aaa64a18a0bbbcd](https://github.com/aiidateam/aiida-core/commit/788d3206e0eaaf062d1a13710aaa64a18a0bbbcd) (v0.10.0rc1) |
| v0.4 | 1.0.0b2 | 09.04.2019 | [1673ec28e8b594693a0ee4cdec82669e72abcc4c](https://github.com/aiidateam/aiida-core/commit/1673ec28e8b594693a0ee4cdec82669e72abcc4c) (v1.0.0b1) |

\*Due to the following reasons, we decided **not** to invest an effort in making the representative archive migration for 0.1:

1. The earliest version released on PyPi is 0.8.0rc1 (22.03.2017).
1. The previous stable version (AiiDA 0.5.0) was not working in a virtual environment.
1. The migration from v0.1 to v0.2 is small and quite simple.
   If an export file should be found that cannot be properly migrated, due to this step, it can be migrated manually with little effort.

## Representative export files creation

To create the representative export files, a simple workflow was developed by @yakutovicha that runs two consequtive [QuantumESPRESSO](https://www.quantum-espresso.org) PW calculations.
First an SCF calculation, followed by an MD calculation.

The workflows can be found in the repository's folder `.qm`, and correspond to the following export versions and [Quantum Mobile](https://github.com/marvel-nccr/quantum-mobile/releases/) editions:

| Export version | Workflow | Run workflow script | Quantum Mobile |
| -------------- | -------- | ------------------- | -------------- |
| ~~v0.1~~* | - | - | - |
| v0.2 | [wf.py](aiida-export-migration-tests/.qm/wf.py) | [run_wf.py](aiida-export-migration-tests/.qm/run_wf.py) | [historical_aiida_0.9.1](https://github.com/marvel-nccr/quantum-mobile/tree/historical_aiida_0.9.1) |
| v0.3 | [wf.py](aiida-export-migration-tests/.qm/wf.py) | [run_wf.py](aiida-export-migration-tests/.qm/run_wf.py) | [v19.03.0](https://github.com/marvel-nccr/quantum-mobile/releases/tag/19.03.0) |
| v0.4 | [wf_aiida_1_0.py](aiida-export-migration-tests/.qm/wf_aiida_1_0.py) | [run_wf_aiida_1_0.py](aiida-export-migration-tests/.qm/run_wf_aiida_1_0.py) | _in development_ |

\*See section _Release notes#0.1.0 (April 2019)_.

They contain the following AiiDA node types (according to AiiDA **1.0.0**):

| Node type | Parent-type tree, up to `Node` |
| --------- | -------- |
| Float | NumericType -> BaseType/Data -> Node |
| Int | NumericType -> BaseType/Data -> Node |
| Dict | Data -> Node |
| FolderData | Data -> Node |
| RemoteData | Data -> Node |
| StructureData | Data -> Node |
| UpfData | SinglefileData -> Data -> Node |
| KpointsData | ArrayData -> Data -> Node |
| BandsData | KpointsData -> ArrayData -> Data -> Node |
| TrajectoryData | ArrayData -> Data -> Node |
| Code | Data -> Node |
| WorkChainNode | WorkflowNode -> ProcessNode -> Node |
| CalcJobNode | CalculationNode -> ProcessNode -> Node |

%prep
%autosetup -n aiida-export-migration-tests-0.9.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-aiida-export-migration-tests -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 0.9.0-1
- Package Spec generated