You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by elbrujohalcon <gi...@git.apache.org> on 2015/06/18 21:07:42 UTC

[GitHub] couchdb-config pull request: Gaining independence

GitHub user elbrujohalcon opened a pull request:

    https://github.com/apache/couchdb-config/pull/4

    Gaining independence

    This PR includes a couple of tiny fixes that basically ensure that you can run and *test* the app by just cloning the repo and executing things like `make app`, `make shell` and/or `make test`

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

    $ git pull https://github.com/inaka/couchdb-config elbrujohalcon.fixes

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

    https://github.com/apache/couchdb-config/pull/4.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 #4
    
----
commit 113323380ffd8232c9c5bb6e0f53eaa2d86c5941
Author: Brujo Benavides <el...@gmail.com>
Date:   2015-06-18T19:00:48Z

    Added include file from couchdb-couch to get the project to compile

commit 30990ed5cd69a655a2cf8a892db0ec47d61c4e6c
Author: Brujo Benavides <el...@gmail.com>
Date:   2015-06-18T19:02:48Z

    Fixed module dependencies with couchdb-couch and also many DEPS were not actual deps :)

commit e037fea641bd75a6d3cc56bc9325f3a5dea2183d
Author: Brujo Benavides <el...@gmail.com>
Date:   2015-06-18T19:05:07Z

    added Makefile to make our lives easier :P and also fixed the tests by:
    - fixing the CONFIG_FIXTURESDIR path
    - ensuring that required dirs are created before creating a file in them
    - adding a default_eunit.ini file
    - making sure some required files are there before starting the tests

----


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113274937
  
    `make check` … I like it :) `make test` was always an itchy thing (because of the `test` folder) and erlang.mk's `make tests` was… well… not my favourite way to solve it. I like your approach :+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-config pull request: Gaining independence

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32814646
  
    --- Diff: .gitignore ---
    @@ -0,0 +1,18 @@
    +relx
    --- End diff --
    
    we don't use relx or erlang.mk or Mnesia, where is this list coming from?


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113273212
  
    @elbrujohalcon Thanks! But something went wrong:
    
    ```
    $ make test
    rebar skip_deps=true compile
    ==> couchdb-config (compile)
    mkdir -p tmp/etc;
    cp test/fixtures/default_eunit.ini tmp/etc/default_eunit.ini;
    touch tmp/etc/local_eunit.ini;
    touch tmp/etc/eunit.ini;
    rebar eunit
    ==> couchdb-config (eunit)
    ERROR: eunit failed while processing /home/kxepal/projects/asf/couchdb/couchdb-config: {'EXIT',{{badmatch,{ok,[99,112,58,32,119,97,114,110,105,110,103,58,32,115,111,
                            117,114,99,101,32,102,105,108,101,32,226,128,152,116,
                            101,115,116,47,99,111,110,102,105,103,95,116,101,115,
                            116,115,46,101,114,108,226,128,153,32,115,112,101,99,
                            105,102,105,101,100,32,109,111,114,101,32,116,104,97,
                            110,32,111,110,99,101,10]}},
             [{rebar_file_utils,cp_r,2,
                                [{file,"src/rebar_file_utils.erl"},{line,68}]},
              {rebar_erlc_compiler,test_compile,3,
                                   [{file,"src/rebar_erlc_compiler.erl"},
                                    {line,179}]},
              {rebar_eunit,eunit,2,[{file,"src/rebar_eunit.erl"},{line,88}]},
              {rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,490}]},
              {rebar_core,execute,6,[{file,"src/rebar_core.erl"},{line,415}]},
              {rebar_core,maybe_execute,8,
                          [{file,"src/rebar_core.erl"},{line,299}]},
              {rebar_core,process_dir1,7,[{file,"src/rebar_core.erl"},{line,258}]},
              {rebar_core,process_commands,2,
                          [{file,"src/rebar_core.erl"},{line,90}]}]}}
    Makefile:28: recipe for target 'test' failed
    make: *** [test] Error 1
    
    ```
    
    Any ideas?


