Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
815b088
Replace nose with pytest
nzlosh Mar 12, 2024
46c7380
switch nosetest to pytest
nzlosh Mar 12, 2024
af863b3
Replace nosetest with pytest (without concurrency)
nzlosh Mar 12, 2024
7f6b1bc
Use pytest.raises instead of assertRaisesRegex
nzlosh Mar 13, 2024
1b1cb45
Use pytest.mark.skipif
nzlosh Mar 14, 2024
6fdaea3
Remove nose from requirements
nzlosh Mar 21, 2024
a6a8c90
remove nose from test requirements
nzlosh Mar 26, 2024
49112d3
drop extra space in Makefile
nzlosh Apr 8, 2024
af2cacd
Adjust pytest args
FileMagic Aug 13, 2024
227742b
Use pytest.mark.skipif instead of unittest.skipIf
FileMagic Aug 25, 2024
4f0881d
fix pytest cov
guzzijones Sep 10, 2024
c096f8a
lint fixes
guzzijones Sep 10, 2024
c80fc2e
pytest changes:
guzzijones Sep 10, 2024
7ceb204
add reason to skip
guzzijones Sep 11, 2024
4345a58
add reason for pytest
guzzijones Sep 11, 2024
c691cf1
add reason
guzzijones Sep 11, 2024
d356a75
attempt to change st2-run-packs-test with pytest instead of nose
guzzijones Sep 11, 2024
f1b5de2
fix st2-pack-test
guzzijones Sep 11, 2024
38a75a9
change to pytest args for st2runpackstests
guzzijones Sep 11, 2024
6ba7fdb
st2 run packs changes
guzzijones Sep 11, 2024
b64d0f5
add reason to pytest
guzzijones Sep 11, 2024
a91c200
copy pytest pin from lockfiles/st2.lock and remove duplicates in test…
cognifloyd Dec 18, 2024
d5d1199
Regenerate lockfiles/st2.lock to remove nose
cognifloyd Dec 18, 2024
595bbc4
Copy pinned versions from lockfiles/st2.lock to reqs files
cognifloyd Dec 18, 2024
6e71584
Bump pytest version in st2-run-pack-tests
cognifloyd Dec 18, 2024
514655d
Drop nosetest config files
cognifloyd Dec 18, 2024
0aa6696
Switch from nose-parallel to pytest-shard
cognifloyd Dec 18, 2024
ba461d7
Add reason= to pytest.mark.skipif
cognifloyd Dec 18, 2024
6c22de2
Add pack shared lib dir support to st2-run-pack-tests
cognifloyd Dec 18, 2024
7c44835
Makefile debug
cognifloyd Dec 18, 2024
c4522a3
Use pytest-custom_exit_code to pass when no tests are found
cognifloyd Dec 18, 2024
36f208b
Improve Makefile debug output
cognifloyd Dec 18, 2024
760f6cb
add changelog entry
cognifloyd Dec 19, 2024
da9e48d
Drop st2-run-pack-tests debug output
cognifloyd Dec 19, 2024
67bb6a2
CircleCI: Try updating PIP_VERSION in st2-packages on the fly
cognifloyd Dec 19, 2024
50c1776
CircleCI: Fix wheelhouse build failure on ubuntu focal
cognifloyd Dec 19, 2024
aa6e1d2
use pytest-test-groups over pytest-shard
cognifloyd Dec 19, 2024
332edcf
Inline pytest-test-groups to prepare to modify it
cognifloyd Dec 19, 2024
784dc7f
Use file path to calculate group instead of test id
cognifloyd Dec 19, 2024
79752cb
fmt with black
cognifloyd Dec 19, 2024
4201a33
Better bail out if pytest args not provided
cognifloyd Dec 19, 2024
c4dc652
test-group is now 0-based
cognifloyd Dec 19, 2024
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
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ jobs:
name: Download st2-packages repository
command: |
set -x
PIP_VERSION=$(grep ^PIP_VERSION Makefile)
git clone ${ST2_PACKAGES_REPO} ~/st2-packages
cd ~/st2-packages
git checkout ${CIRCLE_BRANCH} || true
sed -i -e "s/^PIP_VERSION .*$/${PIP_VERSION}/" packages/st2/debian/rules
- run:
name: Initialize packages Build Environment
command: |
Expand Down
43 changes: 16 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,34 +258,29 @@ jobs:
include:
- name: 'Unit Tests (chunk 1)'
task: 'ci-unit'
nosetests_node_total: 2
nosetests_node_index: 0
shard: {k: 0, n: 2}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Unit Tests (chunk 2)'
task: 'ci-unit'
nosetests_node_total: 2
nosetests_node_index: 1
shard: {k: 1, n: 2}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Unit Tests (chunk 1)'
task: 'ci-unit'
nosetests_node_total: 2
nosetests_node_index: 0
shard: {k: 0, n: 2}
python-version-short: '3.9'
python-version: '3.9.14'
- name: 'Unit Tests (chunk 2)'
task: 'ci-unit'
nosetests_node_total: 2
nosetests_node_index: 1
shard: {k: 1, n: 2}
python-version-short: '3.9'
python-version: '3.9.14'
# This job is slow so we only run in on a daily basis
# - name: 'Micro Benchmarks'
# task: 'micro-benchmarks'
# python-version: '3.6.13'
# nosetests_node_total: 1
# nosetests_node_ index: 0
# shard: {k: 0, n: 1}
services:
mongo:
image: mongo:7.0
Expand Down Expand Up @@ -317,8 +312,8 @@ jobs:
env:
TASK: '${{ matrix.task }}'
PYTHON_VERSION_SHORT: '${{ matrix.python-version-short }}'
NODE_TOTAL: '${{ matrix.nosetests_node_total }}'
NODE_INDEX: '${{ matrix.nosetests_node_index }}'
NODE_TOTAL: '${{ matrix.shard.n }}'
NODE_INDEX: '${{ matrix.shard.k }}'

