Skip to content
Closed
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
70 changes: 44 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# http://docs.travis-ci.com/user/workers/standard-infrastructure/
sudo: required
# NOTE: We use precise because tests finish faster than on Xenial
dist: precise
dist: xenial
language: python

branches:
Expand Down Expand Up @@ -32,10 +32,10 @@ matrix:
# job which also includes "make requirements" and other steps
# "make requirements" can take substantially lower if the cache is purged
# and this would cause too many intermediate failures / false positives
- env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=700
- env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=1400
python: 2.7
name: "Unit Tests (Python 2.7 MongoDB 3.4)"
#- env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=700
#- env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=1400
#python: 2.7
#name: "Unit Tests (Python 2.7 MongoDB 3.6)"
#addons:
Expand All @@ -49,38 +49,40 @@ matrix:
# - mongodb-org-server
# - mongodb-org-shell
# - git
- env: TASK=ci-integration CACHE_NAME=py2 COMMAND_THRESHOLD=700
- env: TASK=ci-integration CACHE_NAME=py2 COMMAND_THRESHOLD=1400
python: 2.7
name: "Integration Tests (Python 2.7)"
- env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py2 COMMAND_THRESHOLD=280
- env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py2 COMMAND_THRESHOLD=560
python: 2.7
name: "Lint Checks, Packs Tests (Python 2.7)"
- env: TASK="compilepy3 ci-py3-unit" CACHE_NAME=py3 COMMAND_THRESHOLD=680
- env: TASK="compilepy3 ci-py3-unit" CACHE_NAME=py3 COMMAND_THRESHOLD=1360
python: 3.6
name: "Unit Tests, Pack Tests (Python 3.6)"
- env: TASK="ci-py3-integration" CACHE_NAME=py3 COMMAND_THRESHOLD=310
- env: TASK="ci-py3-integration" CACHE_NAME=py3 COMMAND_THRESHOLD=620
python: 3.6
name: "Integration Tests (Python 3.6)"

addons:
apt:
sources:
- mongodb-upstart
- sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse'
key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc'
# NOTE: Precise repo doesn't contain Erlang 20.x, latest version is 19.x so we need to use RabbitMQ 3.7.6
#- sourceline: 'deb [arch=amd64] http://packages.erlang-solutions.com/ubuntu precise contrib'
# key_url: 'https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc'
#- sourceline: 'deb [arch=amd64] https://dl.bintray.com/rabbitmq/debian precise rabbitmq-server-v3.6.x'
# key_url: 'https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc'
- sourceline: 'ppa:git-core/ppa'
packages:
- mongodb-org-server
- mongodb-org-shell
- erlang
- rabbitmq-server
- git
- libffi-dev
# APT addon has been broken since 16.08.2019 and timing out on
# travis_apt_get_update step
#addons:
# apt:
# sources:
# - mongodb-upstart
# - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse'
# key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc'
# # NOTE: Precise repo doesn't contain Erlang 20.x, latest version is 19.x so we need to use RabbitMQ 3.7.6
# #- sourceline: 'deb [arch=amd64] http://packages.erlang-solutions.com/ubuntu precise contrib'
# # key_url: 'https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc'
# #- sourceline: 'deb [arch=amd64] https://dl.bintray.com/rabbitmq/debian precise rabbitmq-server-v3.6.x'
# # key_url: 'https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc'
# - sourceline: 'ppa:git-core/ppa'
# packages:
# - mongodb-org-server
# - mongodb-org-shell
# - erlang
# - rabbitmq-server
# - git
# - libffi-dev

cache:
pip: true
Expand All @@ -95,6 +97,22 @@ cache:
#- .tox/

before_install:
# Add MongoDB and git apt repos
- sudo apt-get install -y apt-transport-https
# NOTE: xenial already ships with git version which is recent enough for content_version functionality
# - sudo add-apt-repository -y ppa:git-core/ppa
# - sudo apt-get install -y git
- curl https://www.mongodb.org/static/pgp/server-3.4.asc | sudo apt-key add -
- echo "deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee -a /etc/apt/sources.list
# Work around for Travis timeout issues and apt-get getting stuck on waiting for headers, see:
# https://github.com/travis-ci/travis-ci/issues/9112
- sudo apt-get clean
- sudo mv /var/lib/apt/lists /var/lib/apt/lists.old
- sudo mkdir -p /var/lib/apt/lists/partial
- sudo apt-get clean
- sudo apt-get update --option Acquire::ForceIPv4=true --option Acquire::Retries=100 --option Acquire::http::Timeout="60"
# Install MongoDB 3.4, RabbitMQ and latest version of git
- sudo apt-get install mongodb-org-server mongodb-org-shell erlang rabbitmq-server libffi-dev -y
- pip install --upgrade "pip>=19.0,<20.0"
- sudo pip install --upgrade "virtualenv==16.6.0"

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ endif
@echo
. $(VIRTUALENV_DIR)/bin/activate; \
COVERAGE_FILE=.coverage.integration.orquesta \
nosetests $(NOSE_OPTS) -s -v \
nosetests $(NOSE_OPTS) -s -v --exe \
$(NOSE_COVERAGE_FLAGS) $(NOSE_COVERAGE_PACKAGES) st2tests/integration/orquesta || exit 1; \


Expand Down Expand Up @@ -940,7 +940,7 @@ ci: ci-checks ci-unit ci-integration ci-mistral ci-packs-tests
ci-checks: compile .generated-files-check .pylint .flake8 check-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages

