phin1x / go-ipp

Pure Go IPP library
Apache License 2.0
138 stars 35 forks source link

Lack of tests #34

Open jameshalsall opened 1 year ago

jameshalsall commented 1 year ago

I really like this module, but I don't feel 100% confident when updating it because of the lack of tests.

Ideally we want tests for:

We could do this gradually over time, maybe starting with the request encoding/decoding as a priority.

If you've done any work on testing outside of this module, or have a collection of example payloads we can use as fixtures, I'm happy to make a start.

phin1x commented 1 year ago

tests for request encoding and decoding is on my to-do list for a long time. but I won't write tests for clients against a mock ipp server. the ipp server implementation differs from vendor to vendor.

jameshalsall commented 1 year ago

Any implementation of a mock server would prove the communication works between client and server though. I don't think we need to prove that this works with all IPP server implementations as that's not the goal.

phin1x commented 1 year ago

with this kind of tests you just prove that the http client library from the go std lib works. the only thing of the client which should be tested is the url generation. the other things are already covered by the ipp encoding and decoding tests.

g41797 commented 11 months ago

just brainstorming

run automatically docker compose with cups or ippsample so tests will work with real (almost) print server suitable for e2e test but using TestMain (i hope) it also may be feasible for regular unit tests

btw - i think e2e tests are more important for this kind of s/w