# We need to explicitly specify terminal width otherwise some CLI tests fail on container
# environments where small terminal size is used.
Expand Down Expand Up @@ -417,38 +412,32 @@ jobs:
# up (aka stanley user being present, etc.)
- name: 'Pack Tests'
task: 'ci-packs-tests'
nosetests_node_total: 1
nosetests_node_index: 0
shard: {k: 0, n: 1}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Integration Tests (chunk 1)'
task: 'ci-integration'
nosetests_node_total: 2
nosetests_node_index: 0
shard: {k: 0, n: 2}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Integration Tests (chunk 2)'
task: 'ci-integration'
nosetests_node_total: 2
nosetests_node_index: 1
shard: {k: 1, n: 2}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Pack Tests'
task: 'ci-packs-tests'
nosetests_node_total: 1
nosetests_node_index: 0
shard: {k: 0, n: 1}
python-version-short: '3.9'
python-version: '3.9.14'
- name: 'Integration Tests (chunk 1)'
task: 'ci-integration'
nosetests_node_total: 2
nosetests_node_index: 0
shard: {k: 0, n: 2}
python-version-short: '3.9'
python-version: '3.9.14'
- name: 'Integration Tests (chunk 2)'
task: 'ci-integration'
nosetests_node_total: 2
nosetests_node_index: 1
shard: {k: 1, n: 2}
python-version-short: '3.9'
python-version: '3.9.14'
services:
Expand Down Expand Up @@ -504,8 +493,8 @@ jobs:
env:
TASK: '${{ matrix.task }}'
PYTHON_VERSION_SHORT: '${{ matrix.python-version-short }}'
NODE_TOTAL: '${{ matrix.nosetests_node_total }}'
NODE_INDEX: '${{ matrix.nosetests_node_index }}'
NODE_TOTAL: '${{ matrix.shard.n }}'
NODE_INDEX: '${{ matrix.shard.k }}'

# We need to explicitly specify terminal width otherwise some CLI tests fail on container
# environments where small terminal size is used.
Expand Down Expand Up @@ -591,7 +580,7 @@ jobs:
if: ${{ failure() && env.TASK == 'ci-integration' }}
uses: actions/upload-artifact@v4
with:
name: logs-py${{ matrix.python-version }}-nose-${{ matrix.nosetests_node_index }}
name: logs-py${{ matrix.python-version }}-pytest-${{ matrix.shard.k }}
path: logs.tar.gz
retention-days: 7

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/microbenchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ jobs:
include:
- name: 'Microbenchmarks'
task: 'micro-benchmarks'
nosetests_node_total: 1
nosetests_node_index: 0
shard: {k: 0, n: 1}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Microbenchmarks'
task: 'micro-benchmarks'
nosetests_node_total: 1
nosetests_node_index: 0
shard: {k: 0, n: 1}
python-version-short: '3.9'
python-version: '3.9.14'
services:
Expand All @@ -64,8 +62,8 @@ jobs:
env:
TASK: '${{ matrix.task }}'

NODE_TOTAL: '${{ matrix.nosetests_node_total }}'
NODE_INDEX: '${{ matrix.nosetests_node_index }}'
NODE_TOTAL: '${{ matrix.shard.n }}'
NODE_INDEX: '${{ matrix.shard.k }}'

COLUMNS: '120'
ST2_CI: 'true'
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/orquesta-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ jobs:
include:
- name: 'Integration Tests (Orquesta)'
task: 'ci-orquesta'
nosetests_node_total: 1
nosetests_node_index: 0
shard: {k: 0, n: 1}
python-version-short: '3.8'
python-version: '3.8.10'
- name: 'Integration Tests (Orquesta)'
task: 'ci-orquesta'
nosetests_node_total: 1
nosetests_node_index: 0
shard: {k: 0, n: 1}
python-version-short: '3.9'
python-version: '3.9.14'
services:
Expand Down Expand Up @@ -97,8 +95,8 @@ jobs:

env:
TASK: '${{ matrix.task }}'
NODE_TOTAL: '${{ matrix.nosetests_node_total }}'
NODE_INDEX: '${{ matrix.nosetests_node_index }}'
NODE_TOTAL: '${{ matrix.shard.n }}'
NODE_INDEX: '${{ matrix.shard.k }}'

# We need to explicitly specify terminal width otherwise some CLI tests fail on container
# environments where small terminal size is used.
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Changed
* Relaxed `dnspython` pinning for compatibility with python 3.10 and greater. #6265
Contributed by @nzlosh

* Switched tests from `nosetest` to `pytest`. `st2-run-pack-tests` also uses pytest.
So, all pack tests must be runnable by `pytest`, which may require migration. #6291
Contributed by @nzlosh, @FileMagic, @guzzijones, and @cognifloyd.

Added
~~~~~
* Continue introducing `pants <https://www.pantsbuild.org/docs>`_ to improve DX (Developer Experience)
Expand Down
Loading
Loading