summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2019-08-09 16:34:43 -0400
committerAdam Kocoloski <kocolosk@apache.org>2019-08-16 12:34:48 -0400
commit54fe9525b92e0b0ba94692d637a1d711f31b1621 (patch)
treed4c764ca92d4b31ff74d4860202dea230a28ea18
parent8fa6ca1deff5eb61a3949f248b7f40a2febcd9e4 (diff)
downloadcouchdb-54fe9525b92e0b0ba94692d637a1d711f31b1621.tar.gz
Ensure EUnit inherits appropriate env vars
Omitting COUCHDB_VERSION caused the EUnit build of the replicator to have a corrupted User-Agent header. It tried to construct a version using git, but when building from a release tarball there is no git repo so the UA had a git error message in it. This error message contained a newline, which plausibly confused some part of the HTTP stack and caused replicator HTTP requests to hang. Related to #2098.
-rw-r--r--Makefile4
-rw-r--r--Makefile.win4
2 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 8f85ab8de..f09ae326a 100644
--- a/Makefile
+++ b/Makefile
@@ -168,11 +168,11 @@ eunit: export BUILDDIR = $(shell pwd)
eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell pwd)/share/server/main.js
eunit: couch
- @$(REBAR) setup_eunit 2> /dev/null
+ @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR) setup_eunit 2> /dev/null
@for dir in $(subdirs); do \
tries=0; \
while true; do \
- $(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir ; \
+ COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir ; \
if [ $$? -eq 0 ]; then \
break; \
else \
diff --git a/Makefile.win b/Makefile.win
index a5e23d498..eda27a02a 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -141,8 +141,8 @@ eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
eunit: export BUILDDIR = $(shell echo %cd%)
eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs $(shell echo %cd%)/share/server/main.js
eunit: couch
- @$(REBAR) setup_eunit 2> nul
- @$(REBAR) -r eunit $(EUNIT_OPTS)
+ @set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) setup_eunit 2> nul
+ @set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) -r eunit $(EUNIT_OPTS)
.PHONY: exunit
# target: exunit - Run ExUnit tests