From 389a33818f41932b193face0a65dfdf0c567d8c3 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 12 Jan 2024 20:59:49 -0600 Subject: [PATCH] Updating tests and ci file --- .github/workflows/ci.yml | 6 ++++-- test/test_basic.py | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e10f9dc..9965e2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,9 +50,11 @@ jobs: git checkout 5.3.1 mkdir build cd build - cmake -DENABLE_HDF5=ON -DENABLE_BLASLAPACK=OFF -DENABLE_PYMOAB=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. + cmake -DENABLE_HDF5=ON -DENABLE_BLASLAPACK=OFF -DENABLE_PYMOAB=ON -DCMAKE_INSTALL_PREFIX=$HOME/opt -DCMAKE_BUILD_TYPE=Release .. make -j4 - sudo make install + make install + cd pymoab + pip3 install . - name: Install shell: bash diff --git a/test/test_basic.py b/test/test_basic.py index 0a9f211..637f61e 100644 --- a/test/test_basic.py +++ b/test/test_basic.py @@ -102,6 +102,7 @@ def test_group_merge(request): # volume set w/ ID 3 now fuel_group = groups['mat:fuel'] assert 3 in fuel_group.get_volumes() + assert len(fuel_group.get_volumes()) == orig_group_size + 1 @@ -146,9 +147,18 @@ def test_to_vtk(tmpdir_factory, request): vtk_file = open(vtk_filename, 'r') gold_name = request.path.parent / 'gold_files' / f'.{request.node.name}.gold' + if config['update']: f = open(gold_name, 'w') f.write(vtk_file.read()) else: - f = open(gold_name, 'r') - assert vtk_file.read() == f.read() \ No newline at end of file + gold_file = open(gold_name, 'r') + + # The VTK file header has a MOAB version in it. Filter + # that line out so running this test with other versions of + # MOAB doesn't cause a failure + line_filter = lambda line : not 'MOAB' in line + + vtk_iter = filter(line_filter, vtk_file) + gold_iter = filter(line_filter, gold_file) + assert all(l1 == l2 for l1, l2 in zip(vtk_iter, gold_iter))