-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
536 lines (450 loc) · 20.5 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SHELL := /bin/bash
TOX_DIR := .tox
VIRTUALENV_DIR ?= virtualenv
BINARIES := bin
# All components are prefixed by st2
COMPONENTS := $(wildcard st2*)
COMPONENTS_RUNNERS := $(wildcard contrib/runners/*)
COMPONENTS_WITH_RUNNERS := $(wildcard st2*)
COMPONENTS_WITH_RUNNERS += $(wildcard contrib/runners/*)
# Components that implement a component-controlled test-runner. These components provide an
# in-component Makefile. (Temporary fix until I can generalize the pecan unittest setup. -mar)
# Note: We also want to ignore egg-info dir created during build
COMPONENT_SPECIFIC_TESTS := st2tests st2client.egg-info
# nasty hack to get a space into a variable
space_char :=
space_char +=
comma := ,
COMPONENT_PYTHONPATH = $(subst $(space_char),:,$(realpath $(COMPONENTS_WITH_RUNNERS)))
COMPONENTS_TEST := $(foreach component,$(filter-out $(COMPONENT_SPECIFIC_TESTS),$(COMPONENTS_WITH_RUNNERS)),$(component))
COMPONENTS_TEST_COMMA := $(subst $(space_char),$(comma),$(COMPONENTS_TEST))
PYTHON_TARGET := 2.7
REQUIREMENTS := test-requirements.txt requirements.txt
PIP_OPTIONS := $(ST2_PIP_OPTIONS)
NOSE_OPTS := --rednose --immediate --with-parallel
NOSE_TIME := $(NOSE_TIME)
ifdef NOSE_TIME
NOSE_OPTS := --rednose --immediate --with-parallel --with-timer
endif
ifndef PIP_OPTIONS
PIP_OPTIONS :=
endif
.PHONY: all
all: requirements configgen check tests
# Target for debugging Makefile variable assembly
.PHONY: play
play:
@echo COMPONENTS=$(COMPONENTS)
@echo COMPONENTS_TEST=$(COMPONENTS_TEST)
@echo COMPONENTS_TEST_COMMA=$(COMPONENTS_TEST_COMMA)
@echo COMPONENT_PYTHONPATH=$(COMPONENT_PYTHONPATH)
.PHONY: check
check: requirements flake8 checklogs
.PHONY: checklogs
checklogs:
@echo
@echo "================== LOG WATCHER ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; ./tools/log_watcher.py 10
.PHONY: pylint
pylint: requirements .pylint
.PHONY: configgen
configgen: requirements .configgen
.PHONY: .configgen
.configgen:
@echo
@echo "================== config gen ===================="
@echo
echo "# Sample config which contains all the available options which the corresponding descriptions" > conf/st2.conf.sample;
echo "# Note: This file is automatically generated using tools/config_gen.py - DO NOT UPDATE MANUALLY" >> conf/st2.conf.sample
echo "" >> conf/st2.conf.sample
. $(VIRTUALENV_DIR)/bin/activate; python ./tools/config_gen.py >> conf/st2.conf.sample;
.PHONY: .pylint
.pylint:
@echo
@echo "================== pylint ===================="
@echo
# Lint st2 components
@for component in $(COMPONENTS); do\
echo "==========================================================="; \
echo "Running pylint on" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models --load-plugins=pylint_plugins.db_models $$component/$$component || exit 1; \
done
# Lint runner modules and packages
@for component in $(COMPONENTS_RUNNERS); do\
echo "==========================================================="; \
echo "Running pylint on" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models --load-plugins=pylint_plugins.db_models $$component/*.py || exit 1; \
done
# Lint Python pack management actions
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models contrib/packs/actions/*.py || exit 1;
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models contrib/packs/actions/*/*.py || exit 1;
# Lint other packs
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models contrib/linux/*/*.py || exit 1;
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models contrib/chatops/*/*.py || exit 1;
# Lint Python scripts
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models scripts/*.py || exit 1;
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc --load-plugins=pylint_plugins.api_models tools/*.py || exit 1;
. $(VIRTUALENV_DIR)/bin/activate; pylint -E --rcfile=./lint-configs/python/.pylintrc pylint_plugins/*.py || exit 1;
.PHONY: lint-api-spec
lint-api-spec: requirements .lint-api-spec
.PHONY: .lint-api-spec
.lint-api-spec:
@echo
@echo "================== Lint API spec ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-validate-api-spec
.PHONY: generate-api-spec
generate-api-spec: requirements .generate-api-spec
.PHONY: .generate-api-spec
.generate-api-spec:
@echo
@echo "================== Generate openapi.yaml file ===================="
@echo
echo "# NOTE: This file is auto-generated - DO NOT EDIT MANUALLY" > st2common/st2common/openapi.yaml
echo "# Edit st2common/st2common/openapi.yaml.j2 and then run" >> st2common/st2common/openapi.yaml
echo "# make .generate-api-spec" >> st2common/st2common/openapi.yaml
echo "# to generate the final spec file" >> st2common/st2common/openapi.yaml
. virtualenv/bin/activate; st2common/bin/st2-generate-api-spec >> st2common/st2common/openapi.yaml
.PHONY: circle-lint-api-spec
circle-lint-api-spec:
@echo
@echo "================== Lint API spec ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-validate-api-spec || echo "Open API spec lint failed."
.PHONY: flake8
flake8: requirements .flake8
.PHONY: .flake8
.flake8:
@echo
@echo "==================== flake ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 $(COMPONENTS)
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 $(COMPONENTS_RUNNERS)
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 contrib/packs/actions/
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 contrib/linux
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 contrib/chatops/
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 scripts/
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 tools/
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 pylint_plugins/
.PHONY: bandit
bandit: requirements .bandit
.PHONY: .bandit
.bandit:
@echo
@echo "==================== bandit ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; bandit -r $(COMPONENTS_WITH_RUNNERS) -lll
.PHONY: lint
lint: requirements .lint
.PHONY: .lint
.lint: .generate-api-spec .flake8 .pylint .bandit .st2client-dependencies-check .st2common-circular-dependencies-check .rst-check
.PHONY: clean
clean: .cleanpycs
.PHONY: compile
compile:
@echo "======================= compile ========================"
@echo "------- Compile all .py files (syntax check test) ------"
@if python -c 'import compileall,re; compileall.compile_dir(".", rx=re.compile(r"/virtualenv|.tox"), quiet=True)' | grep .; then exit 1; else exit 0; fi
.PHONY: .cleanpycs
.cleanpycs:
@echo "Removing all .pyc files"
find $(COMPONENTS_WITH_RUNNERS) -name \*.pyc -type f -print0 | xargs -0 -I {} rm {}
.PHONY: .st2client-dependencies-check
.st2client-dependencies-check:
@echo "Checking for st2common imports inside st2client"
find ${ROOT_DIR}/st2client/st2client/ -name \*.py -type f -print0 | xargs -0 cat | grep st2common ; test $$? -eq 1
.PHONY: .st2common-circular-dependencies-check
.st2common-circular-dependencies-check:
@echo "Checking st2common for circular dependencies"
find ${ROOT_DIR}/st2common/st2common/ -name \*.py -type f -print0 | xargs -0 cat | grep st2reactor ; test $$? -eq 1
find ${ROOT_DIR}/st2common/st2common/ \( -name \*.py ! -name runnersregistrar\.py -name \*.py ! -name compat\.py \) -type f -print0 | xargs -0 cat | grep st2actions ; test $$? -eq 1
find ${ROOT_DIR}/st2common/st2common/ -name \*.py -type f -print0 | xargs -0 cat | grep st2api ; test $$? -eq 1
find ${ROOT_DIR}/st2common/st2common/ -name \*.py -type f -print0 | xargs -0 cat | grep st2auth ; test $$? -eq 1
find ${ROOT_DIR}/st2common/st2common/ -name \*.py -type f -print0 | xargs -0 cat | grep st2debug; test $$? -eq 1
find ${ROOT_DIR}/st2common/st2common/ -name \*.py -type f -print0 | xargs -0 cat | grep st2stream; test $$? -eq 1
find ${ROOT_DIR}/st2common/st2common/ -name \*.py -type f -print0 | xargs -0 cat | grep st2exporter; test $$? -eq 1
.PHONY: .cleanmongodb
.cleanmongodb:
@echo "==================== cleanmongodb ===================="
@echo "----- Dropping all MongoDB databases -----"
@sudo pkill -9 mongod
@sudo rm -rf /var/lib/mongodb/*
@sudo chown -R mongodb:mongodb /var/lib/mongodb/
@sudo service mongodb start
@sleep 15
@mongo --eval "rs.initiate()"
@sleep 15
.PHONY: .cleanmysql
.cleanmysql:
@echo "==================== cleanmysql ===================="
@echo "----- Dropping all Mistral MYSQL databases -----"
@mysql -uroot -pStackStorm -e "DROP DATABASE IF EXISTS mistral"
@mysql -uroot -pStackStorm -e "CREATE DATABASE mistral"
@mysql -uroot -pStackStorm -e "GRANT ALL PRIVILEGES ON mistral.* TO 'mistral'@'127.0.0.1' IDENTIFIED BY 'StackStorm'"
@mysql -uroot -pStackStorm -e "FLUSH PRIVILEGES"
@/opt/openstack/mistral/.venv/bin/python /opt/openstack/mistral/tools/sync_db.py --config-file /etc/mistral/mistral.conf
.PHONY: .cleanrabbitmq
.cleanrabbitmq:
@echo "==================== cleanrabbitmq ===================="
@echo "Deleting all RabbitMQ queue and exchanges"
@sudo rabbitmqctl stop_app
@sudo rabbitmqctl reset
@sudo rabbitmqctl start_app
.PHONY: distclean
distclean: clean
@echo
@echo "==================== distclean ===================="
@echo
rm -rf $(VIRTUALENV_DIR)
.PHONY: requirements
requirements: virtualenv .sdist-requirements
@echo
@echo "==================== requirements ===================="
@echo
# Make sure we use latest version of pip
$(VIRTUALENV_DIR)/bin/pip install --upgrade "pip>=9.0,<9.1"
$(VIRTUALENV_DIR)/bin/pip install virtualenv # Required for packs.install in dev envs.
# Generate all requirements to support current CI pipeline.
$(VIRTUALENV_DIR)/bin/python scripts/fixate-requirements.py --skip=virtualenv -s st2*/in-requirements.txt -f fixed-requirements.txt -o requirements.txt
# Install requirements
#
for req in $(REQUIREMENTS); do \
echo "Installing $$req..." ; \
$(VIRTUALENV_DIR)/bin/pip install $(PIP_OPTIONS) -r $$req ; \
done
# Note: We install prance here and not as part of any component
# requirements.txt because it has a conflict with our dependency (requires
# new version of requests) which we cant resolve at this moment
$(VIRTUALENV_DIR)/bin/pip install "prance==0.6.1"
.PHONY: virtualenv
virtualenv: $(VIRTUALENV_DIR)/bin/activate
$(VIRTUALENV_DIR)/bin/activate:
@echo
@echo "==================== virtualenv ===================="
@echo
test -f $(VIRTUALENV_DIR)/bin/activate || virtualenv --no-site-packages $(VIRTUALENV_DIR)
# Setup PYTHONPATH in bash activate script...
echo '' >> $(VIRTUALENV_DIR)/bin/activate
echo '_OLD_PYTHONPATH=$$PYTHONPATH' >> $(VIRTUALENV_DIR)/bin/activate
echo 'PYTHONPATH=$$_OLD_PYTHONPATH:$(COMPONENT_PYTHONPATH)' >> $(VIRTUALENV_DIR)/bin/activate
echo 'export PYTHONPATH' >> $(VIRTUALENV_DIR)/bin/activate
touch $(VIRTUALENV_DIR)/bin/activate
# Setup PYTHONPATH in fish activate script...
echo '' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo 'set -gx _OLD_PYTHONPATH $$PYTHONPATH' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo 'set -gx PYTHONPATH $$_OLD_PYTHONPATH $(COMPONENT_PYTHONPATH)' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo 'functions -c deactivate old_deactivate' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo 'function deactivate' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo ' if test -n $$_OLD_PYTHONPATH' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo ' set -gx PYTHONPATH $$_OLD_PYTHONPATH' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo ' set -e _OLD_PYTHONPATH' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo ' end' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo ' old_deactivate' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo ' functions -e old_deactivate' >> $(VIRTUALENV_DIR)/bin/activate.fish
echo 'end' >> $(VIRTUALENV_DIR)/bin/activate.fish
touch $(VIRTUALENV_DIR)/bin/activate.fish
.PHONY: tests
tests: pytests
.PHONY: pytests
pytests: compile requirements .flake8 .pylint .pytests-coverage
.PHONY: .pytests
.pytests: compile .configgen .generate-api-spec .unit-tests .itests clean
.PHONY: .pytests-coverage
.pytests-coverage: .unit-tests-coverage-html .itests-coverage-html clean
.PHONY: unit-tests
unit-tests: requirements .unit-tests
.PHONY: .unit-tests
.unit-tests:
@echo
@echo "==================== tests ===================="
@echo
@echo "----- Dropping st2-test db -----"
@mongo st2-test --eval "db.dropDatabase();"
@for component in $(COMPONENTS_TEST); do\
echo "==========================================================="; \
echo "Running tests in" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v $$component/tests/unit || exit 1; \
done
.PHONY: .unit-tests-coverage-html
.unit-tests-coverage-html:
@echo
@echo "==================== unit tests with coverage (HTML reports) ===================="
@echo
@echo "----- Dropping st2-test db -----"
@mongo st2-test --eval "db.dropDatabase();"
@for component in $(COMPONENTS_TEST); do\
echo "==========================================================="; \
echo "Running tests in" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v --with-coverage \
--cover-inclusive --cover-html \
--cover-package=$(COMPONENTS_TEST_COMMA) $$component/tests/unit || exit 1; \
done
.PHONY: itests
itests: requirements .itests
.PHONY: .itests
.itests:
@echo
@echo "==================== integration tests ===================="
@echo
@echo "----- Dropping st2-test db -----"
@mongo st2-test --eval "db.dropDatabase();"
@for component in $(COMPONENTS_TEST); do\
echo "==========================================================="; \
echo "Running tests in" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v $$component/tests/integration || exit 1; \
done
.PHONY: .itests-coverage-html
.itests-coverage-html:
@echo
@echo "================ integration tests with coverage (HTML reports) ================"
@echo
@echo "----- Dropping st2-test db -----"
@mongo st2-test --eval "db.dropDatabase();"
@for component in $(COMPONENTS_TEST); do\
echo "==========================================================="; \
echo "Running tests in" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v --with-coverage \
--cover-inclusive --cover-html \
--cover-package=$(COMPONENTS_TEST_COMMA) $$component/tests/integration || exit 1; \
done
.PHONY: mistral-itests
mistral-itests: requirements .mistral-itests
.PHONY: .mistral-itests
.mistral-itests:
@echo
@echo "==================== MISTRAL integration tests ===================="
@echo "The tests assume both st2 and mistral are running on 127.0.0.1."
@echo
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v st2tests/integration/mistral || exit 1;
.PHONY: .mistral-itests-coverage-html
.mistral-itests-coverage-html:
@echo
@echo "==================== MISTRAL integration tests with coverage (HTML reports) ===================="
@echo "The tests assume both st2 and mistral are running on 127.0.0.1."
@echo
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v --with-coverage \
--cover-inclusive --cover-html st2tests/integration/mistral || exit 1;
.PHONY: packs-tests
packs-tests: requirements .packs-tests
.PHONY: .packs-tests
.packs-tests:
@echo
@echo "==================== packs-tests ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; find ${ROOT_DIR}/contrib/* -maxdepth 0 -type d -print0 | xargs -0 -I FILENAME ./st2common/bin/st2-run-pack-tests -c -t -x -p FILENAME
.PHONY: runners-tests
packs-tests: requirements .runners-tests
.PHONY: .runners-tests
.runners-tests:
@echo
@echo "==================== runners-tests ===================="
@echo
@echo "----- Dropping st2-test db -----"
@mongo st2-test --eval "db.dropDatabase();"
@for component in $(COMPONENTS_RUNNERS); do\
echo "==========================================================="; \
echo "Running tests in" $$component; \
echo "==========================================================="; \
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v $$component/tests/unit || exit 1; \
done
.PHONY: cli
cli:
@echo
@echo "=================== Building st2 client ==================="
@echo
pushd $(CURDIR) && cd st2client && ((python setup.py develop || printf "\n\n!!! ERROR: BUILD FAILED !!!\n") || popd)
.PHONY: rpms
rpms:
@echo
@echo "==================== rpm ===================="
@echo
rm -Rf ~/rpmbuild
$(foreach COM,$(COMPONENTS), pushd $(COM); make rpm; popd;)
pushd st2client && make rpm && popd
rhel-rpms:
@echo
@echo "==================== rpm ===================="
@echo
rm -Rf ~/rpmbuild
$(foreach COM,$(COMPONENTS), pushd $(COM); make rhel-rpm; popd;)
pushd st2client && make rhel-rpm && popd
.PHONY: debs
debs:
@echo
@echo "==================== deb ===================="
@echo
rm -Rf ~/debbuild
$(foreach COM,$(COMPONENTS), pushd $(COM); make deb; popd;)
pushd st2client && make deb && popd
# >>>>
.PHONY: .sdist-requirements
.sdist-requirements:
# Copy over shared dist utils module which is needed by setup.py
@for component in $(COMPONENTS); do\
cp -f ./scripts/dist_utils.py $$component/dist_utils.py;\
done
# Copy over CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory
#@for component in $(COMPONENTS_TEST); do\
# test -s $$component/README.rst || cp -f README.rst $$component/; \
# cp -f CONTRIBUTING.rst $$component/; \
# cp -f LICENSE $$component/; \
#done
.PHONY: ci
ci: ci-checks ci-unit ci-integration ci-mistral ci-packs-tests
.PHONY: ci-checks
ci-checks: compile .generated-files-check .pylint .flake8 .bandit .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check
.PHONY: ci-st2client-py3-tests
ci-st2client-py3-tests:
@echo
@echo "==================== ci-st2client-py3-tests ===================="
@echo
tox -e py36 -v
.PHONY: st2client-py3-tests
st2client-py3-tests:
@echo
@echo "==================== ci-st2client-py3-tests ===================="
@echo
tox -e py36 -vv
.PHONY: .rst-check
.rst-check:
@echo
@echo "==================== rst-check ===================="
@echo
. $(VIRTUALENV_DIR)/bin/activate; rstcheck --report warning CHANGELOG.rst
.PHONY: .generated-files-check
.generated-files-check:
# Verify that all the files which are automatically generated have indeed been re-generated and
# committed
@echo "==================== generated-files-check ===================="
# 1. Sample config - conf/st2.conf.sample
cp conf/st2.conf.sample /tmp/st2.conf.sample.upstream
make .configgen
diff conf/st2.conf.sample /tmp/st2.conf.sample.upstream || (echo "conf/st2.conf.sample hasn't been re-generated and committed. Please run \"make configgen\" and include and commit the generated file." && exit 1)
# 2. OpenAPI definition file - st2common/st2common/openapi.yaml (generated from
# st2common/st2common/openapi.yaml.j2)
cp st2common/st2common/openapi.yaml /tmp/openapi.yaml.upstream
make .generate-api-spec
diff st2common/st2common/openapi.yaml /tmp/openapi.yaml.upstream || (echo "st2common/st2common/openapi.yaml hasn't been re-generated and committed. Please run \"make generate-api-spec\" and include and commit the generated file." && exit 1)
@echo "All automatically generated files are up to date."
.PHONY: ci-unit
ci-unit: .unit-tests-coverage-html
.PHONY: .ci-prepare-integration
.ci-prepare-integration:
sudo -E ./scripts/travis/prepare-integration.sh
.PHONY: ci-integration
ci-integration: .ci-prepare-integration .itests-coverage-html
.PHONY: .ci-prepare-mistral
.ci-prepare-mistral:
sudo -E ./scripts/travis/setup-mistral.sh
.PHONY: ci-mistral
ci-mistral: .ci-prepare-integration .ci-prepare-mistral .mistral-itests-coverage-html
.PHONY: ci-packs-tests
ci-packs-tests: .packs-tests