elixir-mongo / mongodb

MongoDB driver for Elixir
Apache License 2.0
568 stars 157 forks source link

Configuration for tests? CONTRIBUTING.md needed #336

Closed fireproofsocks closed 2 years ago

fireproofsocks commented 4 years ago

I'm trying to put together a pull request, but I noticed there is no CONTRIBUTING.md file that indicates any of the repo's preferences. I was expecting a config file to house details about how to connect to my local mongo instance, but instead I'm seeing values (e.g. port numbers) hard-coded in the test_helper.exs. I'd like to help out with this project -- is it possible to put together a CONTRIBUTING guide so that others may contribute more easily?

joeapearson commented 2 years ago

@fireproofsocks for now the best way to get up and running is with the start_mongo.bash and stop_mongo.bash scripts. You'll need to have a suitable version of MongoDB installed and available on $PATH.

I agree it's not clear how to get up and running. I'm planning some changes to our CI process in #365 that will have the side effect of making this clearer.

fireproofsocks commented 2 years ago

The start_mongo.bash and stop_mongo.bash scripts were actually what initially lead me to create this ticket. I found these scripts to be pretty unusual and from what I could see, totally undocumented. Per mention of getting CI and tests working, I would question the usefulness of these bash scripts. A think a more abstract approach would be more helpful (e.g. one that would easily facilitate use of interchangeable dockerized versions of mongo). Would that make a good ticket? Right now, I can't even run tests.

joeapearson commented 2 years ago

It would make a good improvement but replacing start_mongo.bash with a docker compose is non-trivial since we must consider replica sets and local sockets.

If you like you could add some docs for the existing scripts. I'm wary of making too many changes beyond the code we inherited before we get proper CI and validation in place so we can safely make changes, taking place in #370 .

fireproofsocks commented 2 years ago

Yeah, I know what you mean. Yet I feel completely stuck because I can't even run tests here without hacking my machine apart (there were many reasons I kicked mongo off my local machine and banished it to docker). To be clear I am not advocating for Docker Compose, just more of an agnostic approach so the code doesn't need to know or care where the mongo instance is running -- it just needs enough info to connect w sufficient privs. I think CI would actually be much easier if it were to specify standard docker images instead of this custom setup.

I created issue #373