You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2016/03/16 17:58:49 UTC

[GitHub] couchdb pull request: Support sharing test helpers

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb/pull/394

    Support sharing test helpers

    It is tedious to share test_helpers between different applications.
    We used to place test helpers modules in the `src` directory of the
    application but this pollutes the `src` and gets deployed into
    production.
    In order to solve this problem we add support for following directories
    in every application:
    
     - test/helpers - a place where you put *.erl files with helper modules
     - test/include - a place for *.hrl files you want to share

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb share_test_helpers

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb/pull/394.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #394
    
----
commit 913d83dc1897ae7f158b05fbc5bc53b7490aad6b
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-03-16T16:50:01Z

    Support sharing test helpers
    
    It is tedious to share test_helpers between different applications.
    We used to place test helpers modules in the `src` directory of the
    application but this pollutes the `src` and gets deployed into
    production.
    In order to solve this problem we add support for following directories
    in every application:
    
     - test/helpers - a place where you put *.erl files with helper modules
     - test/include - a place for *.hrl files you want to share

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Support sharing test helpers

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb/pull/394#issuecomment-197440993
  
    I would like to suggest a bit different way, again a bit complicated, but with more potential in future. We eventually have a https://github.com/apache/couchdb-erlang-tests repository which is eventually empty. I planned to use it exactly for the purpose you propose here: all the common helpers, patterns,  abstract common things that helps to keep our tests more specific on what they doing and not pollute you editor space with implementation specifics, especially when they get repeated all the time (recall how we test chttpd resources...).
    
    Suddenly, my work on that idea stopped right there because lack of time and great ideas decomposition done right. But I would be happy if you take this flag while it left all alone.
    
    I still think that this would be better way to go, because we actually shouldn't keep too much logic in here with our current design whatever we think about it. Also, if one day we'll try to make each app to be tested in standalone mode, we wouldn't have to take this big repo into the dependencies, but use another one, more specific and his goals.
    
    Sound good for you? (:


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Support sharing test helpers

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb/pull/394#issuecomment-197455788
  
    @kxepal: I had a proposal about the same topic [a while back](http://mail-archives.apache.org/mod_mbox/couchdb-dev/201510.mbox/%3C201510012032.t91KWXHG030871@d03av01.boulder.ibm.com%3E).
    I am busy with other things though and wouldn't be able to work on that actively this quarter. But most likely next quarter I could dedicate significant time for testing infrastructure. I'm planing to go with my proposal since were no objections from ASF. Let me know if you have something else in mind so we can coordinate our efforts. 
    As you might know already master is broken at the moment. It fails if tests are executed in specific order.
    ```
    make eunit apps=chttpd tests=callback_test,error_info_test
    ``` 
    In order to fix that I need to add following into teardown:
    ```
        Handle = couch_epi:get_handle(chttpd),
        couch_epi_module_keeper:reload(Handle),
    ``` 
    However I think that it is exposing way too much and should be known only to couch_epi.
    So I need a way to share a test_helper.
    
    Could you create the repo you are talking about so we can start populating it?
    Or propose another way of sharing the helper.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Support sharing test helpers

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb/pull/394#issuecomment-197459294
  
    @eiri: Unfortunately elixir is out. Since most of the contributors against it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Support sharing test helpers

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb/pull/394#issuecomment-197458989
  
    @iilyak Yea, your proposal is great. I mostly wrote there all the thoughts I have and the best idea I had is to try elixir. But that's a dream, I know (: Better make it first work right on plain good Erlang.
    
    Ok, I'll bootstrap that repo in a moment. Stay tuned!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Support sharing test helpers

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb/pull/394#issuecomment-197991952
  
    Closed in favor of https://github.com/apache/couchdb-erlang-tests/pull/1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Support sharing test helpers

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak closed the pull request at:

    https://github.com/apache/couchdb/pull/394


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---