Skip to content

Conversation

@vkarak
Copy link
Contributor

@vkarak vkarak commented Sep 10, 2023

This PR introduces a new argument always_last to the @run_before and @run_after decorators that will pin the current hook as the last of its stage. Only one such hook can exist for each stage in a test hierarchy. This feature should make writing test libraries easier, as they can pin their hooks at the end of a stage overriding therefore therefore the default hook execution order.

Closes #2749.

@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (0667c83) 87.30% compared to head (574387b) 87.31%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2992      +/-   ##
===========================================
+ Coverage    87.30%   87.31%   +0.01%     
===========================================
  Files           60       60              
  Lines        11696    11708      +12     
===========================================
+ Hits         10211    10223      +12     
  Misses        1485     1485              
Files Changed Coverage Δ
reframe/core/builtins.py 100.00% <100.00%> (ø)
reframe/core/hooks.py 90.21% <100.00%> (ø)
reframe/core/pipeline.py 94.02% <100.00%> (+0.09%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@victorusu victorusu left a comment

Choose a reason for hiding this comment

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

lgtm
I wonder if we can have dedicated documentation about it.
I don't think it should come in this PR, but a session explaining this feature would be nice.
What do you think?

@vkarak
Copy link
Contributor Author

vkarak commented Sep 11, 2023

I wonder if we can have dedicated documentation about it.
I don't think it should come in this PR, but a session explaining this feature would be nice.

Yes, it makes sense. I'll have a look in the tutorials if this could be showed in the examples we already have. Otherwise we will have to address this separately.

@vkarak vkarak merged commit 8652a01 into reframe-hpc:develop Sep 12, 2023
@vkarak vkarak deleted the feat/pin-hooks branch September 12, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow defining pipeline hooks that run after any same-stage subclass hooks

2 participants