This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
61 lines (48 loc) · 1.97 KB
/
Makefile
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
# Origami Service Makefile
# ------------------------
# This section of the Makefile should not be modified, it includes
# commands from the Origami service Makefile.
# https://github.com/Financial-Times/origami-service-makefile
include node_modules/@financial-times/origami-service-makefile/index.mk
# [edit below this line]
# ------------------------
# Configuration
# -------------
INTEGRATION_TIMEOUT = 10000
INTEGRATION_SLOW = 2000
SERVICE_NAME = Origami Bower Registry
SERVICE_SYSTEM_CODE = origami-bower-registry
SERVICE_SALESFORCE_ID = $(SERVICE_NAME)
HEROKU_APP_QA = $(SERVICE_SYSTEM_CODE)-qa
HEROKU_APP_EU = $(SERVICE_SYSTEM_CODE)-eu
HEROKU_APP_US = $(SERVICE_SYSTEM_CODE)-us
GRAFANA_DASHBOARD = $(SERVICE_SYSTEM_CODE)
export GITHUB_RELEASE_REPO := Financial-Times/$(SERVICE_SYSTEM_CODE)
# Test tasks
# ----------
# Default configurations for integration tests
export INTEGRATION_TIMEOUT := 5000
export INTEGRATION_SLOW := 4000
# Run all of the test tasks and verify coverage
test: test-unit test-integration
@$(TASK_DONE)
# Run the unit tests using mocha
test-unit:
@if [ -d test/unit ]; then mocha "test/unit/**/*.test.js" --recursive --bail --exit ${CI:+--forbid-only} && $(TASK_DONE); fi
# Run the unit tests using mocha and generating
# a coverage report if nyc or istanbul are installed
test-unit-coverage:
@if [ -d test/unit ]; then \
if [ -x $(NPM_BIN)/nyc ]; then \
nyc --reporter=text --reporter=html $(NPM_BIN)/_mocha "test/unit/**/*.test.js" --recursive --bail --exit && $(TASK_DONE); \
else \
if [ -x $(NPM_BIN)/istanbul ]; then \
istanbul cover $(NPM_BIN)/_mocha -- "test/unit/**/*.test.js" --recursive --bail --exit && $(TASK_DONE); \
else \
make test-unit; \
fi \
fi \
fi
# Run the integration tests using mocha
test-integration:
@if [ -d test/integration ]; then mocha "test/integration/**/*.test.js" --recursive --bail --exit ${CI:+--forbid-only} --timeout $(INTEGRATION_TIMEOUT) --slow $(INTEGRATION_SLOW) $(INTEGRATION_FLAGS) && $(TASK_DONE); fi