Skip to content

Commit

Permalink
Fix tests on cray (spack#4298)
Browse files Browse the repository at this point in the history
* Check for CRAYPE_VERSION instead of path

Architecture tests would fail on Cray since it would not find
the expected path. To make the test correctly work on Cray search
for the CRAYPE version instead.

* Catch SystemExit error in case flake8 not in path

On shared systems having flake8 can involve starting own virtual env.
Skip the test if no flake8 is found to avoid failure reporting.

* Add compatibility to 1.5 svnadmin create

The flag added is needed to correctly create svn repos on NERSC systems.
This could be unnecessary for other sites. I'd like to see others
test before this change gets merged.
  • Loading branch information
mamelara authored and becker33 committed Jun 15, 2017
1 parent c102be2 commit da67ee9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/spack/spack/test/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_dict_functions_for_architecture():

def test_platform():
output_platform_class = spack.architecture.real_platform()
if os.path.exists('/opt/cray/craype'):
if os.environ.get('CRAYPE_VERSION') is not None:
my_platform_class = Cray()
elif os.path.exists('/bgsys'):
my_platform_class = Bgq()
Expand Down
3 changes: 0 additions & 3 deletions lib/spack/spack/test/cmd/flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ def test_flake8(parser, flake8_package):
# Otherwise, the unit tests would fail every time
# the flake8 tests fail
args = parser.parse_args([flake8_package])

flake8(parser, args)

# Get even more coverage
args = parser.parse_args(['--output', '--root-relative', flake8_package])

flake8(parser, args)
4 changes: 3 additions & 1 deletion lib/spack/spack/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ def mock_svn_repository():
url = 'file://' + str(repodir)
# Initialize the repository
current = repodir.chdir()
svnadmin('create', str(repodir))
# NOTE: Adding --pre-1.5-compatible works for NERSC
# Unknown if this is also an issue at other sites.
svnadmin('create', '--pre-1.5-compatible', str(repodir))

# Import a structure (first commit)
r0_file = 'r0_file'
Expand Down

0 comments on commit da67ee9

Please sign in to comment.