You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2021/01/24 18:11:44 UTC

[couchdb] 02/02: Run eunit tests for each app separately

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch devcontainer
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 7fcefea3d3b8735fe580d11acc4d5ca4278dff2b
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sun Jan 24 11:17:04 2021 -0500

    Run eunit tests for each app separately
    
    The `eunit` target executes a for loop that appears intended to use a
    separate invocation of rebar for each Erlang application's unit tests.
    When running `make eunit` without any arguments this works correctly,
    as the for loop processes the output of `ls src`. But if you specify a
    comma-delimited list of applications the for loop will treat that as a
    single argument and pass it down to rebar. This asymmetry is
    surprising, but also seems to cause some issues with environment
    variables not being inherited by the environment used to execute the
    tests for the 2..N applications in the list. I didn't bother digging
    into the rebar source code to figure out what was happening there.
    
    This patch just parses the incoming comma-delimited list with `sed` to
    create a whitespace-delimited list for the loop, so we get the same
    behavior regardless of whether we are specifying applications
    explicitly or not.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index b02f180..95d5bf6 100644
--- a/Makefile
+++ b/Makefile
@@ -152,7 +152,7 @@ check-all-tests: all python-black
 	@$(MAKE) elixir
 
 ifdef apps
-subdirs = $(apps)
+subdirs=$(shell echo $(apps) | sed 's/,/ /g')
 else
 subdirs=$(shell ls src)
 endif