This repository has been archived by the owner on Dec 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
146 lines (118 loc) · 5.14 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
QIX_ENGINE_VER := "12.248.0"
SENSE_CLIENT_VER := "5.43.0"
help: ## Call the help
@echo ''
@echo 'Available commands:'
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo ''
.PHONY: help
build: build-dev build-release
.PHONY: build
build-dev: ## Build the extension (dev build)
npm run build
.PHONY: build-dev
build-release: ## Build the extensions (release build)
npm run release
.PHONY: build-release
gen-readme: ## Generate the README.md (using docker-verb)
docker run --rm -v ${PWD}:/opt/verb stefanwalther/verb
.PHONY: gen-readme
gen-readme-watch:
# This requires a global install of nodemon (npm install -g nodemon)
nodemon --config ./nodemon-readme.json --exec make gen-readme
.PHONY: gen-readme-watch
up: down build-dev ## Bring the dev environment up
ENV=dev \
QIX_ENGINE_VER=$(QIX_ENGINE_VER) \
SENSE_CLIENT_VER=$(SENSE_CLIENT_VER) \
docker-compose up -d
@echo ""
@echo "DEV BUILD::"
@echo "Open the app at http://localhost:9076/sense/app/sense-navigation_v1x.qvf"
@echo ""
.PHONY: up
down: ## Tear down the dev environment
docker-compose down -t 0
.PHONY: down
up-release: build-release ## Bring up the release environment
ENV=release \
QIX_ENGINE_VER=$(QIX_ENGINE_VER) \
docker-compose up -d
@echo ""
@echo "RELEASE BUILD:"
@echo "Open the app at http://localhost:9076/sense/app/sense-navigation_v1x.qvf"
@echo ""
.PHONY: up-release
down-release: ## Tear down the relase environment
docker-compose down -t 0
.PHONY: down-release
build-test: ## Build the test image.
docker build -t stefanwalther/sense-navigation-test -f Dockerfile.test .
.PHONY: build-test
up-test: build-test
docker-compose --f=docker-compose.test.yml up
.PHONY: up-test
down-test:
docker-compose --f=docker-compose.test.yml down -t 0
.PHONY: down-test
up-github: ## Bring up the dummy evironment (GitHub downloads)
QIX_ENGINE_VER=$(QIX_ENGINE_VER) && docker-compose -f docker-compose.github.yml up -d
@echo ""
@echo "Open the app at http://localhost:9076/sense/app/empty.qvf"
@echo ""
.PHONY: up-github
down-github: ## Tear down the dummy environment (GitHub downloads)
docker-compose -f docker-compose.github.yml down -t 0
.PHONY: down-github
clean: clean-e2e-test-results
.PHONY: clean
clean-e2e-test-results: ## Clean up all the e2e test results
# Non-UI tests
rm -rf ./test/e2e/__artifacts__/diff
rm -rf ./test/e2e/__artifacts__/regression
rm -rf ./test/e2e/__artifacts__/screenshots
rm -rf ./test/e2e/__artifacts__/chrome-report-**.*
# Interactive tests
rm -rf ./test/e2e/__artifacts_interactive__/diff
rm -rf ./test/e2e/__artifacts_interactive__/regression
rm -rf ./test/e2e/__artifacts_interactive__/screenshots
rm -rf ./test/e2e/__artifacts_interactive__/chrome-report-**.*
.PHONY: clean-e2e-test-results
clean-e2e-baseline: ## Delete the baseline of e2e results, atttion, this might break things ...
rm -rf ./test/e2e/__artifacts__/baseline
.PHONY: clean-e2e-baseline
webdriver-update: ## Update WebDriver
npm run test:setup-webdriver
.PHONY: webdriver-update
test-dockerignore: ## Helper to make sure that dockerignore is working properly
docker build -f Dockerfile.build-context -t stefanwalther/build-context . && \
docker run --rm -it stefanwalther/build-context
.PHONY: test-dockerignore
test-e2e-local: ## Run the integration tests (locally)
QIX_ENGINE_VER=$(QIX_ENGINE_VER) \
docker-compose -f docker-compose.e2e-tests.yml up -d --build
npx webdriver-manager update --gecko false --versions.chrome 2.38
npx aw protractor -c ./test/e2e/aw.config.js --baseUrl http://localhost:9076/sense/app/ --seleniumAddress http://localhost:4444/wd/hub
docker-compose -f docker-compose.e2e-tests.yml down -t 0
.PHONY: test-e2e-local
# This basically runs the same tests as on CircleCI, except the linting.
test-e2e: build-test clean-e2e-test-results ## Run the integration tests (in docker containers)
QIX_ENGINE_VER=$(QIX_ENGINE_VER) \
docker-compose -f docker-compose.e2e-tests.yml up -d --build
docker exec -it sense-navigation-test npm run test:e2e:container
docker-compose -f docker-compose.e2e-tests.yml down -t 0
.PHONY: test-e2e
test: build-test clean-e2e-test-results test-e2e ## Run all tests
.PHONY: test
test-e2e-interactive: clean-e2e-test-results build-dev build-test ## Run all tests in interactive mode
npm run test:setup-webdriver && \
ENV=dev \
QIX_ENGINE_VER=$(QIX_ENGINE_VER) \
SENSE_CLIENT_VER=$(SENSE_CLIENT_VER) \
docker-compose down -t 0 && \
ENV=dev \
QIX_ENGINE_VER=$(QIX_ENGINE_VER) \
SENSE_CLIENT_VER=$(SENSE_CLIENT_VER) \
docker-compose -f docker-compose.yml up -d
npx aw protractor --coverage -c ./test/e2e/aw.config.js --baseUrl http://localhost:9076/sense/app/ --artifactsPath test/e2e/__artifacts_interactive__ --directConnect true --headLess false
.PHONY: test-e2e-interactive