marigold-dev / marigold-dev/deku

[Test] Add some test over `yojson` instances

Open
#454 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
OCaml
Stars
82
Forks
17
PR merge metrics
No merged PRs in 30d

Description

What about basic testing?
For instance, even if we can suppose that yojson is working, having tests like:

when calling to_yojson on this object, it produces the following JSON

or also

when calling to_yojson then from_yojson, it gives back the original object

If we always say "we can do that later" we will never do it... Moreover, some tests are just quick-win and ensure our domain is safe in the real world.

For instance, I think the function http_request isn't so difficult to test, am I wrong?
Or maybe we can start by only testing http_post function, which is exposed and used, and test the others later.
What do you think?

Originally posted by @gsebil08 in https://github.com/marigold-dev/deku/pull/444#discussion_r813671456

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the yojson conversions and the exposed http_post function, then inspect how http_request is used. Done means tests cover expected to_yojson output and verify that to_yojson followed by from_yojson returns the original object.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
api, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.