Added support for aspects around Step execution (fixes #163)#164
Added support for aspects around Step execution (fixes #163)#164OmerRaviv wants to merge 3 commits intoTestStack:masterfrom
Conversation
|
Thanks for the contribution. I was thinking maybe we should expose |
|
Sorry, not sure I follow you - what would that look like? |
|
The
The default implementation would be a copy of the current What do you think? |
|
That sounds like a great idea and a better design, but there is one problem that I'm stuck on and don't quite know how to solve: the Action that the Step contains is already wrapped with the synchronization stuff that the StepActionFactory built around it (StepActionFactory.Run's logic). If we let the user wrap this pre-wrapped Action, than in my use case (trying to ensure the step always gets executed on the UI thread and then wait for it to idle), it deadlocks. That's why I had to put the wrapping inside StepActionFactory.Run in my pull request. If I just move the Run method's logic into our new StepExecutor, and someone sub-classes it - same problem. Any ideas how I could work around this and still implement your design? |
This reverts commit 963a3af.
|
I implemented a StepExecutor as per your design, but had to extract the StepActionFactory.Run method into its own class to work around the deadlock issue I mentioned. Also added test (mostly to demonstrate the usage). |
|
Think something has gone wrong here, this PR changes nothing, due to the last reverted commit I think? |
|
@OmerRaviv I see where your issue with the deadlock is.. mixing async/sync causes problems like this :( Could you give me a bit more context around how you wait for the UI thread? Sounds interesting |
|
@JakeGinnivan My bad, a bit of a GitHub newb here. Created a pull request #169 which contains the right changes. In general, when you do File->New Project -> VS Package, VS automatically creates an Integration Tests project that uses a |
Naive support for allowing the user to interject custom code before/after each step using an AOP approach. Added a "StepExecutor" class which user can derive from to customize step execution..