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

Document and test CouchDB module #46

Open
3 tasks
MatteoJoliveau opened this issue Nov 21, 2020 · 5 comments
Open
3 tasks

Document and test CouchDB module #46

MatteoJoliveau opened this issue Nov 21, 2020 · 5 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Milestone

Comments

@MatteoJoliveau
Copy link
Member

MatteoJoliveau commented Nov 21, 2020

Since we are approaching the first usable release we should start to pour more effort into documenting and cleaning up the codebase. One of the simplest modules to start is the CouchDB client.

TODO

  • add integration tests for methods that interact with CouchDB. We can use the mockito library to mock the CouchDB API and provide assertions
  • add documentation comments on every public type, function and method
  • cleanup any Clippy warnings. This can be tested by running cargo clippy in the couchdb directory
@MatteoJoliveau MatteoJoliveau added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 21, 2020
@MatteoJoliveau MatteoJoliveau added this to the 0.1.0 milestone Nov 21, 2020
@MarcoIeni
Copy link
Collaborator

I will work on this :)

@MarcoIeni MarcoIeni removed their assignment Dec 6, 2020
@MarcoIeni
Copy link
Collaborator

Hi Matteo, I am really sorry but I didn't have a lot of fun while working on this, so at the moment I prefer to work on some other projects. Again, sorry! 😅

I removed the assignment in case someone else wants to work on this issue.

As a side note I leave you with a thought of mine: instead of mocking the CouchDB API wouldn't it be better to launch a local couchdb instance (for example with docker) and test the client against it?
I see two main benefits by doing so:

  • enseada doesn't have to reproduce couchdb logic, so less code is required
  • tests will be more reliable, since mocks could contain errors

@MatteoJoliveau
Copy link
Member Author

No worries @MarcoIeni, totally understandable!

I personally prefere to have unit tests not depend on external network targets, but it's true that mocking is hard to do right. I'll consider your suggestion when I'll get around this task :)

@MatteoJoliveau
Copy link
Member Author

I'm sorry you didn't have fun, is there something specifically that can be improved in order to make the codebase more pleasant to work with?

@MarcoIeni
Copy link
Collaborator

I think that for me the problem was adding tests and documentation to an already existing code base.
Maybe if I had to develop (and document and test of course) a new functionality it would have been better.
Anyway I will keep an eye on this nice project for the future :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants