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

Lack of tests #34

Open
jameshalsall opened this issue Jun 16, 2023 · 4 comments
Open

Lack of tests #34

jameshalsall opened this issue Jun 16, 2023 · 4 comments

Comments

@jameshalsall
Copy link
Contributor

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:

  • request encoding
  • request decoding
  • client (against a mock IPP server)

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
Copy link
Owner

phin1x commented Jun 17, 2023

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
Copy link
Contributor Author

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
Copy link
Owner

phin1x commented Jun 19, 2023

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
Copy link

g41797 commented Nov 11, 2023

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

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

3 participants