---
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-config issue #4: Gaining independence

Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on the issue:

    https://github.com/apache/couchdb-config/pull/4
  
    Neat, just saw this and agree it would be nice. Definitely agree that we'll want to hold off until after 2.0.
    
    As for the logging things, I didn't see the error_logger version but that's fine for us in CouchDB land as couch_log installs an error_logger event handler and forwards to the same place. We just need to make sure that whatever error report we use can be formatted by couch_log which is more than fine.
    
    I'm pretty sure if its got a rebar.config and looks like an erlang app that make won't be run when we build downstream so that seems fine as well.


---
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-config pull request: Gaining independence

Posted by elbrujohalcon <gi...@git.apache.org>.
Github user elbrujohalcon commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32767875
  
    --- Diff: src/config.erl ---
    @@ -208,7 +208,7 @@ handle_call(all, _From, Config) ->
         {reply, Resp, Config};
     handle_call({set, Sec, Key, Val, Persist, Reason}, _From, Config) ->
         true = ets:insert(?MODULE, {{Sec, Key}, Val}),
    -    couch_log:notice("~p: [~s] ~s set to ~s for reason ~p",
    +    error_logger:info_msg("~p: [~s] ~s set to ~s for reason ~p",
    --- End diff --
    
    @kxepal I can use either `lager` or `couch_log` if `couch_log` is shipped as an independent app that I can include in the deps using rebar, but as the app was before I started, I had no access to any `couch_log` module, so it failed.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113274091
  
    It's basically saying
    ```erlang
    cp: warning: source file ‘test/config_tests.erl’ specified more than once
    ```
    
    I'm not sure why, but I pushed one commit more with a change that may or may not help. It's a very long shot, but just in case… Can you try again?


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#discussion_r32767692
  
    --- Diff: Makefile ---
    @@ -0,0 +1,27 @@
    +export BUILDDIR ?= /Users/elbrujohalcon/Projects/inaka/couchdb-config
    --- End diff --
    
    Default path also should be changed for something that will works for everyone


---
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-config issue #4: Gaining independence

Posted by elbrujohalcon <gi...@git.apache.org>.
Github user elbrujohalcon commented on the issue:

    https://github.com/apache/couchdb-config/pull/4
  
    This PR is a bit old, I think I'll just close it :trollface: 


---

[GitHub] couchdb-config pull request #4: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4


---

[GitHub] couchdb-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#discussion_r32768401
  
    --- Diff: src/config.erl ---
    @@ -208,7 +208,7 @@ handle_call(all, _From, Config) ->
         {reply, Resp, Config};
     handle_call({set, Sec, Key, Val, Persist, Reason}, _From, Config) ->
         true = ets:insert(?MODULE, {{Sec, Key}, Val}),
    -    couch_log:notice("~p: [~s] ~s set to ~s for reason ~p",
    +    error_logger:info_msg("~p: [~s] ~s set to ~s for reason ~p",
    --- End diff --
    
    @elbrujohalcon it actually [ships](https://github.com/apache/couchdb-couch-log/) in this way.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113265463
  
    @kxepal my goal was to be able to run the app without CouchDB.
    Initially, I only need it as a sample app, but it may eventually be useful for other non-couchdb users.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#discussion_r32767407
  
    --- Diff: test/fixtures/default_eunit.ini ---
    @@ -0,0 +1,29 @@
    +; Licensed to the Apache Software Foundation (ASF) under one
    +; or more contributor license agreements.  See the NOTICE file
    +; distributed with this work for additional information
    +; regarding copyright ownership.  The ASF licenses this file
    +; to you under the Apache License, Version 2.0 (the
    +; "License"); you may not use this file except in compliance
    +; with the License.  You may obtain a copy of the License at
    +; 
    +;   http://www.apache.org/licenses/LICENSE-2.0
    +;
    +; Unless required by applicable law or agreed to in writing,
    +; software distributed under the License is distributed on an
    +; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +; KIND, either express or implied.  See the License for the
    +; specific language governing permissions and limitations
    +; under the License.
    +
    +[couchdb]
    +max_dbs_open=500
    +
    +[httpd]
    +port=5986
    --- End diff --
    
    We shouldn't relay on specific port in tests as it could be occupied by some other service. `0` means that random free port will be used.


---
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-config pull request: Gaining independence

Posted by elbrujohalcon <gi...@git.apache.org>.
Github user elbrujohalcon commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32768718
  
    --- Diff: src/config.erl ---
    @@ -208,7 +208,7 @@ handle_call(all, _From, Config) ->
         {reply, Resp, Config};
     handle_call({set, Sec, Key, Val, Persist, Reason}, _From, Config) ->
         true = ets:insert(?MODULE, {{Sec, Key}, Val}),
    -    couch_log:notice("~p: [~s] ~s set to ~s for reason ~p",
    +    error_logger:info_msg("~p: [~s] ~s set to ~s for reason ~p",
    --- End diff --
    
    :+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-config pull request: Gaining independence

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32816471
  
    --- Diff: test/config_tests.erl ---
    @@ -31,16 +48,13 @@
     -define(CONFIG_FIXTURE_TEMP,
         begin
             FileName = filename:join([?TEMPDIR, "config_temp.ini"]),
    +        ok = filelib:ensure_dir(FileName),
             {ok, Fd} = file:open(FileName, write),
             ok = file:truncate(Fd),
             ok = file:close(Fd),
             FileName
         end).
     
    --define(DEPS, [couch_stats, couch_log, folsom, lager,
    -               goldrush, syntax_tools, compiler, config]).
    -
    -
    --- End diff --
    
    Does changing this break the test suite when we run couchdb tests as a whole?


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113264483
  
    The problem of this PR that it cannot solve dependency issues. If your main goal of these changes was to be able to run the test suite without external dependencies, then the test suite should be changed in order to run unit tests, not integrational as it does now.
    
    In this case there would be no need in couch_eunit copy-paste, all external deps will be mocked and couchdb-config would be tested isolated from other CouchDB parts.


---
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-config pull request: Gaining independence

Posted by chewbranca <gi...@git.apache.org>.
Github user chewbranca commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32776544
  
    --- Diff: rebar.config ---
    @@ -0,0 +1,23 @@
    +{deps, [
    +    {couch_log, ".*",
    +        {git, "https://git-wip-us.apache.org/repos/asf/couchdb-couch-log.git",
    +        {branch, "master"}}}
    +]}.
    +{erl_opts, [{inlcude, ["inlcude"]},
    --- End diff --
    
    Typo, should be `include`.


---
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-config pull request: Gaining independence

Posted by elbrujohalcon <gi...@git.apache.org>.
Github user elbrujohalcon commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32823819
  
    --- Diff: .gitignore ---
    @@ -0,0 +1,18 @@
    +relx
    --- End diff --
    
    It's the generic .gitignore we use at @inaka for all erlang projects, I can trim it down.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113274457
  
    LGFM. @rnewson @janl what would you say?


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113461280
  
    @rnewson you're right, there are problems with running test suite from couchdb repo with this (and lager) PR applied:
    
    ```
    ==> couchdb (setup_eunit)
    ERROR: One or more files already exist on disk and were not generated:
    	* "tmp/etc/default_eunit.ini"
    	* "tmp/etc/local_eunit.ini"
    	* "tmp/etc/eunit.ini"
    	* "tmp/etc/vm.args"
    To force overwriting, specify -f/--force/force=1 on the command line.
    ==> b64url (eunit)
    ======================== EUnit ========================
    module 'b64url'
      module 'b64url_tests'
        b64url_tests: table_test...ok
        b64url_tests: encode_binary_test...[1.030 s] ok
        b64url_tests: encode_iolist_test...[1.017 s] ok
        b64url_tests: decode_binary_test...[1.074 s] ok
        b64url_tests: decode_iolist_test...[1.240 s] ok
        b64url_tests: decode_binary_error_test...[1.052 s] ok
        b64url_tests: decode_bad_length_test...[0.780 s] ok
        [done in 6.211 s]
      [done in 6.211 s]
    =======================================================
      All 7 tests passed.
    ==> cassim (eunit)
    ======================== EUnit ========================
    module 'cassim_security'
    module 'cassim'
    module 'cassim_metadata_cache'
    module 'cassim_app'
    cassim_metadata_cache_test: security_meta_id_test (module 'cassim_metadata_cache_test')...[0.085 s] ok
    module 'cassim_sup'
    =======================================================
      Test passed.
    ==> couch_log (eunit)
    ======================== EUnit ========================
    module 'couch_log'
      There were no tests to run.
    ==> config (eunit)
    ======================== EUnit ========================
    module 'config_app'
    module 'config_util'
    module 'config_listener'
    module 'config'
      module 'config_tests'
        CouchDB config tests
          Config get tests
            config_tests:236: should_load_all_configs...13:14:33.656 [info] Application lager started on node nonode@nohost
    13:14:33.656 [info] Application couch_log started on node nonode@nohost
    13:14:33.657 [info] Application config started on node nonode@nohost
    ok
    13:14:33.661 [info] Application config exited with reason: stopped
    13:14:33.669 [info] Application config started on node nonode@nohost
            config_tests:239: should_locate_daemons_section...ok
    13:14:33.672 [info] Application config exited with reason: stopped
    13:14:33.679 [info] Application config started on node nonode@nohost
            config_tests:242: should_locate_mrview_handler...ok
    13:14:33.682 [info] Application config exited with reason: stopped
    13:14:33.689 [info] Application config started on node nonode@nohost
            config_tests:246: should_return_undefined_atom_on_missed_section...ok
    13:14:33.692 [info] Application config exited with reason: stopped
    13:14:33.699 [info] Application config started on node nonode@nohost
            config_tests:250: should_return_undefined_atom_on_missed_option...ok
    13:14:33.702 [info] Application config exited with reason: stopped
            13:14:33.709 [info] Application config started on node nonode@nohost
    config_tests:254: should_return_custom_default_value_on_missed_option...ok
    13:14:33.712 [info] Application config exited with reason: stopped
    13:14:33.720 [info] Application config started on node nonode@nohost
            config_tests:258: should_only_return_default_on_missed_option...ok
    13:14:33.723 [info] Application config exited with reason: stopped
    13:14:33.730 [info] Application config started on node nonode@nohost
            config_tests:262: should_fail_to_get_binary_value...ok
    13:14:33.733 [info] Application config exited with reason: stopped
    13:14:33.740 [info] Application config started on node nonode@nohost
            config_tests:269: should_return_any_supported_default (for type(undefined))...ok
            config_tests:269: should_return_any_supported_default (for type("list"))...ok
            config_tests:269: should_return_any_supported_default (for type(true))...ok
            config_tests:269: should_return_any_supported_default (for type(false))...ok
            config_tests:269: should_return_any_supported_default (for type(0.1))...ok
            config_tests:269: should_return_any_supported_default (for type(1))...ok
            13:14:33.758 [info] Application config exited with reason: stopped
    [done in 0.321 s]
          Config set tests
    13:14:33.766 [info] Application config started on node nonode@nohost
            config_tests:273: should_update_option...13:14:33.790 [notice] config: [log] level set to severe for reason nil
    [0.024 s] ok
    13:14:33.793 [info] Application config exited with reason: stopped
    13:14:33.800 [info] Application config started on node nonode@nohost
    13:14:33.801 [notice] config: [new_section] bizzle set to bang for reason nil
            config_tests:280: should_create_new_section...ok
    13:14:33.804 [info] Application config exited with reason: stopped
            config_tests:288: should_fail_to_set_binary_value...ok
            [done in 0.057 s]
          Config deletion tests
    13:14:33.823 [notice] config: [log] level deleted for reason nil
            config_tests:292: should_return_undefined_atom_after_option_deletion...ok
            13:14:33.833 [notice] config: [zoo] boo deleted for reason nil
    config_tests:299: should_be_ok_on_deleting_unknown_options...ok
            [done in 0.021 s]
          Configs overide tests
            config_tests:302: should_ensure_in_defaults...*failed*
    in function config_tests:'-should_ensure_in_defaults/2-fun-1-'/1 (test/config_tests.erl, line 306)
    in call from config_tests:'-should_ensure_in_defaults/2-fun-3-'/0 (test/config_tests.erl, line 305)
    **error:{assertEqual_failed,[{module,config_tests},
                         {line,306},
                         {expression,"config : get ( \"httpd\" , \"port\" )"},
                         {expected,"0"},
                         {value,"5986"}]}
    
    
            undefined
            *** context setup failed ***
    **in function config_tests:setup/1 (test/config_tests.erl, line 66)
    **error:{badmatch,
        {error,
            {config,
                {{shutdown,
                     {failed_to_start_child,config,
                         {bad_return_value,
                             {startup_error,<<"Couldn't fin"...>>}}}},
                 {config_app,start,[normal,[]]}}}}}
    
    
          undefined
          *** context setup failed ***
    **in function config_tests:setup/1 (test/config_tests.erl, line 66)
    **error:{badmatch,
        {error,
            {config,
                {{shutdown,
                     {failed_to_start_child,config,
                         {bad_return_value,
                             {startup_error,<<"Couldn't fin"...>>}}}},
                 {config_app,start,[normal,[]]}}}}}
    
    
        undefined
        *** context setup failed ***
    **in function config_tests:setup/1 (test/config_tests.erl, line 66)
    **error:{badmatch,
        {error,
            {config,
                {{shutdown,
                     {failed_to_start_child,config,
                         {bad_return_value,
                             {startup_error,<<"Couldn't fin"...>>}}}},
                 {config_app,start,[normal,[]]}}}}}
    
    
      [done in 0.095 s]
    Config persistent changes
      config_tests:331: should_write_changes...*failed*
    in function config_tests:'-should_write_changes/2-fun-0-'/1 (test/config_tests.erl, line 333)
    in call from config_tests:'-should_write_changes/2-fun-5-'/0 (test/config_tests.erl, line 332)
    **error:{assertEqual_failed,[{module,config_tests},
                         {line,333},
                         {expression,"config : get ( \"httpd\" , \"port\" )"},
                         {expected,"0"},
                         {value,"5986"}]}
    
    
    13:14:33.852 [error] Couldn't find server configuration file /home/kxepal/projects/asf/couchdb/couchdb/test/fixtures/config_tests_1.ini.
      config_tests:345: should_ensure_that_default_wasnt_modified...*failed*
    in function config_tests:'-should_ensure_that_default_wasnt_modified/2-fun-0-'/1 (test/config_tests.erl, line 347)
    in call from config_tests:'-should_ensure_that_default_wasnt_modified/2-fun-2-'/0 (test/config_tests.erl, line 346)
    **error:{assertEqual_failed,[{module,config_tests},
                         {line,347},
                         {expression,"config : get ( \"httpd\" , \"port\" )"},
                         {expected,"0"},
                         {value,"5986"}]}
    
    
      config_tests:353: should_ensure_that_written_to_last_config_in_chain...*failed*
    in function config_tests:'-should_ensure_that_written_to_last_config_in_chain/2-fun-0-'/1 (test/config_tests.erl, line 355)
    in call from config_tests:'-should_ensure_that_written_to_last_config_in_chain/2-fun-2-'/0 (test/config_tests.erl, line 354)
    **error:{assertEqual_failed,[{module,config_tests},
                         {line,355},
                         {expression,"config : get ( \"httpd\" , \"port\" )"},
                         {expected,"8080"},
                         {value,undefined}]}
    
    
      [done in 0.034 s]
    Test config with no files
      config_tests:361: should_ensure_that_no_ini_files_loaded...ok
      config_tests:364: should_create_non_persistent_option...ok
      config_tests:371: should_create_persistent_option...ok
      [done in 0.013 s]
    Test config_listener behaviour
      config_tests:378: should_handle_value_change...[0.001 s] ok
    13:14:33.858 [error] Couldn't find server configuration file /home/kxepal/projects/asf/couchdb/couchdb/test/fixtures/config_tests_2.ini.
    13:14:33.931 [error] Couldn't find server configuration file /home/kxepal/projects/asf/couchdb/couchdb/test/fixtures/config_tests_1.ini.
    13:14:33.971 [notice] config: [httpd] port set to 80 for reason nil
    13:14:33.975 [notice] config: [httpd] bind_address set to 127.0.0.1 for reason nil
    13:14:33.988 [notice] config: [httpd] port set to 80 for reason nil
    13:14:34.992 [notice] config_listener(config_tests) stopped with reason: shutdown
    13:14:34.993 [warning] lager_error_logger_h dropped 3 messages in the last second that exceeded the limit of 50 messages/sec
    13:14:34.993 [info] Application config exited with reason: stopped
    13:14:35.004 [info] Application config started on node nonode@nohost
      config_tests:383: should_pass_correct_state_to_handle_config_change...13:14:35.004 [notice] config: [httpd] port set to 80 for reason nil
    13:14:35.005 [notice] config: [update_state] foo set to any for reason nil
    ok
    13:14:36.009 [notice] config_listener(config_tests) stopped with reason: shutdown
    13:14:36.010 [info] Application config exited with reason: stopped
    13:14:36.028 [info] Application config started on node nonode@nohost
      13:14:36.029 [notice] config: [httpd] port set to 80 for reason nil
    config_tests:390: should_pass_correct_state_to_handle_config_terminate...13:14:36.029 [notice] config: [update_state] foo set to any for reason nil
    13:14:36.029 [notice] config: [remove_handler] any set to any for reason nil
    13:14:36.029 [info] config_listener(config_tests) stopped with reason: shutdown
    [0.001 s] ok
    13:14:36.034 [info] Application config exited with reason: stopped
    13:14:36.049 [info] Application config started on node nonode@nohost
      config_tests:407: should_pass_subscriber_pid_to_handle_config_terminate...13:14:36.049 [notice] config: [remove_handler] any set to any for reason nil
    13:14:36.049 [info] config_listener(config_tests) stopped with reason: shutdown
    [0.001 s] ok
      config_tests:416: should_not_call_handle_config_after_related_process_death...ok
      config_tests:425: should_remove_handler_when_requested...ok
      [done in 2.176 s]
    [done in 2.718 s]
    [done in 2.718 s]
    [done in 2.719 s]
    13:14:36.052 [error] Supervisor config_sup had child config started with config:start_link(["/home/kxepal/projects/asf/couchdb/couchdb/tmp/etc/default_eunit.ini","/home/kxepal/projects/as...",...]) at <0.411.0> exit with reason shutdown in context shutdown_error
    13:14:36.053 [info] Application config exited with reason: stopped
    13:14:36.135 [info] Application config started on node nonode@nohost
    13:14:36.135 [notice] config: [remove_handler] any set to any for reason nil
    13:14:36.135 [info] config_listener(config_tests) stopped with reason: shutdown
    13:14:36.135 [notice] config: [httpd] port set to 80 for reason nil
    13:14:36.139 [info] Application config exited with reason: stopped
    13:14:36.150 [info] Application config started on node nonode@nohost
    13:14:36.150 [notice] config: [remove_handler] any set to any for reason nil
    13:14:36.150 [info] config_listener(config_tests) stopped with reason: shutdown
    13:14:36.153 [error] Supervisor config_sup had child config started with config:start_link(["/home/kxepal/projects/asf/couchdb/couchdb/tmp/etc/default_eunit.ini","/home/kxepal/projects/as...",...]) at <0.431.0> exit with reason shutdown in context shutdown_error
    13:14:36.154 [info] Application config exited with reason: stopped
    module 'config_writer'
    module 'config_sup'
    =======================================================
      Failed: 4.  Skipped: 0.  Passed: 28.
    One or more tests were cancelled.
    
    =INFO REPORT==== 19-Jun-2015::13:14:36 ===
        application: lager
        exited: stopped
        type: temporary
    ERROR: One or more eunit tests failed.
    
    =INFO REPORT==== 19-Jun-2015::13:14:36 ===
        application: goldrush
        exited: killed
        type: temporary
    ERROR: eunit failed while processing /home/kxepal/projects/asf/couchdb/couchdb/src/config: rebar_abort
    Makefile:69: recipe for target 'eunit' failed
    make: *** [eunit] Error 1
    ```
    
    While tests are passed when runs only from couchdb-config repository.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113291057
  
    :warning: Don't merge this PR without merging  apache/couchdb-lager#1 first :warning:
    I previously added `couch_log` as a dependency but I wasn't actually using it (i.e. I wasn't starting the application), otherwise I would've noticed the missing `goldrush` dependency first.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113459724
  
    The whole point of having separate repos was to ensure they'd be able to evolve independently, so I'm definitely for the idea. I think the addition of a Makefile and changes to rebar.config are a problem, though, for the two different situations where we build this. I'd also like to discover why we used error_logger here rather than couch_log. It doesn't appear to be to break a cyclical dependency, so I'm inferring it was done that way so that couchdb-config does not have a dependency on couch_log at all. We shouldn't revert that choice lightly.
    
    I hate to say it, but I'd like to hold off merging this until the 2.0 release. We can then think about how the build and test system can work in a more modular fashion.
    
    Unless someone here is going to verify that this change works both ways satisfactorily?


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113789863
  
    I have no objections to that, @janl :)


---
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-config pull request: Gaining independence

Posted by elbrujohalcon <gi...@git.apache.org>.
Github user elbrujohalcon commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32776556
  
    --- Diff: src/config.erl ---
    @@ -273,13 +273,13 @@ handle_info({gen_event_EXIT, {config_listener, Module}, shutdown}, State)  ->
         couch_log:notice("config_listener(~p) stopped with reason: shutdown~n", [Module]),
         {noreply, State};
     handle_info({gen_event_EXIT, {config_listener, Module}, normal}, State)  ->
    -    couch_log:info("config_listener(~p) stopped with reason: shutdown~n", [Module]),
    +    couch_log:notice("config_listener(~p) stopped with reason: shutdown~n", [Module]),
         {noreply, State};
     handle_info({gen_event_EXIT, {config_listener, Module}, Reason}, State) ->
    -    couch_log:error("config_listener(~p) stopped with reason: ~p~n", [Module, Reason]),
    +    couch_log:notice("config_listener(~p) stopped with reason: ~p~n", [Module, Reason]),
         {noreply, State};
     handle_info(Info, State) ->
    -    couch_log:error("config:handle_info Info: ~p~n", [Info]),
    +    couch_log:notice("config:handle_info Info: ~p~n", [Info]),
    --- End diff --
    
    oops, fixing that right away


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113303422
  
    \o/ Thanks @chewbranca for review!


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#discussion_r32766968
  
    --- Diff: Makefile ---
    @@ -0,0 +1,27 @@
    +export BUILDDIR ?= /Users/elbrujohalcon/Projects/inaka/couchdb-config
    --- End diff --
    
    License header should be applied for Makefiles as well.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113286891
  
    Let's try that out, @chewbranca … wait for my next commit


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113295968
  
    Thanks @elbrujohalcon! If I use https://github.com/apache/couchdb-lager/pull/1 all the tests pass.
    
    I'm +1 although I wonder if there's a way we can get rid of `?BUILDDIR` and `?CONFIG_CHAIN` entirely, or perhaps expose them as `config_eunit.hrl` in this application and let the other `couchdb-*` applications include the macros from here.
    
    Also, given this is one of the first applications that's being modified to run outside of CouchDB itself, it would be good to get some feedback from @rnewson and @janl.



---
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-config pull request: Gaining independence

Posted by chewbranca <gi...@git.apache.org>.
Github user chewbranca commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32776449
  
    --- Diff: src/config.erl ---
    @@ -273,13 +273,13 @@ handle_info({gen_event_EXIT, {config_listener, Module}, shutdown}, State)  ->
         couch_log:notice("config_listener(~p) stopped with reason: shutdown~n", [Module]),
         {noreply, State};
     handle_info({gen_event_EXIT, {config_listener, Module}, normal}, State)  ->
    -    couch_log:info("config_listener(~p) stopped with reason: shutdown~n", [Module]),
    +    couch_log:notice("config_listener(~p) stopped with reason: shutdown~n", [Module]),
         {noreply, State};
     handle_info({gen_event_EXIT, {config_listener, Module}, Reason}, State) ->
    -    couch_log:error("config_listener(~p) stopped with reason: ~p~n", [Module, Reason]),
    +    couch_log:notice("config_listener(~p) stopped with reason: ~p~n", [Module, Reason]),
         {noreply, State};
     handle_info(Info, State) ->
    -    couch_log:error("config:handle_info Info: ~p~n", [Info]),
    +    couch_log:notice("config:handle_info Info: ~p~n", [Info]),
    --- End diff --
    
    These should be switched back to the original levels.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113290109
  
    This whole thing lead me to detect a missing dep in couch-lager as well. Check PR apache/couchdb-lager#1, guys


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113274377
  
    @elbrujohalcon Last commit fixed that problem, thanks!


---
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-config pull request: Gaining independence

Posted by elbrujohalcon <gi...@git.apache.org>.
Github user elbrujohalcon commented on a diff in the pull request:

    https://github.com/apache/couchdb-config/pull/4#discussion_r32767510
  
    --- Diff: Makefile ---
    @@ -0,0 +1,27 @@
    +export BUILDDIR ?= /Users/elbrujohalcon/Projects/inaka/couchdb-config
    --- End diff --
    
    oops


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#discussion_r32771894
  
    --- Diff: Makefile ---
    @@ -0,0 +1,38 @@
    +# Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +# use this file except in compliance with the License. You may obtain a copy of
    +# the License at
    +#
    +#   http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    +# License for the specific language governing permissions and limitations under
    +# the License.
    +export BUILDDIR ?= ..
    +
    +REBAR ?= rebar
    +
    +.PHONY: all app clean test shell xref
    +
    +all:
    +	${REBAR} get compile
    +
    +app:
    +	${REBAR} skip_deps=true compile
    +
    +clean: app
    +	${REBAR} clean
    +
    +test: app
    --- End diff --
    
    We use `make check` to run the tests for other subprojects. Could you add it here? Alias is fine.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113761349
  
    I do like @rnewson’s take. 2.0 is a bit of a moving target when it comes to building and testing for a little while longer. I love where this work is going and it is going to make CouchDB a lot better. Are we cool leaving this to merge just after 2.x.x was branched?


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113267539
  
    @elbrujohalcon I see. This is a good goal and I also want that (: In fact, for some apps that could not be so easy.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#issuecomment-113286378
  
    I like where you're going with this @elbrujohalcon!
    
    One thing to be aware of, is that we run the test suite for this application as part of a parent application in http://github.com/apache/couchdb, so the duplication of `couch_eunit.hrl` is problematic. Although it looks like `?BUILDDIR` and `?CONFIG_CHAIN` are the only things used there. I think it would be good to see if we skip using those entirely and not need to include `couch_eunit.hrl`.


---
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-config pull request: Gaining independence

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

    https://github.com/apache/couchdb-config/pull/4#discussion_r32767285
  
    --- Diff: src/config.erl ---
    @@ -208,7 +208,7 @@ handle_call(all, _From, Config) ->
         {reply, Resp, Config};
     handle_call({set, Sec, Key, Val, Persist, Reason}, _From, Config) ->
         true = ets:insert(?MODULE, {{Sec, Key}, Val}),
    -    couch_log:notice("~p: [~s] ~s set to ~s for reason ~p",
    +    error_logger:info_msg("~p: [~s] ~s set to ~s for reason ~p",
    --- End diff --
    
    That's a horrible mistake. couch_log is based on lager and all logging routines goes through it. error_logger on other hand may become bottleneck. There is no practical reason to for such change.


---
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.
---