cdk-rs icon indicating copy to clipboard operation
cdk-rs copied to clipboard

feat: add ic-cdk-http-kit, a toolkit for testing http outcalls on the IC

Open maksymar opened this issue 2 years ago • 3 comments

Description

This change adds ic-cdk-http-kit, a simple toolkit for constructing and testing HTTP Outcalls on the Internet Computer.

It streamlines unit testing of HTTP Outcalls and provides user-friendly utilities. The crate simulates the http_request function from ic_cdk by retrieving mock responses, checking the maximum allowed size, and applying a transformation function if specified, optionally with a delay to simulate latency.

README.md is generated automatically from the crate documentation.

How Has This Been Tested?

ic-cdk-http-kit/run_all_tests.sh covers all the tests:

  • crate documentation and README.md sync test
  • crate-level cargo tests
  • example canister cargo tests
  • example canister end-to-end tests

Checklist:

  • [x] The title of this PR complies with Conventional Commits.
  • [ ] I have edited the CHANGELOG accordingly.
  • [ ] I have made corresponding changes to the documentation.

maksymar avatar May 04 '23 11:05 maksymar

A friendly ping to review this PR.

maksymar avatar May 08 '23 13:05 maksymar

A friendly ping to review updates.

maksymar avatar May 16 '23 11:05 maksymar

Hi all,

Just wanted to give a quick nudge on this PR. I've addressed all the previous comments, added some CI tests and it should be ready for another look. I understand it's not top of the list, but I believe it contributes into improving dev experience effort.

If there's anything else needed, please let me know.

Thank you so much for your time!

maksymar avatar May 22 '23 07:05 maksymar