@@ -22,10 +22,10 @@ BINARIES := bin
22
22
# All components are prefixed by st2 and not .egg-info.
23
23
COMPONENTS := $(shell ls -a | grep ^st2 | grep -v .egg-info)
24
24
COMPONENTS_RUNNERS := $(wildcard contrib/runners/* )
25
+ MOCK_RUNNERS := $(wildcard st2common/tests/runners/* )
25
26
COMPONENTS_WITHOUT_ST2TESTS := $(shell ls -a | grep ^st2 | grep -v .egg-info | grep -v st2tests | grep -v st2exporter)
26
27
27
28
COMPONENTS_WITH_RUNNERS := $(COMPONENTS ) $(COMPONENTS_RUNNERS )
28
- COMPONENTS_WITH_RUNNERS_WITHOUT_MISTRAL_RUNNER := $(foreach component,$(filter-out contrib/runners/mistral_v2,$(COMPONENTS_WITH_RUNNERS ) ) ,$(component ) )
29
29
30
30
COMPONENTS_TEST_DIRS := $(wildcard st2* /tests) $(wildcard contrib/runners/* /tests)
31
31
@@ -43,12 +43,11 @@ space_char :=
43
43
space_char +=
44
44
COMPONENT_PYTHONPATH = $(subst $(space_char ) ,:,$(realpath $(COMPONENTS_WITH_RUNNERS ) ) )
45
45
COMPONENTS_TEST := $(foreach component,$(filter-out $(COMPONENT_SPECIFIC_TESTS ) ,$(COMPONENTS_WITH_RUNNERS ) ) ,$(component ) )
46
- COMPONENTS_TEST_WITHOUT_MISTRAL_RUNNER := $(foreach component,$(filter-out $(COMPONENT_SPECIFIC_TESTS ) ,$(COMPONENTS_WITH_RUNNERS_WITHOUT_MISTRAL_RUNNER ) ) ,$(component ) )
47
46
COMPONENTS_TEST_COMMA := $(subst $(slash ) ,$(dot ) ,$(subst $(space_char ) ,$(comma ) ,$(COMPONENTS_TEST ) ) )
48
47
COMPONENTS_TEST_MODULES := $(subst $(slash ) ,$(dot ) ,$(COMPONENTS_TEST_DIRS ) )
49
48
COMPONENTS_TEST_MODULES_COMMA := $(subst $(space_char ) ,$(comma ) ,$(COMPONENTS_TEST_MODULES ) )
50
49
51
- COVERAGE_GLOBS := .coverage.unit.* .coverage.integration.* .coverage.mistral.*
50
+ COVERAGE_GLOBS := .coverage.unit.* .coverage.integration.*
52
51
COVERAGE_GLOBS_QUOTED := $(foreach glob,$(COVERAGE_GLOBS ) ,'$(glob ) ')
53
52
54
53
REQUIREMENTS := test-requirements.txt requirements.txt
@@ -114,8 +113,6 @@ play:
114
113
@echo
115
114
@echo COMPONENTS_WITH_RUNNERS=$(COMPONENTS_WITH_RUNNERS )
116
115
@echo
117
- @echo COMPONENTS_WITH_RUNNERS_WITHOUT_MISTRAL_RUNNER=$(COMPONENTS_WITH_RUNNERS_WITHOUT_MISTRAL_RUNNER )
118
- @echo
119
116
@echo COMPONENTS_TEST=$(COMPONENTS_TEST )
120
117
@echo
121
118
@echo COMPONENTS_TEST_COMMA=$(COMPONENTS_TEST_COMMA )
@@ -126,8 +123,6 @@ play:
126
123
@echo
127
124
@echo COMPONENTS_TEST_MODULES_COMMA=$(COMPONENTS_TEST_MODULES_COMMA )
128
125
@echo
129
- @echo COMPONENTS_TEST_WITHOUT_MISTRAL_RUNNER=$(COMPONENTS_TEST_WITHOUT_MISTRAL_RUNNER )
130
- @echo
131
126
@echo COMPONENT_PYTHONPATH=$(COMPONENT_PYTHONPATH )
132
127
@echo
133
128
@echo TRAVIS_PULL_REQUEST=$(TRAVIS_PULL_REQUEST )
@@ -163,6 +158,18 @@ install-runners:
163
158
(. $( VIRTUALENV_DIR) /bin/activate; cd $$ component; python setup.py develop --no-deps); \
164
159
done
165
160
161
+ .PHONY : install-mock-runners
162
+ install-mock-runners :
163
+ @echo " "
164
+ @echo " ================== INSTALL MOCK RUNNERS ===================="
165
+ @echo " "
166
+ @for component in $(MOCK_RUNNERS ) ; do \
167
+ echo " ===========================================================" ; \
168
+ echo " Installing mock runner:" $$ component; \
169
+ echo " ===========================================================" ; \
170
+ (. $( VIRTUALENV_DIR) /bin/activate; cd $$ component; python setup.py develop --no-deps); \
171
+ done
172
+
166
173
.PHONY : check-requirements
167
174
.check-requirements :
168
175
@echo
@@ -455,16 +462,6 @@ compilepy3:
455
462
@mongo --eval " rs.initiate()"
456
463
@sleep 15
457
464
458
- .PHONY : .cleanmysql
459
- .cleanmysql :
460
- @echo " ==================== cleanmysql ===================="
461
- @echo " ----- Dropping all Mistral MYSQL databases -----"
462
- @mysql -uroot -pStackStorm -e " DROP DATABASE IF EXISTS mistral"
463
- @mysql -uroot -pStackStorm -e " CREATE DATABASE mistral"
464
- @mysql -uroot -pStackStorm -e " GRANT ALL PRIVILEGES ON mistral.* TO 'mistral'@'127.0.0.1' IDENTIFIED BY 'StackStorm'"
465
- @mysql -uroot -pStackStorm -e " FLUSH PRIVILEGES"
466
- @/opt/openstack/mistral/.venv/bin/python /opt/openstack/mistral/tools/sync_db.py --config-file /etc/mistral/mistral.conf
467
-
468
465
.PHONY : .cleanrabbitmq
469
466
.cleanrabbitmq :
470
467
@echo " ==================== cleanrabbitmq ===================="
@@ -479,7 +476,7 @@ compilepy3:
479
476
@echo " Removing all coverage results directories"
480
477
@echo
481
478
rm -rf .coverage $(COVERAGE_GLOBS ) \
482
- .coverage.unit .coverage.integration .coverage.mistral
479
+ .coverage.unit .coverage.integration
483
480
484
481
.PHONY : distclean
485
482
distclean : clean
@@ -524,7 +521,7 @@ distclean: clean
524
521
@echo "==========================================================="
525
522
526
523
.PHONY : requirements
527
- requirements : virtualenv .requirements .sdist-requirements install-runners
524
+ requirements : virtualenv .requirements .sdist-requirements install-runners install-mock-runners
528
525
@echo
529
526
@echo " ==================== requirements ===================="
530
527
@echo
@@ -669,7 +666,7 @@ endif
669
666
@echo
670
667
@echo " ----- Dropping st2-test db -----"
671
668
@mongo st2-test --eval " db.dropDatabase();"
672
- for component in $( COMPONENTS_TEST_WITHOUT_MISTRAL_RUNNER ) ; do\
669
+ for component in $( COMPONENTS_TEST ) ; do\
673
670
echo " ===========================================================" ; \
674
671
echo " Running tests in" $$ component; \
675
672
echo " -----------------------------------------------------------" ; \
@@ -820,43 +817,8 @@ endif
820
817
.PHONY : .itests-coverage-html
821
818
.itests-coverage-html : .integration-tests-coverage-html
822
819
823
- .PHONY : mistral-itests
824
- mistral-itests : requirements .mistral-itests
825
-
826
- .PHONY : .mistral-itests
827
- .mistral-itests :
828
- @echo
829
- @echo " ==================== MISTRAL integration tests ===================="
830
- @echo " The tests assume both st2 and mistral are running on 127.0.0.1."
831
- @echo
832
- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $(NOSE_OPTS ) -s -v st2tests/integration/mistral || exit 1;
833
-
834
- .PHONY : .run-mistral-itests-coverage
835
- ifdef INCLUDE_TESTS_IN_COVERAGE
836
- .run-mistral-itests-coverage : NOSE_COVERAGE_PACKAGES := $(NOSE_COVERAGE_PACKAGES ) ,st2tests.mistral.integration
837
- endif
838
- .run-mistral-itests-coverage :
839
- @echo
840
- @echo " ==================== MISTRAL integration tests with coverage ===================="
841
- @echo " The tests assume both st2 and mistral are running on 127.0.0.1."
842
- @echo
843
- . $(VIRTUALENV_DIR ) /bin/activate; \
844
- COVERAGE_FILE=.coverage.mistral.integration \
845
- nosetests $(NOSE_OPTS ) -s -v $(NOSE_COVERAGE_FLAGS ) \
846
- $(NOSE_COVERAGE_PACKAGES ) \
847
- st2tests/integration/mistral || exit 1;
848
-
849
- .coverage.mistral.integration :
850
- if [ ! -e .coverage.mistral.integration ]; then \
851
- make .run-mistral-itests-coverage; \
852
- fi
853
-
854
- .PHONY : .mistral-itests-coverage-html
855
- .mistral-itests-coverage-html : .coverage.mistral.integration
856
- . $(VIRTUALENV_DIR ) /bin/activate; COVERAGE_FILE=.coverage.mistral.integration coverage html
857
-
858
820
.PHONY : .coverage-combine
859
- .coverage-combine : .run-unit-tests-coverage .run-integration-tests-coverage .run-mistral-itests-coverage
821
+ .coverage-combine : .run-unit-tests-coverage .run-integration-tests-coverage
860
822
. $(VIRTUALENV_DIR ) /bin/activate; coverage combine $(COVERAGE_GLOBS )
861
823
862
824
# This is a real target, but we need to do our own make trickery in case some
@@ -998,7 +960,7 @@ debs:
998
960
999
961
1000
962
.PHONY : ci
1001
- ci : ci-checks ci-unit ci-integration ci-mistral ci- packs-tests
963
+ ci : ci-checks ci-unit ci-integration ci-packs-tests
1002
964
1003
965
.PHONY : ci-checks
1004
966
ci-checks : compile .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages
@@ -1073,15 +1035,6 @@ ci-py3-integration: requirements .ci-prepare-integration .ci-py3-integration
1073
1035
.PHONY : ci-unit
1074
1036
ci-unit : .unit-tests-coverage-html
1075
1037
1076
- .PHONY : ci-unit-nightly
1077
- ci-unit-nightly :
1078
- # NOTE: We run mistral runner checks only as part of a nightly build to speed up
1079
- # non nightly builds (Mistral will be deprecated in the future)
1080
- @echo
1081
- @echo " ============== ci-unit-nightly =============="
1082
- @echo
1083
- . $(VIRTUALENV_DIR ) /bin/activate; nosetests $(NOSE_OPTS ) -s -v contrib/runners/mistral_v2/tests/unit
1084
-
1085
1038
.PHONY : .ci-prepare-integration
1086
1039
.ci-prepare-integration :
1087
1040
sudo -E ./scripts/travis/prepare-integration.sh
@@ -1092,13 +1045,6 @@ ci-integration: .ci-prepare-integration .itests-coverage-html
1092
1045
.PHONY : ci-runners
1093
1046
ci-runners : .ci-prepare-integration .runners-itests-coverage-html
1094
1047
1095
- .PHONY : .ci-prepare-mistral
1096
- .ci-prepare-mistral :
1097
- sudo -E ./scripts/travis/setup-mistral.sh
1098
-
1099
- .PHONY : ci-mistral
1100
- ci-mistral : .ci-prepare-integration .ci-prepare-mistral .mistral-itests-coverage-html
1101
-
1102
1048
.PHONY : ci-orquesta
1103
1049
ci-orquesta : .ci-prepare-integration .orquesta-itests-coverage-html
1104
1050
0 commit comments