Skip to content

Commit

Permalink
Fix Spack failing test
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Jan 30, 2023
1 parent 5e51718 commit 868374d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class SpackCache {
}

@PackageScope
int runCommand( String cmd ) {
void runCommand( String cmd ) {
log.trace """spack env create
command: $cmd
timeout: $createTimeout""".stripIndent()
Expand All @@ -317,7 +317,6 @@ class SpackCache {
msg += err.toString().trim().indent(' ')
throw new IllegalStateException(msg)
}
return status
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class SpackCacheTest extends Specification {
then:
1 * cache.spackPrefixPath(ENV) >> PREFIX
0 * cache.isYamlFilePath(ENV)
1 * cache.runCommand( "spack env activate $PREFIX ; spack install -y ; spack env deactivate" )
1 * cache.runCommand( "spack env activate $PREFIX ; spack install -y ; spack env deactivate" ) >> null
result == PREFIX

when:
Expand Down

1 comment on commit 868374d

@pditommaso
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it only checks the method is invoked. But it's expected to run successfully or fail (see the exception)

if( status != 0 ) {
consumer.join()
def msg = "Failed to create spack environment\n command: $cmd\n status : $status\n message:\n"
msg += err.toString().trim().indent(' ')
throw new IllegalStateException(msg)
}

Please sign in to comment.