Skip to content

Add basic test for hooks#1179

Merged
timvaillancourt merged 2 commits intogithub:masterfrom
timvaillancourt:logic-hooks-tests
Oct 21, 2022
Merged

Add basic test for hooks#1179
timvaillancourt merged 2 commits intogithub:masterfrom
timvaillancourt:logic-hooks-tests

Conversation

@timvaillancourt
Copy link
Collaborator

@timvaillancourt timvaillancourt commented Sep 14, 2022

Description

This PR adds a simple test for go/logic/hooks.go

In the process I found that the initHooks() func of HooksExecutor has a static return nil and no other logic, making it fairly useless. migrator.initiateHooksExecutor() was modified to remove the call to initHooks(), making it unnecessary as well. HooksExecutor is now instantiated in NewMigrator to simplify the code

Lastly, executeHooks() and executeHook() (from HooksExecutor) were updated to use an out io.Writer for output to facilitate testing

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

@timvaillancourt timvaillancourt requested review from a user and rashiq September 14, 2022 22:28
@timvaillancourt timvaillancourt force-pushed the logic-hooks-tests branch 2 times, most recently from 66464e2 to e53bbce Compare September 15, 2022 03:18
@timvaillancourt timvaillancourt merged commit df4cf7b into github:master Oct 21, 2022
@timvaillancourt timvaillancourt deleted the logic-hooks-tests branch October 21, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant