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

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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

maksymar
Copy link

@maksymar maksymar commented May 4, 2023

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:

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

@maksymar maksymar self-assigned this May 4, 2023
@maksymar maksymar changed the title Draft: feat: add ic-cdk-http-kit feat: add ic-cdk-http-kit May 4, 2023
@maksymar maksymar changed the title feat: add ic-cdk-http-kit feat: add ic-cdk-http-kit, a toolkit for constructing and testing http outcalls on the IC May 4, 2023
@maksymar maksymar changed the title feat: add ic-cdk-http-kit, a toolkit for constructing and testing http outcalls on the IC feat: add ic-cdk-http-kit, a toolkit for testing http outcalls on the IC May 4, 2023
@maksymar
Copy link
Author

maksymar commented May 8, 2023

A friendly ping to review this PR.

src/ic-cdk-http-kit/Cargo.toml Outdated Show resolved Hide resolved
src/ic-cdk-http-kit/src/lib.rs Outdated Show resolved Hide resolved
src/ic-cdk-http-kit/src/lib.rs Outdated Show resolved Hide resolved
src/ic-cdk-http-kit/src/request.rs Outdated Show resolved Hide resolved
src/ic-cdk-http-kit/src/storage.rs Outdated Show resolved Hide resolved
@maksymar
Copy link
Author

A friendly ping to review updates.

@maksymar
Copy link
Author

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!

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.

None yet

2 participants