Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify absolute path to benchcab executable #117

Merged
merged 3 commits into from
Jul 26, 2023

Conversation

SeanBryan51
Copy link
Collaborator

@SeanBryan51 SeanBryan51 commented Jul 19, 2023

This change specifies the absolute path to the benchcab executable in the job script so that we don't run into path issues when running using a 'locally installed' version of benchcab. This will be helpful making code changes and testing them on NCI.

Fixes #95

@SeanBryan51 SeanBryan51 linked an issue Jul 19, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #117 (b5c1956) into master (677d761) will increase coverage by 0.07%.
Report is 1 commits behind head on master.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
+ Coverage   88.48%   88.55%   +0.07%     
==========================================
  Files          26       26              
  Lines        1372     1381       +9     
==========================================
+ Hits         1214     1223       +9     
  Misses        158      158              
Files Changed Coverage Δ
benchcab/utils/pbs.py 100.00% <ø> (ø)
tests/test_pbs.py 100.00% <ø> (ø)
benchcab/benchcab.py 37.17% <80.00%> (+1.65%) ⬆️
tests/test_benchcab.py 100.00% <100.00%> (ø)

This change specifies the absolute path to the benchcab executable in
the job script so that we don't run into path issues when running using
a 'locally installed' version of benchcab. This will be helpful making
code changes and testing them on NCI.

Fixes #95
@SeanBryan51 SeanBryan51 force-pushed the 95-specify-absolute-path-to-executable branch from 296077c to c969c5e Compare July 19, 2023 02:25
@SeanBryan51 SeanBryan51 marked this pull request as ready for review July 19, 2023 02:49
Copy link
Collaborator

@ccarouge ccarouge left a comment

Choose a reason for hiding this comment

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

One question to solve before this can be merged in.

Comment on lines 136 to 138
benchcab_path=self.benchcab_exe_path
if self.benchcab_exe_path
else "benchcab",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really the behaviour we want when calling render_job_script? If self.benchcab_exe_path evaluates to False, shouldn't we instead raise an error? Isn't it a sign of something that has gone wrong within benchcab?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes we should probably raise an error here since it means something has gone wrong with the path. This was a bit of a hack to get the unit tests to pass since self.benchcab_exe_path is always None unless we have installed benchcab. The right way is probably to specify self.benchcab_exe_path as an argument so we can mock it in the tests.

We should not use a default value when trying to infer the path to the
benchcab executable. If the path is undefined, we raise an exception as
this is likely a sign that the user's PATH variable is configured
incorrectly.

Co-authored-by: Claire Carouge <[email protected]>
@SeanBryan51 SeanBryan51 force-pushed the 95-specify-absolute-path-to-executable branch from 018c4d8 to 9238d08 Compare July 20, 2023 06:20
@SeanBryan51 SeanBryan51 merged commit 2a028d3 into master Jul 26, 2023
3 checks passed
@SeanBryan51 SeanBryan51 deleted the 95-specify-absolute-path-to-executable branch July 26, 2023 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify absolute path to benchcab executable in the job script
2 participants