Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion contrib/runners/orquesta_runner/in-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git+https://github.com/StackStorm/orquesta.git@224c1a589a6007eb0598a62ee99d674e7836d369#egg=orquesta
git+https://github.com/StackStorm/orquesta.git@e6ebbbeb2c661486067e659dc7552f0a986603a6#egg=orquesta
2 changes: 1 addition & 1 deletion contrib/runners/orquesta_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion st2common/in-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion st2common/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions st2tests/integration/orquesta/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
7 changes: 7 additions & 0 deletions st2tests/integration/orquesta/test_wiring_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from __future__ import absolute_import

import eventlet
from integration.orquesta import base

from st2common.constants import action as ac_const
Expand Down Expand Up @@ -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)

Expand Down