Set query server env variable in Makefile for isolated eunit tests#1747
Set query server env variable in Makefile for isolated eunit tests#1747
Conversation
| # target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options | ||
| 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 |
There was a problem hiding this comment.
I think we can use ${BUILDDIR} instead of calling $(shell pwd) several times.
There was a problem hiding this comment.
@iilyak I guess we can, but it's inconsistent with usage pwd everywhere else and feels kind of flimsy, setting env var in one step then depending on it in another.
Why do you want this change? It's not like here is a performance penalty we care about.
There was a problem hiding this comment.
but it's inconsistent with usage pwd everywhere else and feels kind of flimsy, setting env var in one step then depending on it in another.
I looked only at a diff and missed the fact that is used everywhere. It looked strange to see export BUILDIR and $(shell pwd) two lines bellow.
Why do you want this change?
It is just a suggestion I am fine with the way you wrote it.
There was a problem hiding this comment.
It looked strange to see export BUILDIR and $(shell pwd) two lines bellow.
and one line above too 😄
Well, I agree it's not the best way to write Makefiles and better way to go about it would be something like ROOTDIR := $(shell pwd) to expand current dir at top of Makefile and then just use make's var ${ROOTDIR} everywhere else. But this is a bit bigger change for a quick fix I intended to do, so since you don't have strong feelings about it I'll go ahead with how it is.
|
@wohali yes, my fault. |
Overview
After #1602 we requite env variable
COUCHDB_QUERY_SERVER_JAVASCRIPTto point to js query server. This patch adds the env var on Makefile'seunittarget returning ability to run the isolated eunit tests without setting that var in each tests' setup.Testing recommendations
Isolated tests with query server, e.g.
make eunit apps=couch_mrview suites=couch_mrview_all_docs_testsshould run locally without throwing "unknown query server" exceptions.Checklist