Skip to content

Commit

Permalink
Updating tests and ci file
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Jan 13, 2024
1 parent 230e0fd commit 389a338
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions test/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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()
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))

0 comments on commit 389a338

Please sign in to comment.