Skip to content

Commit 4ee64e0

Browse files
author
file_magic
committed
Merge branch 'mongo_upgrade' of github.com:nzlosh/st2
2 parents 3e8426e + aba09f3 commit 4ee64e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1593
-753
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
- name: 'Test (pants runs: pytest)'
3939
python-version-short: '3.9'
4040
python-version: '3.9.14'
41+
- name: 'Test (pants runs: pytest)'
42+
python-version-short: '3.10'
43+
python-version: '3.10.12'
4144

4245
services:
4346
mongo:

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Changed
2424
* Update st2client deps: editor and prompt-toolkit. #6189 (by @nzlosh)
2525
* Updated dependency oslo.config to prepare for python 3.10 support. #6193 (by @nzlosh)
2626

27+
* Support for Python3.8, Python3.9 and Python3.10. Update underlying modules and
28+
remove modules that weren't compatible with newer versions of Python. #6157
29+
2730
Added
2831
~~~~~
2932
* Continue introducing `pants <https://www.pantsbuild.org/docs>`_ to improve DX (Developer Experience)

Makefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ REQUIREMENTS := test-requirements.txt requirements.txt
5555

5656
# Pin common pip version here across all the targets
5757
# Note! Periodic maintenance pip upgrades are required to be up-to-date with the latest pip security fixes and updates
58+
# 202403: Use pip 24.0 which is the highest supported version across Python 3.8 - 3.10
5859
PIP_VERSION ?= 24.0
5960
SETUPTOOLS_VERSION ?= 69.5.1
6061
PIP_OPTIONS := $(ST2_PIP_OPTIONS)
@@ -73,6 +74,9 @@ endif
7374
# The minus in front of st2.st2common.bootstrap filters out logging statements from that module.
7475
# See https://nose.readthedocs.io/en/latest/usage.html#cmdoption-logging-filter
7576
NOSE_OPTS := --rednose --immediate --with-parallel --parallel-strategy=FILE --nocapture --logging-filter=-st2.st2common.bootstrap
77+
# https://github.com/pytest-dev/pytest-xdist/issues/71
78+
#PYTEST_OPTS := -n auto --tx 2*popen//execmodel=eventlet
79+
PYTEST_OPTS := ""
7680

7781
ifndef NOSE_TIME
7882
NOSE_TIME := yes
@@ -486,7 +490,7 @@ flake8: requirements .flake8
486490
. $(VIRTUALENV_DIR)/bin/activate; flake8 --config ./lint-configs/python/.flake8 pylint_plugins/
487491

488492
# Make task which verifies st2client README will parse pypi checks
489-
. PHONY: .st2client-pypi-check
493+
.PHONY: .st2client-pypi-check
490494
.st2client-pypi-check:
491495
@echo
492496
@echo "==================== st2client pypi check ===================="
@@ -824,8 +828,7 @@ unit-tests: requirements .unit-tests
824828
echo "Running tests in" $$component; \
825829
echo "-----------------------------------------------------------"; \
826830
. $(VIRTUALENV_DIR)/bin/activate; \
827-
nosetests $(NOSE_OPTS) -s -v \
828-
$$component/tests/unit || ((failed+=1)); \
831+
pytest --capture=no --verbose $$component/tests/unit || exit 1; \
829832
echo "-----------------------------------------------------------"; \
830833
echo "Done running tests in" $$component; \
831834
echo "==========================================================="; \
@@ -849,9 +852,8 @@ endif
849852
echo "-----------------------------------------------------------"; \
850853
. $(VIRTUALENV_DIR)/bin/activate; \
851854
COVERAGE_FILE=.coverage.unit.$$(echo $$component | tr '/' '.') \
852-
nosetests $(NOSE_OPTS) -s -v $(NOSE_COVERAGE_FLAGS) \
853-
$(NOSE_COVERAGE_PACKAGES) \
854-
$$component/tests/unit || ((failed+=1)); \
855+
pytest --capture=no --verbose $(PYTEST_OPTS) --cov=$$component --cov-branch \
856+
$$component/tests/unit || exit 1; \
855857
echo "-----------------------------------------------------------"; \
856858
echo "Done running tests in" $$component; \
857859
echo "==========================================================="; \
@@ -907,8 +909,8 @@ itests: requirements .itests
907909
echo "Running integration tests in" $$component; \
908910
echo "-----------------------------------------------------------"; \
909911
. $(VIRTUALENV_DIR)/bin/activate; \
910-
nosetests $(NOSE_OPTS) -s -v \
911-
$$component/tests/integration || ((failed+=1)); \
912+
pytest --capture=no --verbose $(PYTEST_OPTS) \
913+
$$component/tests/integration || exit 1; \
912914
echo "-----------------------------------------------------------"; \
913915
echo "Done running integration tests in" $$component; \
914916
echo "==========================================================="; \
@@ -932,9 +934,8 @@ endif
932934
echo "-----------------------------------------------------------"; \
933935
. $(VIRTUALENV_DIR)/bin/activate; \
934936
COVERAGE_FILE=.coverage.integration.$$(echo $$component | tr '/' '.') \
935-
nosetests $(NOSE_OPTS) -s -v $(NOSE_COVERAGE_FLAGS) \
936-
$(NOSE_COVERAGE_PACKAGES) \
937-
$$component/tests/integration || ((failed+=1)); \
937+
pytest --capture=no --verbose $(PYTEST_OPTS) --cov=$$component --cov-branch \
938+
$$component/tests/integration || exit 1; \
938939
echo "-----------------------------------------------------------"; \
939940
echo "Done integration running tests in" $$component; \
940941
echo "==========================================================="; \
@@ -1032,16 +1033,15 @@ orquesta-itests: requirements .orquesta-itests
10321033
@echo "==================== Orquesta integration tests ===================="
10331034
@echo "The tests assume st2 is running on 127.0.0.1."
10341035
@echo
1035-
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v st2tests/integration/orquesta || exit 1;
1036+
. $(VIRTUALENV_DIR)/bin/activate; pytest --capture=no --verbose $(PYTEST_OPTS) st2tests/integration/orquesta || exit 1;
10361037

