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

make WithCallsAllowedWithinModule() the default and remove #2984

Closed
worstell opened this issue Oct 3, 2024 · 0 comments · Fixed by #3073
Closed

make WithCallsAllowedWithinModule() the default and remove #2984

worstell opened this issue Oct 3, 2024 · 0 comments · Fixed by #3073
Assignees

Comments

@worstell
Copy link
Contributor

worstell commented Oct 3, 2024

now that we have injected resources on verbs, users should always be using ftltest.Call to invoke verbs in tests rather than invoking the verb function directly. currently, users must also set WithCallsAllowedWithinModule() in the test context in order to use ftltest.Call on a verb that is not mocked (and get its inline behavior).

it seems like we should just execute inline behavior as the default for ftltest.Call on same-module verbs, and overridde with any mocks when present. only external verbs would require mocks

this came up when updating customer code to the new verb client injection patterns + corresponding unit tests. for every unit test, WithCallsAllowedWithinModule() had to be set on the context

@worstell worstell self-assigned this Oct 3, 2024
@ftl-robot ftl-robot mentioned this issue Oct 3, 2024
worstell added a commit that referenced this issue Oct 10, 2024
when using ftltest.Call, you don't need to mock the verb directly invoked. only downstream
verbs must be mocked (or overridden by setting WithCallsAllowedWithinModule globally)

fixes #2984
worstell added a commit that referenced this issue Oct 10, 2024
when using ftltest.Call, you don't need to mock the verb directly invoked. only downstream
verbs must be mocked (or overridden by setting WithCallsAllowedWithinModule globally)

fixes #2984
worstell added a commit that referenced this issue Oct 10, 2024
when using ftltest.Call, you don't need to mock the verb directly invoked. only downstream
verbs must be mocked (or overridden by setting WithCallsAllowedWithinModule globally)

fixes #2984
worstell added a commit that referenced this issue Oct 10, 2024
when using ftltest.Call, you don't need to mock the verb directly invoked. only downstream
verbs must be mocked (or overridden by setting WithCallsAllowedWithinModule globally)

fixes #2984
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 a pull request may close this issue.

1 participant