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

Translate Mango Python integration tests to Elixir #4501

Open
pgj opened this issue Mar 28, 2023 · 7 comments
Open

Translate Mango Python integration tests to Elixir #4501

pgj opened this issue Mar 28, 2023 · 7 comments

Comments

@pgj
Copy link
Contributor

pgj commented Mar 28, 2023

Currently, Mango has its own integration tests that are implemented in Python and have to be activated separately via the mango-tests make(1) target. Re-write them in Elixir to integrate them better with the rest of the integration tests that are in use for CouchDB. This move could bring more simplification and regularization to the code base, removing the dependency on Nose2.

@nickva
Copy link
Contributor

nickva commented Mar 28, 2023

Good idea. It could be done step-wise, one file or feature at a time. Move from one test suite to the other over time. We did it similarly with Javascript -> Elixir move a few years back.

If bringing in Nose2 is a hassle, another way could be to try to see if Python 3's built-in https://docs.python.org/3/library/unittest.html#module-unittest has the feature nose2 uses. The tests were written during the Python2 days and Python had some improvements since.

@pgj
Copy link
Contributor Author

pgj commented Mar 28, 2023

Personally, I do not have any problems with Nose2. But if the integration tests were migrated to Elixir, there is no need for it any more. On its web site, it considers itself obsolete -- but instead of moving to another Python-based framework, consider Elixir directly.

@nickva
Copy link
Contributor

nickva commented Mar 28, 2023

That's fair re: not having another language in the mix. Not all contributors might be versed in Python. So then we have Erlang, Python and Elixir.

Going that route and seeing that we're running a single node test server anyway, we could just move them to Erlang as well. The verbosity is about the same view_include_docs_test.exs vs chttpd_revs_diff_tests.erl and it gives a chance to collect code coverage and if needed use mock intercepts for some grey-box testing or induce failures.

@big-r81
Copy link
Contributor

big-r81 commented Mar 30, 2023

Personally, I wouldn't write (or migrate) any test to Elixir, because I see no benefits in learning and using a second/third programming language to add contributions to CouchDB. As a new developer to CouchDB (and Erlang), I found using a second language more of an obstacle than an asset.

@pgj
Copy link
Contributor Author

pgj commented Mar 31, 2023

I am not sure if I got you right @big-r81. Elixir has already been used in CouchDB and there are a lot of integration tests written in that language. And, on the top of that, there is Python for Mango.

Or are you saying that we should just leave Python there, because the chances are likely that new contributors are already familiar with it?

@big-r81
Copy link
Contributor

big-r81 commented Mar 31, 2023

@pgj yes, there are a lot of Elixir tests (from the migration from Javascript, if I get this right). This is only a personal preference of me, not to use Elixir for tests. I think the move to using Elixir was made back then to attract more developers. I don't think this happened...
But feel free to use Elixir. 🙂

@jjrodrig
Copy link
Contributor

From my experience as an Elixir test suite contributor, I found that Elixir allows new contributions much easier than Erlang does.

In this case, Python is the exception in the test suite, so I think it is a good idea to simplify this part and migrate these tests to the integration test suite based on Elixir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants