ci: removed unnecessary slow marker (#67106)

This commit is contained in:
Agate 2022-07-07 10:48:44 +02:00
parent d3782c80f7
commit d5f16e620d
7 changed files with 2 additions and 51 deletions

4
Jenkinsfile vendored
View File

@ -18,10 +18,10 @@ PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockop
script {
if (currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause')) {
sh """
NUMPROCESSES=6 PYTESTOPTIONS=--slow \
NUMPROCESSES=6 \
PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off ${env.TMPDIR}/venv/bin/tox -rv"""
sh """
NUMPROCESSES=6 PYTESTOPTIONS=--slow \
NUMPROCESSES=6 \
PGPORT=`python3 -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off ${env.TMPDIR}/venv/bin/tox -rv -e py3-buster-rbac"""
if (env.JOB_NAME == 'authentic' && env.GIT_BRANCH == 'origin/main') {
sh """

View File

@ -42,29 +42,6 @@ from authentic2_idp_oidc.models import OIDCClient
from . import utils
def pytest_addoption(parser):
parser.addoption(
"--slow",
action="store_true",
help="run slow tests",
)
def pytest_configure(config):
# register an additional marker
config.addinivalue_line("markers", "slow: mark test as slow")
def pytest_runtest_setup(item):
markers = list(item.iter_markers(name='slow'))
slow = item.config.getoption('--slow')
if bool(markers) != bool(slow):
if not slow:
pytest.skip('slow tests must not run')
else:
pytest.skip('not slow tests must not run')
@pytest.fixture
def settings(settings, request):
# our post_migrate handlers depends upon some values of the settings (like

View File

@ -22,7 +22,6 @@ from django.db import connection
from authentic2.models import Attribute, AttributeValue
@pytest.mark.slow
def test_attribute_value_uniqueness(transactional_db, simple_user, concurrency, pytestconfig):
if pytestconfig.getoption('nomigrations'):
pytest.skip('running migrations is required for this test')

View File

@ -183,7 +183,6 @@ def test_manager_user_edit_by_uuid(app, superuser, simple_user):
assert simple_user.first_name.encode('utf-8') in resp.content
@pytest.mark.slow
def test_manager_stress_create_user(superuser_or_admin, app, mailoutbox):
new_ou = OU.objects.create(name='new ou', slug='new-ou')
url = reverse('a2-manager-user-add', kwargs={'ou_pk': new_ou.pk})

View File

@ -13,25 +13,3 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest
def pytest_addoption(parser):
parser.addoption(
"--slow",
action="store_true",
help="run slow tests",
)
def pytest_configure(config):
# register an additional marker
config.addinivalue_line("markers", "slow: mark test as slow")
def pytest_runtest_setup(item):
markers = list(item.iter_markers(name='slow'))
slow = item.config.getoption('--slow')
if markers and not slow:
pytest.skip('slow tests must not run')

View File

@ -146,7 +146,6 @@ SIZE = 1000
SPAN = 50
@pytest.mark.slow
def test_massive_role_parenting(db):
user = User.objects.create(username='user')
roles = []

View File

@ -41,7 +41,6 @@ setenv =
reusedb: REUSEDB=--reuse-db
# do "SW= tox ..." to disable --sw
SW={env:SW:{tty:--sw:}}
slow: PYTESTOPTIONS={env:PYTESTOPTIONS:} --slow
passenv=
BRANCH_NAME
# support for pg_virtualenv