diff --git a/Makefile b/Makefile index 08fec2c261..b7f4a3780a 100644 --- a/Makefile +++ b/Makefile @@ -665,6 +665,28 @@ endif echo "Done running tests in" $$component; \ echo "==========================================================="; \ done + @echo + @echo "============== runners integration tests with coverage ==============" + @echo + @echo "The tests assume st2 is running on 127.0.0.1." + @for component in $(COMPONENTS_RUNNERS); do\ + echo "==========================================================="; \ + echo "Running tests in" $$component; \ + echo "==========================================================="; \ + . $(VIRTUALENV_DIR)/bin/activate; \ + COVERAGE_FILE=.coverage.integration.$$(echo $$component | tr '/' '.') \ + nosetests $(NOSE_OPTS) -s -v \ + $(NOSE_COVERAGE_FLAGS) $(NOSE_COVERAGE_PACKAGES) $$component/tests/integration || exit 1; \ + done + @echo + @echo "==================== Orquesta integration tests with coverage (HTML reports) ====================" + @echo "The tests assume st2 is running on 127.0.0.1." + @echo + . $(VIRTUALENV_DIR)/bin/activate; \ + COVERAGE_FILE=.coverage.integration.orquesta \ + nosetests $(NOSE_OPTS) -s -v \ + $(NOSE_COVERAGE_FLAGS) $(NOSE_COVERAGE_PACKAGES) st2tests/integration/orquesta || exit 1; \ + .PHONY: .combine-integration-tests-coverage .combine-integration-tests-coverage: .run-integration-tests-coverage @@ -960,7 +982,7 @@ ci-unit: .unit-tests-coverage-html sudo -E ./scripts/travis/prepare-integration.sh .PHONY: ci-integration -ci-integration: .ci-prepare-integration .itests-coverage-html .runners-itests-coverage-html .orquesta-itests-coverage-html +ci-integration: .ci-prepare-integration .itests-coverage-html .PHONY: ci-runners ci-runners: .ci-prepare-integration .runners-itests-coverage-html diff --git a/contrib/runners/orquesta_runner/in-requirements.txt b/contrib/runners/orquesta_runner/in-requirements.txt index 1d23eba2d8..9ea1c723b6 100644 --- a/contrib/runners/orquesta_runner/in-requirements.txt +++ b/contrib/runners/orquesta_runner/in-requirements.txt @@ -1 +1 @@ -git+https://github.com/StackStorm/orquesta.git@224c1a589a6007eb0598a62ee99d674e7836d369#egg=orquesta +git+https://github.com/StackStorm/orquesta.git@e6ebbbeb2c661486067e659dc7552f0a986603a6#egg=orquesta diff --git a/contrib/runners/orquesta_runner/requirements.txt b/contrib/runners/orquesta_runner/requirements.txt index 882e3121e4..80f6ebf367 100644 --- a/contrib/runners/orquesta_runner/requirements.txt +++ b/contrib/runners/orquesta_runner/requirements.txt @@ -1,2 +1,2 @@ # Don't edit this file. It's generated automatically! -git+https://github.com/StackStorm/orquesta.git@224c1a589a6007eb0598a62ee99d674e7836d369#egg=orquesta +git+https://github.com/StackStorm/orquesta.git@e6ebbbeb2c661486067e659dc7552f0a986603a6#egg=orquesta diff --git a/requirements.txt b/requirements.txt index ee0714cdd8..fe7a5ba83c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ cryptography==2.6.1 eventlet==0.24.1 flex==6.14.0 git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper -git+https://github.com/StackStorm/orquesta.git@224c1a589a6007eb0598a62ee99d674e7836d369#egg=orquesta +git+https://github.com/StackStorm/orquesta.git@e6ebbbeb2c661486067e659dc7552f0a986603a6#egg=orquesta git+https://github.com/StackStorm/python-mistralclient.git#egg=python-mistralclient git+https://github.com/StackStorm/st2-auth-backend-flat-file.git@master#egg=st2-auth-backend-flat-file gitpython==2.1.11 diff --git a/st2common/in-requirements.txt b/st2common/in-requirements.txt index ed3b229110..eba34f6ea1 100644 --- a/st2common/in-requirements.txt +++ b/st2common/in-requirements.txt @@ -9,7 +9,7 @@ jsonschema kombu mongoengine networkx -git+https://github.com/StackStorm/orquesta.git@224c1a589a6007eb0598a62ee99d674e7836d369#egg=orquesta +git+https://github.com/StackStorm/orquesta.git@e6ebbbeb2c661486067e659dc7552f0a986603a6#egg=orquesta oslo.config paramiko pyyaml diff --git a/st2common/requirements.txt b/st2common/requirements.txt index 52c3ee54c3..2a69c90af4 100644 --- a/st2common/requirements.txt +++ b/st2common/requirements.txt @@ -4,7 +4,7 @@ apscheduler==3.6.0 cryptography==2.6.1 eventlet==0.24.1 flex==6.14.0 -git+https://github.com/StackStorm/orquesta.git@224c1a589a6007eb0598a62ee99d674e7836d369#egg=orquesta +git+https://github.com/StackStorm/orquesta.git@e6ebbbeb2c661486067e659dc7552f0a986603a6#egg=orquesta gitpython==2.1.11 greenlet==0.4.15 ipaddr diff --git a/st2tests/integration/orquesta/base.py b/st2tests/integration/orquesta/base.py index dcb4206260..a1f16dbb81 100644 --- a/st2tests/integration/orquesta/base.py +++ b/st2tests/integration/orquesta/base.py @@ -32,6 +32,9 @@ action_constants.LIVEACTION_STATUS_RUNNING ] +DEFAULT_WAIT_FIXED = 500 +DEFAULT_STOP_MAX_DELAY = 900000 + def retry_on_exceptions(exc): return isinstance(exc, AssertionError) @@ -84,7 +87,7 @@ def _execute_workflow(self, action, parameters=None, execute_async=True, @retrying.retry( retry_on_exception=retry_on_exceptions, - wait_fixed=3000, stop_max_delay=900000) + wait_fixed=DEFAULT_WAIT_FIXED, stop_max_delay=DEFAULT_STOP_MAX_DELAY) def _wait_for_state(self, ex, states): if isinstance(states, six.string_types): states = [states] @@ -113,7 +116,7 @@ def _get_children(self, ex): @retrying.retry( retry_on_exception=retry_on_exceptions, - wait_fixed=3000, stop_max_delay=900000) + wait_fixed=DEFAULT_WAIT_FIXED, stop_max_delay=DEFAULT_STOP_MAX_DELAY) def _wait_for_task(self, ex, task, status=None, num_task_exs=1): ex = self.st2client.executions.get_by_id(ex.id) @@ -149,7 +152,7 @@ def _wait_for_task(self, ex, task, status=None, num_task_exs=1): @retrying.retry( retry_on_exception=retry_on_exceptions, - wait_fixed=3000, stop_max_delay=900000) + wait_fixed=DEFAULT_WAIT_FIXED, stop_max_delay=DEFAULT_STOP_MAX_DELAY) def _wait_for_completion(self, ex): ex = self._wait_for_state(ex, action_constants.LIVEACTION_COMPLETED_STATES) diff --git a/st2tests/integration/orquesta/test_wiring_error_handling.py b/st2tests/integration/orquesta/test_wiring_error_handling.py index 7f70dad869..be49756b31 100644 --- a/st2tests/integration/orquesta/test_wiring_error_handling.py +++ b/st2tests/integration/orquesta/test_wiring_error_handling.py @@ -14,6 +14,7 @@ from __future__ import absolute_import +import eventlet from integration.orquesta import base from st2common.constants import action as ac_const @@ -244,6 +245,12 @@ def test_remediate_then_fail(self): ex = self._wait_for_completion(ex) # Assert that the log task is executed. + # NOTE: There is a race wheen execution gets in a desired state, but before the child + # tasks are written. To avoid that, we use longer sleep delay here. + # Better approach would be to try to retry a couple of times until expected num of + # tasks is reached (With some hard limit) before failing + eventlet.sleep(2) + self._wait_for_task(ex, 'task1', ac_const.LIVEACTION_STATUS_FAILED) self._wait_for_task(ex, 'log', ac_const.LIVEACTION_STATUS_SUCCEEDED)