-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
133 lines (103 loc) · 3.41 KB
/
Makefile
File metadata and controls
133 lines (103 loc) · 3.41 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.PHONY: help install build watch lint installDistribution up down open cleanSite test testAll testChromiumHeaded testFirefoxHeadless smokeTest installTests fixTests
# #
# Plugin build #
# #
PLUGIN = Resources/Private/Plugin
## Install dependencies
install:
cd ${PLUGIN} && . ${NVM_DIR}/nvm.sh && nvm use
cd ${PLUGIN} && pnpm install --frozen-lockfile
## Build plugin for production
build:
cd ${PLUGIN} && pnpm run build
## Build plugin and watch for changes
watch:
cd ${PLUGIN} && pnpm run watch
## Run linting
lint:
cd ${PLUGIN} && pnpm run lint
# #
# Ddev local test distribution #
# #
DISTRIBUTION = Tests/Integration/TestDistribution
## Install distribution for testing
installDistribution:
cd ${DISTRIBUTION} && ddev composer install
cd ${DISTRIBUTION} && ddev exec ./flow doctrine:migrate
cd ${DISTRIBUTION} && ddev exec ./flow user:create --roles Neos.Neos:Administrator admin admin Jon Doe
cd ${DISTRIBUTION} && ddev exec ./flow user:create --roles Neos.Neos:Administrator admin2 admin2 Hauke Haien
cd ${DISTRIBUTION} && ddev exec ./flow site:import --package-key Carbon.TestSite
## Start distribution for testing
up:
cd ${DISTRIBUTION} && ddev start
## Stop distribution for testing
down:
cd ${DISTRIBUTION} && ddev stop
## Open distribution in browser for testing
open:
cd ${DISTRIBUTION} && ddev launch && sleep 1
## Clean distribution for testing
cleanSite:
cd ${DISTRIBUTION} && ddev exec ./flow site:prune testsite || true
cd ${DISTRIBUTION} && ddev exec ./flow site:import --package-key Carbon.TestSite
# #
# Playwright tests #
# #
# @param {only} grep select a test by (partial) name
# @param {skip} grep ignore a test by (partial) name
# @example
# make test only="emmet" skip="@optional"
## Make Firefox tests
test: testFirefoxHeadless
# one needs to do this from time to time
fixTests: cleanSite
# @param {only}
# @param {skip}
## Test all browsers
testAll:
cd Tests/Integration/ && pnpm playwright test -g "${only}" --grep-invert "${skip}"
# chromium works better headed
# @param {only}
# @param {skip}
## Test Chromium
testChromiumHeaded:
cd Tests/Integration/ && pnpm playwright test --project chromiumHeaded -g "${only}" --grep-invert "${skip}"
# firefox works better headless
# @param {only}
# @param {skip}
## Test Firefox
testFirefoxHeadless:
cd Tests/Integration/ && pnpm playwright test --project firefoxHeadless -g "${only}" --grep-invert "${skip}"
## Run smoke test
smokeTest:
make testFirefoxHeadless only="typing" skip="@optional"
## Install dependencies for tests
installTests:
cd Tests/Integration/ && pnpm i
cd Tests/Integration/ && pnpm playwright install chromium firefox
# Define colors
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
# define indention for descriptions
TARGET_MAX_CHAR_NUM=20
## Show help
help:
@echo ''
@echo '${GREEN}CLI command list:${RESET}'
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@echo ''