Skip to content

Implement Testing for Custom Logging #514

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

Open
danbugs opened this issue May 20, 2022 · 0 comments
Open

Implement Testing for Custom Logging #514

danbugs opened this issue May 20, 2022 · 0 comments

Comments

@danbugs
Copy link
Contributor

danbugs commented May 20, 2022

This was referenced here: #482, and should be done after the PR is merged.

Here's a compilation of relevant comments:

@itowlson

It would be super useful to have an integration test for this - I know it's fiddly because CLP can only be injected through hosting, but it would really help with confidence when changing things in the I/O subsystem.

@me

The way I've tested this feature locally was:

  • get an app w/ spin_loader::from_file,
  • create ExecutionContextConfiguration object w/ CustomLogPipes,
  • get a builder w/ spin_engine::Builder::with_engine,
  • HttpTrigger::configure_execution_context,
  • builder.build()
  • get component_triggers from app,
  • HttpTrigger::new w/ all that,
  • .run() the http_trigger, and then
  • curl it to see the result of the .wasm module's println!s.
    Are you suggesting recreating something like that in the integration tests? If not, how would you go about it?

@itowlson

Something like that would be great. Unfortunately the integration tests only have infrastructure for the normal Spin binary at the moment (via SpinTestController), so there's new infra to be built here. If you don't want to tackle that, raise an issue and I'll get onto it once this is merged. (And if you could share your existing manual test code in the issue, that would be a big timesaver!)

@me

Hmmm~ I just don't know how much time I can afford to allocate there. SOOO... If that's ok then, I think I'll pass that onto you and help w/ reviewing.

Here's where we are using the CustomLogPipies like I mentioned: https://github.com/Mossaka/containerd-wasm-shims/blob/main/containerd-shim-spin-v1/src/main.rs

@itowlson

Fair enough - thanks for the pointer!

@kate-goldenring kate-goldenring moved this to 🆕 Triage Needed in Spin Triage Aug 16, 2022
@dicej dicej moved this from 🆕 Triage Needed to 🔖 Backlog in Spin Triage Aug 31, 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

1 participant