Collect all env vars in one, easy-to-find place (#1149)

* Collect all env vars in one, easy-to-find place

Past state:
* Default environement variables were stored in both client/package.json
and client/__tests__/e2e/config.js
* Constants that should have been linked--like the cellxgene server port
during testing--were repeated.

With this commit:
* All environment variables are parameterized
* All environment variables are packaged in default env files

* Move npm scripts to client Makefile

* Respond to feedback from @seve and @bkmartinjr
This commit is contained in:
Matt Weiden
2020-02-12 12:50:48 -08:00
committed by GitHub
parent 5340a5f951
commit ac13b31e13
16 changed files with 777 additions and 287 deletions
+57 -1
View File
@@ -1,3 +1,9 @@
include ../common.mk
DATASET := $(if $(DATASET),$(DATASET),../example-dataset/pbmc3k.h5ad)
# Packaging
.PHONY: clean
clean:
rm -rf node_modules
@@ -14,7 +20,57 @@ install:
build:
npm run build
# Development convenience methods
.PHONY: server-requirements
server-requirements:
virtualenv -p python3 ../venv
source ../venv/bin/activate && \
pip install -r ../server/requirements-dev.txt && \
yes | pip uninstall cellxgene || true && \
pip install -e ..
.PHONY: start-frontend
start-frontend:
node server/development.js
.PHONY: start-server
start-server:
cellxgene launch -p $(CXG_SERVER_PORT) $(CXG_OPTIONS) $(DATASET)
.PHONY: backend-dev
backend-dev: server-requirements
source ../venv/bin/activate && $(MAKE) start-server
.PHONY: backend-dev-anno
backend-dev-anno: server-requirements
CXG_OPTIONS='--experimental-annotations' $(MAKE) backend-dev
.PHONY: backend-dev-anno-ontology
backend-dev-anno-ontology: server-requirements
CXG_OPTIONS='--experimental-annotations --experimental-annotations-ontology' \
$(MAKE) backend-dev
.PHONY: e2e
e2e:
node node_modules/jest/bin/jest.js \
--verbose false \
--config __tests__/e2e/e2eJestConfig.json \
e2e/e2e.test.js
.PHONY: test
test:
node node_modules/jest/bin/jest.js
.PHONY: smoke-test
smoke-test:
start_server_and_test '$(MAKE) start-server' $(CXG_SERVER_PORT) '$(MAKE) e2e'
.PHONY: unit-test
unit-test:
node node_modules/jest/bin/jest.js --testPathIgnorePatterns e2e
# pass remaining commands through to npm run
%:
npm run $(*)