forked from HumanDynamics/rhythm-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (55 loc) · 2.53 KB
/
Makefile
File metadata and controls
72 lines (55 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Makefile to build and test the rhythm-server
# duplicates (and should be kept in sync with) some of the scripts in package.json
#
GIT_TAG_VERSION = $(shell git describe)
COMPILER = ./node_modules/.bin/tsc
LINT = ./node_modules/.bin/eslint
MOCHA = ./node_modules/.bin/mocha
LINT_LOG = logs/lint.log
TEST_LOG = logs/test.log
# Add --quiet to only report on errors, not warnings
LINT_OPTIONS =
LINT_FORMAT = stylish
.DELETE_ON_ERROR :
.PHONY : help all build doc lint test load-test wtftest clean clean-build start-dev
help :
@echo "" ; \
echo "Useful targets in this rhythm-server Makefile:" ; \
echo "- all : run lint, build, test" ; \
echo "- build :" ; \
echo "- lint : run lint over the sources & tests; display results to stdout" ; \
echo "- lint-log : run lint concise diffable output to $(LINT_LOG)" ; \
echo "- test : run the mocha (unit) tests" ; \
echo "- load-test : run the mocha (load) tests" ; \
echo "- wtftest : run the mocha (unit) tests w/ wtfnode to help debug the test run hanging at the end" ; \
echo "- start-dev : start a dev container for the rhythm-server" ; \
echo "- vim-lint : run lint in format consumable by vim quickfix" ; \
echo ""
all : lint build test
build :
@echo build would run the compiler: $(COMPILER)
doc :
@echo doc would run the compiler: $(COMPILER)
lint-log: LINT_OPTIONS = --output-file $(LINT_LOG)
lint-log: LINT_FORMAT = unix
vim-lint: LINT_FORMAT = unix
lint vim-lint lint-log:
$(LINT) $(LINT_OPTIONS) --format $(LINT_FORMAT) src test
test :
$(MOCHA) --reporter spec -r dotenv/config --recursive --sort --invert --grep 'Load tests' test | tee $(TEST_LOG)
load-test :
$(MOCHA) --reporter spec -r dotenv/config test/load.test.js
wtftest : ./node_modules/.bin/wtfnode
# This is helpful for determining why the tests seem to be hanging after they've "finished"
# it requires the wtfnode package to be installed.
./node_modules/.bin/wtfnode ./node_modules/.bin/_mocha --reporter spec -r dotenv/config --recursive --sort --invert --grep 'Load tests' test
clean : clean-build
clean-build :
-rm -f dist/*
start-dev :
-docker-compose run rhythm-server bash
-docker-compose rm --force
-docker-compose stop
./node_modules/.bin/wtfnode :
npm install wtfnode --no-save