[ovito] 07/10: Cherry-pick upstream fix for parallel execution of tests

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Jan 13 20:38:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository ovito.

commit b7face1c6aaa35a29c81ba1476728cce16ae6ed0
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Fri Jan 13 15:39:02 2017 +0000

    Cherry-pick upstream fix for parallel execution of tests
    
    - New patch 0002-Fixing-issue-3-Test-suite-can-fail-when-executed-in-.patch
    
    Gbp-Dch: full
---
 ...e-3-Test-suite-can-fail-when-executed-in-.patch | 160 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 161 insertions(+)

diff --git a/debian/patches/0002-Fixing-issue-3-Test-suite-can-fail-when-executed-in-.patch b/debian/patches/0002-Fixing-issue-3-Test-suite-can-fail-when-executed-in-.patch
new file mode 100644
index 0000000..e77462f
--- /dev/null
+++ b/debian/patches/0002-Fixing-issue-3-Test-suite-can-fail-when-executed-in-.patch
@@ -0,0 +1,160 @@
+From: Alexander Stukowski <stukowski at mm.tu-darmstadt.de>
+Date: Tue, 3 Jan 2017 19:47:32 +0100
+Subject: Fixing issue #3: Test suite can fail when executed in parallel.
+
+---
+ tests/scripts/test_suite/avi_output.py       | 17 ++++++++------
+ tests/scripts/test_suite/dataset.py          |  2 --
+ tests/scripts/test_suite/export_file.py      | 34 ++++++++++++++--------------
+ tests/scripts/test_suite/export_file_text.py |  4 ++--
+ tests/scripts/test_suite/povray_exporter.py  |  7 +++---
+ tests/scripts/test_suite/save_scene.py       | 13 +++++++----
+ 6 files changed, 41 insertions(+), 36 deletions(-)
+
+diff --git a/tests/scripts/test_suite/avi_output.py b/tests/scripts/test_suite/avi_output.py
+index f9a8b722..02bd1d65 100644
+--- a/tests/scripts/test_suite/avi_output.py
++++ b/tests/scripts/test_suite/avi_output.py
+@@ -4,16 +4,19 @@ from ovito.vis import *
+ import os
+ import os.path
+ 
+-import_file("../../files/LAMMPS/animation.dump.gz", multiple_frames = True)
++node = import_file("../../files/LAMMPS/animation.dump.gz", multiple_frames = True)
++node.add_to_scene()
+ 
+ vp = ovito.dataset.viewports.active_vp
+ 
+-if os.path.isfile("movie.avi"):
+-    os.remove("movie.avi")
+-assert(not os.path.isfile("movie.avi"))
++output_file = "_movie.avi"
++
++if os.path.isfile(output_file):
++    os.remove(output_file)
++assert(not os.path.isfile(output_file))
+ 
+ settings = RenderSettings(
+-    filename = "movie.avi",
++    filename = output_file,
+     size = (64, 64),
+     range = RenderSettings.Range.ANIMATION        
+ )
+@@ -21,5 +24,5 @@ if ovito.headless_mode:
+     settings.renderer = TachyonRenderer(ambient_occlusion = False, antialiasing = False)
+ vp.render(settings)
+ 
+-assert(os.path.isfile("movie.avi"))
+-os.remove("movie.avi")
++assert(os.path.isfile(output_file))
++os.remove(output_file)
+diff --git a/tests/scripts/test_suite/dataset.py b/tests/scripts/test_suite/dataset.py
+index 01c41c90..8fc04bc1 100644
+--- a/tests/scripts/test_suite/dataset.py
++++ b/tests/scripts/test_suite/dataset.py
+@@ -28,5 +28,3 @@ assert(scene_nodes[0] == o2)
+ 
+ del scene_nodes[0]
+ assert(len(scene_nodes) == 0)
+-
+-ovito.dataset.save("../../files/output.ovito")
+\ No newline at end of file
+diff --git a/tests/scripts/test_suite/export_file.py b/tests/scripts/test_suite/export_file.py
+index d37ed0e3..9f2ec666 100644
+--- a/tests/scripts/test_suite/export_file.py
++++ b/tests/scripts/test_suite/export_file.py
+@@ -9,22 +9,22 @@ test_data_dir = "../../files/"
+ 
+ node1 = import_file(test_data_dir + "LAMMPS/class2.data", atom_style = "full")
+ print(node1.source)
+-export_file(node1, "test.data", "lammps_data", atom_style = "full")
+-export_file(node1, "test.data", "lammps_data", atom_style = "bond")
+-export_file(node1, "test.data", "lammps_dump", columns = ["Particle Identifier", "Particle Type", "Position.X", "Position.Y", "Position.Z"])
+-export_file(node1, "test.data", "fhi-aims")
+-export_file(node1, "test.data", "imd")
+-export_file(node1, "test.data", "vasp")
+-export_file(node1, "test.data", "povray")
+-export_file(node1, "test.data", "xyz", columns = ["Position.X", "Position.Y", "Position.Z"])
++export_file(node1, "_export_file_test.data", "lammps_data", atom_style = "full")
++export_file(node1, "_export_file_test.data", "lammps_data", atom_style = "bond")
++export_file(node1, "_export_file_test.data", "lammps_dump", columns = ["Particle Identifier", "Particle Type", "Position.X", "Position.Y", "Position.Z"])
++export_file(node1, "_export_file_test.data", "fhi-aims")
++export_file(node1, "_export_file_test.data", "imd")
++export_file(node1, "_export_file_test.data", "vasp")
++export_file(node1, "_export_file_test.data", "povray")
++export_file(node1, "_export_file_test.data", "xyz", columns = ["Position.X", "Position.Y", "Position.Z"])
+ ovito.dataset.anim.last_frame = 7
+-export_file(node1, "test.dump", "lammps_dump", columns = ["Position.X", "Position.Y", "Position.Z"], multiple_frames = True)
+-export_file(node1, "test.*.dump", "lammps_dump", columns = ["Position.X", "Position.Y", "Position.Z"], multiple_frames = True, start_frame = 1, end_frame = 5, every_nth_frame = 2)
+-os.remove("test.data")
+-os.remove("test.dump")
+-os.remove("test.1.dump")
+-os.remove("test.3.dump")
+-os.remove("test.5.dump")
++export_file(node1, "_export_file_test.dump", "lammps_dump", columns = ["Position.X", "Position.Y", "Position.Z"], multiple_frames = True)
++export_file(node1, "_export_file_test.*.dump", "lammps_dump", columns = ["Position.X", "Position.Y", "Position.Z"], multiple_frames = True, start_frame = 1, end_frame = 5, every_nth_frame = 2)
++os.remove("_export_file_test.data")
++os.remove("_export_file_test.dump")
++os.remove("_export_file_test.1.dump")
++os.remove("_export_file_test.3.dump")
++os.remove("_export_file_test.5.dump")
+ for i in range(ovito.dataset.anim.last_frame + 1):
+-    export_file(node1, "test.%i.dump" % i, "lammps_dump", columns = ["Position.X", "Position.Y", "Position.Z"], frame = i)
+-    os.remove("test.%i.dump" % i)
+\ No newline at end of file
++    export_file(node1, "_export_file_test.%i.dump" % i, "lammps_dump", columns = ["Position.X", "Position.Y", "Position.Z"], frame = i)
++    os.remove("_export_file_test.%i.dump" % i)
+\ No newline at end of file
+diff --git a/tests/scripts/test_suite/export_file_text.py b/tests/scripts/test_suite/export_file_text.py
+index a792fac2..23a098d4 100644
+--- a/tests/scripts/test_suite/export_file_text.py
++++ b/tests/scripts/test_suite/export_file_text.py
+@@ -6,5 +6,5 @@ import os.path
+ test_data_dir = "../../files/"
+ 
+ node = import_file(test_data_dir + "LAMMPS/animation1.dump", multiple_frames = True)
+-export_file(node, "test.data", "txt", columns = ["Timestep", "SourceFrame"], multiple_frames = True)
+-os.remove("test.data")
+\ No newline at end of file
++export_file(node, "_export_file_text.data", "txt", columns = ["Timestep", "SourceFrame"], multiple_frames = True)
++os.remove("_export_file_text.data")
+\ No newline at end of file
+diff --git a/tests/scripts/test_suite/povray_exporter.py b/tests/scripts/test_suite/povray_exporter.py
+index c045ae8c..2d5f8160 100644
+--- a/tests/scripts/test_suite/povray_exporter.py
++++ b/tests/scripts/test_suite/povray_exporter.py
+@@ -9,6 +9,7 @@ node1 = import_file(test_data_dir + "LAMMPS/class2.data", atom_style = "full")
+ node1.add_to_scene()
+ node1.source.particle_properties.position.display.shape = ParticleDisplay.Shape.Square
+ node1.source.particle_properties.position.display.radius = 0.3
+-export_file(node1, "test.pov", "povray")
+-export_file(None, "test.pov", "povray")
+-os.remove("test.pov")
++export_file(node1, "_povray_export_test.pov", "povray")
++export_file(None, "_povray_export_test.pov", "povray")
++assert(os.path.isfile("_povray_export_test.pov"))
++os.remove("_povray_export_test.pov")
+diff --git a/tests/scripts/test_suite/save_scene.py b/tests/scripts/test_suite/save_scene.py
+index e02231d0..2950bb2b 100644
+--- a/tests/scripts/test_suite/save_scene.py
++++ b/tests/scripts/test_suite/save_scene.py
+@@ -3,11 +3,14 @@ from ovito.io import *
+ import os
+ import os.path
+ 
+-import_file("../../files/LAMMPS/animation.dump.gz")
++node = import_file("../../files/LAMMPS/animation.dump.gz")
++node.add_to_scene()
+ 
+-if os.path.isfile("scene.ovito"): os.remove("scene.ovito")
++output_test_file = "_save_scene.ovito"
+ 
+-ovito.dataset.save("scene.ovito")
+-assert(os.path.isfile("scene.ovito"))
++if os.path.isfile(output_test_file): os.remove(output_test_file)
+ 
+-os.remove("scene.ovito")
++ovito.dataset.save(output_test_file)
++assert(os.path.isfile(output_test_file))
++
++os.remove(output_test_file)
diff --git a/debian/patches/series b/debian/patches/series
index ba24a11..52fe7d2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-Disable-povray-test.patch
+0002-Fixing-issue-3-Test-suite-can-fail-when-executed-in-.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ovito.git



More information about the debian-science-commits mailing list