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
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
flake8-lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
name: flake8 lint
steps:
- name: Setup python for flake8
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,31 @@ on:
jobs:
test:
name: test ${{ matrix.py }} - ${{ matrix.netapi }} - ${{ matrix.salt }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
py:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
netapi:
- "cherrypy"
- "tornado"
salt:
- "v3004.2"
- "v3005.1"
- "v3006.0"
- "v3006.9"
- "v3007.1"
- "master"
exclude:
- py: "3.10"
salt: "v3004.2"
- py: "3.10"
salt: "v3005.1"
- py: "3.8"
salt: "v3007.1"
- py: "3.9"
salt: "v3007.1"
- py: "3.8"
salt: "master"
- py: "3.9"
salt: "master"
steps:
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v4
Expand Down
19 changes: 14 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from __future__ import absolute_import, print_function, unicode_literals

# Import python libraries
import logging
Expand All @@ -9,19 +9,18 @@
import tempfile
import textwrap

# Import Salt Libraries
import salt.utils.yaml as yaml

# Import pytest libraries
import pytest

# Import Salt Libraries
import salt.utils.yaml as yaml
from pytestskipmarkers.utils import ports
from saltfactories.utils import random_string, running_username

# Import Pepper libraries
import pepper
import pepper.script


log = logging.getLogger(__name__)


Expand Down Expand Up @@ -240,6 +239,16 @@ def session_master_config_overrides(request, salt_api_port, salt_api_backend):
}


@pytest.helpers.register
def remove_stale_minion_key(master, minion_id):
"""Helper to remove a stale minion key."""
key_path = os.path.join(master.config["pki_dir"], "minions", minion_id)
if os.path.exists(key_path):
os.unlink(key_path)
else:
log.debug("The minion(id=%r) key was not found at %s", minion_id, key_path)


@pytest.fixture(scope='session')
def session_minion_factory(session_master_factory):
"""Return a factory for a randomly named minion connected to master."""
Expand Down
11 changes: 6 additions & 5 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ mock
pytest>=6.0.0
pytest-rerunfailures
pytest-cov
pytest-salt-factories==0.912.2
pytest-salt-factories==1.0.4
CherryPy
setuptools_scm
setuptools_scm==7.1.0
importlib-metadata<5.0.0
pyzmq<=20.0.0 ; python_version < "3.6"
pyzmq>=17.0.0 ; python_version < "3.9"
pyzmq>19.0.2 ; python_version >= "3.9"
pyzmq>=25.1.2 ; python_version < '3.13'
pyzmq>=26.2.0 ; python_version >= '3.13'
cryptography>=42.0.0; python_version < '3.13'
cryptography==42.0.2; python_version >= '3.13'
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[tox]
envlist = py{3.7,3.8,3.9}-{cherrypy,tornado}-{v3004.2,v3005.1,v3006.0,master},py{3.10}-{cherrypy,tornado}-{v3006.0,master},coverage,flake8
envlist = py{3.8,3.9}-{cherrypy,tornado}-{v3006.9,v3007.1},py{3.10,3.11}-{cherrypy,tornado}-{v3006.9,v3007.1,master},coverage,flake8
skip_missing_interpreters = true
skipsdist = false

[testenv]
passenv = TOXENV, CI, TRAVIS, TRAVIS_*, CODECOV_*
deps = -r{toxinidir}/tests/requirements.txt
v3004.2: salt==3004.2
v3004.2: jinja2<3.1
v3005.1: salt==3005.1
v3006.0: salt==3006.0
v3006.9: salt==3006.9
v3007.1: salt==3007.1
master: git+https://github.com/saltstack/salt.git@master#egg=salt

changedir = {toxinidir}
Expand Down Expand Up @@ -45,7 +43,7 @@ commands = codecov --file "{toxworkdir}/coverage.xml"

[testenv:http]
skip_install = True
basepython = python36
basepython = python39
deps =
changedir = {toxinidir}/htmlcov
commands = python -m http.server
Expand Down