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

API 1.0 - PluginTestHarness is not good enough #1149

Open
Tracked by #1131
BrynCooke opened this issue May 24, 2022 · 6 comments
Open
Tracked by #1131

API 1.0 - PluginTestHarness is not good enough #1149

BrynCooke opened this issue May 24, 2022 · 6 comments

Comments

@BrynCooke
Copy link
Contributor

BrynCooke commented May 24, 2022

Recently we introduced a PluginTestHarness. It's very basic and needs to work.
Things that need to be fixed:

  1. Everything must be mocked. If you make a request then if it does not exactly match the expected then you get nothing back. This is super fragile, and doesn't allow the user to concentrate on the functionality they are adding.
  2. Mocks need higher level configuration. Currently everything is very low level as we effectively expose mockall. We can use buildstructor to help here and allow people to for instance: assert_headers_contains or assert_response_containes_errors.

This will need several rounds of iteration.

@BrynCooke BrynCooke mentioned this issue May 24, 2022
19 tasks
@BrynCooke BrynCooke changed the title API 1.0 - Test harness is not good enough API 1.0 - PluginTestHarness is not good enough May 24, 2022
@garypen
Copy link
Contributor

garypen commented Jun 9, 2022

We should start this soon and continue improving the test harness as we improve the APIs. We should consider using async_graphql to implement back end functionality. Should we include:

  • Getting rid of federation-demo?
  • How enable users verify without a lot of boilerplate (BuildStructor may be helpful)
  • mockall must still be part of the solution

@SimonSapin SimonSapin assigned SimonSapin and unassigned SimonSapin Aug 11, 2022
@SimonSapin
Copy link
Contributor

#1487 replaces PluginTestHarness with a new TestHarness API, but it’s still at roughly the same level of abstraction which is that of Rust plugins. There’s room for a lot more convenience APIs like assert_headers_contains.

@garypen
Copy link
Contributor

garypen commented Aug 18, 2022

This could be improved post 1.0, but it would be nice to have a good plugin testing story for 1.0. Leaving in for now and we'll see how the time goes. Consider this non-blocking for 1.0.

@SimonSapin SimonSapin removed their assignment Aug 23, 2022
@o0Ignition0o
Copy link
Contributor

I feel like we re good enough on that front, @garypen wdyt? can we close it?

@garypen
Copy link
Contributor

garypen commented Aug 24, 2022

@o0Ignition0o I don't think we should close it until we verify all the suggested improvements above are (or can be) addressed. I do think we can remove the 1.0 label, so I'll do that.

@garypen garypen removed the api/1.0 label Aug 24, 2022
@o0Ignition0o
Copy link
Contributor

o0Ignition0o commented Aug 24, 2022

sgtm, Seeing the board clear up is a good dopamine rush

@o0Ignition0o o0Ignition0o added this to the post-v1.0 milestone Sep 12, 2022
@abernix abernix removed this from the v1.x.x milestone Oct 17, 2022
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

No branches or pull requests

5 participants