.PHONY: ci-py3-unit
ci-py3-unit:
ci-py3-unit: .ci-travis-permissions-workaround
@echo
@echo "==================== ci-py3-unit ===================="
@echo
Expand Down Expand Up @@ -1005,6 +1005,10 @@ ci-unit-nightly:
.ci-prepare-integration:
sudo -E ./scripts/travis/prepare-integration.sh

.PHONE: .ci-travis-permissions-workaround
.ci-travis-permissions-workaround:
sudo -E ./scripts/travis/permissions-workaround.sh

.PHONY: ci-integration
ci-integration: .ci-prepare-integration .itests-coverage-html

Expand All @@ -1022,4 +1026,4 @@ ci-mistral: .ci-prepare-integration .ci-prepare-mistral .mistral-itests-coverage
ci-orquesta: .ci-prepare-integration .orquesta-itests-coverage-html

.PHONY: ci-packs-tests
ci-packs-tests: .packs-tests
ci-packs-tests: .ci-travis-permissions-workaround .packs-tests
6 changes: 5 additions & 1 deletion contrib/core/tests/test_action_sendmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ def test_sendmail_default_text_html_content_type(self):
'This message was generated by StackStorm action '
'send_mail running on %s' % (HOSTNAME))

status, _, email_data, message = self._run_action(action_parameters=action_parameters)
status, result, email_data, message = self._run_action(action_parameters=action_parameters)
print(status)
print(result)
print(email_data)
print(message)
self.assertEquals(status, action_constants.LIVEACTION_STATUS_SUCCEEDED)

# Verify subject contains utf-8 charset and is base64 encoded
Expand Down
19 changes: 19 additions & 0 deletions scripts/travis/permissions-workaround.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e

if [ "$(whoami)" != 'root' ]; then
echo 'Please run with sudo'
exit 2
fi

UBUNTU_VERSION=`lsb_release -a 2>&1 | grep Codename | grep -v "LSB" | awk '{print $2}'`

# Workaround for Travis on Ubuntu Xenial so local runner integration tests work
# when executing them under user "stanley" (by default Travis checks out the
# code and runs tests under a different system user).
# NOTE: We need to pass "--exe" flag to nosetests when using this workaround.
if [ "${UBUNTU_VERSION}" == "xenial" ]; then
echo "Applying workaround for stanley user permissions issue to /home/travis on Xenial"
chmod 777 -R /home/travis
fi
3 changes: 2 additions & 1 deletion st2common/st2common/transport/bootstrap_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def _do_register_exchange(exchange, connection, channel, retry_wrapper):
kwargs = {
'exchange': exchange.name,
'type': exchange.type,
'durable': exchange.durable,
'durable': False,
'delivery_mode': 1, # transient
'auto_delete': exchange.auto_delete,
'arguments': exchange.arguments,
'nowait': False,
Expand Down
40 changes: 20 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ deps = virtualenv
-e{toxinidir}/st2client
-e{toxinidir}/st2common
commands =
nosetests --rednose --immediate -sv st2actions/tests/unit/
nosetests --rednose --immediate -sv st2auth/tests/unit/
nosetests --rednose --immediate -sv st2api/tests/unit/controllers/v1/
nosetests --rednose --immediate -sv st2api/tests/unit/controllers/exp/
nosetests --rednose --immediate -sv st2common/tests/unit/
nosetests --rednose --immediate -sv st2client/tests/unit/
nosetests --rednose --immediate -sv st2debug/tests/unit/
nosetests --rednose --immediate -sv st2exporter/tests/unit/
nosetests --rednose --immediate -sv st2reactor/tests/unit/
nosetests --rednose --immediate -sv st2stream/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/action_chain_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/inquirer_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/announcement_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/http_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/noop_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/local_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/orquesta_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/python_runner/tests/unit/
nosetests --rednose --immediate -sv contrib/runners/winrm_runner/tests/unit/
nosetests --rednose --immediate -sv --exe st2actions/tests/unit/
nosetests --rednose --immediate -sv --exe st2auth/tests/unit/
nosetests --rednose --immediate -sv --exe st2api/tests/unit/controllers/v1/
nosetests --rednose --immediate -sv --exe st2api/tests/unit/controllers/exp/
nosetests --rednose --immediate -sv --exe st2common/tests/unit/
nosetests --rednose --immediate -sv --exe st2client/tests/unit/
nosetests --rednose --immediate -sv --exe st2debug/tests/unit/
nosetests --rednose --immediate -sv --exe st2exporter/tests/unit/
nosetests --rednose --immediate -sv --exe st2reactor/tests/unit/
nosetests --rednose --immediate -sv --exe st2stream/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/action_chain_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/inquirer_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/announcement_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/http_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/noop_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/local_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/orquesta_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/python_runner/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/winrm_runner/tests/unit/

[testenv:py36-unit-nightly]
basepython = python3.6
Expand All @@ -61,7 +61,7 @@ deps = virtualenv
-e{toxinidir}/st2client
-e{toxinidir}/st2common
commands =
nosetests --rednose --immediate -sv contrib/runners/mistral_v2/tests/unit/
nosetests --rednose --immediate -sv --exe contrib/runners/mistral_v2/tests/unit/

[testenv:py36-packs]
basepython = python3.6
Expand Down