Skip to content

update testing of Execute to use non-default exitFunction - #41

Open
jspaleta wants to merge 1 commit into
mainfrom
fix/main-testing
Open

update testing of Execute to use non-default exitFunction#41
jspaleta wants to merge 1 commit into
mainfrom
fix/main-testing

Conversation

@jspaleta

Copy link
Copy Markdown
Contributor

Due to the way the plugin sdk operates, the handler's Execute function will call os.Exit by default as part of Execute()

This makes it impossible to test state after Execute() is called from main() in the test used in TestMain.

I've addressed this by changing the testing structure tp test Execute explicitly and setting a non-default exitFunction to capture the exit status integer instead of calling os.Exit

previous TestMain never actually reached the assert.True(requestReceived) statement because main() was calling os.Exit

Base automatically changed from master to main February 22, 2021 15:36
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.

2 participants