10371038
.PHONY: .orquesta-itests-coverage-html
10381039
.orquesta-itests-coverage-html:
10391040
@echo
10401041
@echo "==================== Orquesta integration tests with coverage (HTML reports) ===================="
10411042
@echo "The tests assume st2 is running on 127.0.0.1."
10421043
@echo
1043-
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v --with-coverage \
1044-
--cover-inclusive --cover-html st2tests/integration/orquesta || exit 1;
1044+
. $(VIRTUALENV_DIR)/bin/activate; pytest --capture=no --verbose $(PYTEST_OPTS) --cov=orquesta --cov-branch st2tests/integration/orquesta || exit 1;
10451045

10461046
.PHONY: packs-tests
10471047
packs-tests: requirements .packs-tests
@@ -1071,7 +1071,7 @@ runners-tests: requirements .runners-tests
10711071
echo "==========================================================="; \
10721072
echo "Running tests in" $$component; \
10731073
echo "==========================================================="; \
1074-
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v $$component/tests/unit || ((failed+=1)); \
1074+
. $(VIRTUALENV_DIR)/bin/activate; pytest --capture=no --verbose $(PYTEST_OPTS) $$component/tests/unit || exit 1; \
10751075
done; \
10761076
if [ $$failed -gt 0 ]; then exit 1; fi
10771077

@@ -1089,7 +1089,7 @@ runners-itests: requirements .runners-itests
10891089
echo "==========================================================="; \
10901090
echo "Running integration tests in" $$component; \
10911091
echo "==========================================================="; \
1092-
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v $$component/tests/integration || ((failed+=1)); \
1092+
. $(VIRTUALENV_DIR)/bin/activate; pytest --capture=no --verbose $(PYTEST_OPTS) $$component/tests/integration || exit 1; \
10931093
done; \
10941094
if [ $$failed -gt 0 ]; then exit 1; fi
10951095

@@ -1104,8 +1104,8 @@ runners-itests: requirements .runners-itests
11041104
echo "==========================================================="; \
11051105
echo "Running integration tests in" $$component; \
11061106
echo "==========================================================="; \
1107-
. $(VIRTUALENV_DIR)/bin/activate; nosetests $(NOSE_OPTS) -s -v --with-coverage \
1108-
--cover-inclusive --cover-html $$component/tests/integration || ((failed+=1)); \
1107+
. $(VIRTUALENV_DIR)/bin/activate; pytest --capture=no --verbose $(PYTEST_OPTS) --cov=$$component --cov-report=html \
1108+
$$component/tests/integration || exit 1; \
11091109
done; \
11101110
if [ $$failed -gt 0 ]; then exit 1; fi
11111111

contrib/examples/actions/ubuntu_pkg_info/ubuntu_pkg_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright 2020 The StackStorm Authors.
2+
# Copyright 2020-2024 The StackStorm Authors.
33
# Copyright 2019 Extreme Networks, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");

contrib/packs/actions/pack_mgmt/get_pack_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 The StackStorm Authors.
1+
# Copyright 2020-2024 The StackStorm Authors.
22
# Copyright 2019 Extreme Networks, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");

contrib/runners/local_runner/tests/unit/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ __defaults__(
22
{(python_test, python_tests): dict(tags=["unit"])},
33
extend=True,
44
)
5+
6+
python_tests(
7+
name="tests",
8+
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2024 The StackStorm Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import pytest
16+
17+
18+
@pytest.mark.skip(reason="TEST TO BE IMPLEMENTED.")
19+
def test_todo():
20+
pass
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
orquesta@ git+https://github.com/StackStorm/[email protected]
1+
#orquesta@ git+https://github.com/StackStorm/[email protected]
2+
orquesta@ git+https://github.com/nzlosh/orquesta.git@st2v39_compat

contrib/runners/orquesta_runner/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# If you want to update depdencies for a single component, modify the
66
# in-requirements.txt for that component and then run 'make requirements' to
77
# update the component requirements.txt
8-
orquesta@ git+https://github.com/StackStorm/orquesta.git@v1.6.0
8+
orquesta@ git+https://github.com/nzlosh/orquesta.git@st2v39_compat

contrib/runners/remote_runner/tests/unit/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ __defaults__(
22
{(python_test, python_tests): dict(tags=["unit"])},
33
extend=True,
44
)
5+
6+
python_tests(
7+
name="tests",
8+
)

0 commit comments

Comments
 (0)