Development #70155
tox, supprimer l'option --sw de pytest
0%
Description
C'est une option pour rejouer les tests à partir du dernier test planté.
C'est pénible et c'est la seule brique où il y a ça, je ne fais pas l'historique mais il y a déjà eu plein de messages jabber de gens qui ne comprennent pas pourquoi tous les tests ne s’exécutent pas par défaut.
Dans l'historique on trouve il y a 6 mois
commit c50f98828663a78d9815a83e742db0571d58ff42 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed May 11 21:31:37 2022 +0200 tox.ini: simplify disabling of --sw diff --git a/tox.ini b/tox.ini @@ -39 +39,2 @@ setenv = - !nosw: SW={tty:--sw:} +# do "SW= tox ..." to disable --sw + SW={env:SW:{tty:--sw:}}
sans référence à un ticket donc, et ce commentaire ne m'aide en rien à comprendre comment désactiver ce truc (perso rm -rf /tmp/tox-vdeniaud/ est toujours le plus rapide même si ça fait perdre 10 secondes à la prochaine exécution).
En tout cas ça devrait être l'inverse, désactivé par défaut, un truc « simplify » pour l'activer (et tant qu'à faire, utiliser la forme longue --stepwise pour moins d'obscurité).
Fichiers
Révisions associées
Historique
Mis à jour par Benjamin Dauvergne il y a plus d'un an
SW= tox ...
tu peux le mettre dans ton .bashrc.
Mis à jour par Valentin Deniaud il y a plus d'un an
Benjamin Dauvergne a écrit :
SW= tox ...
tu peux le mettre dans ton .bashrc.
On en apprend tout les jours sur la syntaxe de bash.
Et tout de même, inverser cette logique pour que le comportement par défaut de tox soit le même partout, ça serait pas chouette ?
Mis à jour par Benjamin Dauvergne il y a plus d'un an
- Statut changé de Nouveau à Rejeté
Valentin Deniaud a écrit :
Benjamin Dauvergne a écrit :
SW= tox ...
tu peux le mettre dans ton .bashrc.On en apprend tout les jours sur la syntaxe de bash.
T'as le choix:
alias tox="SW= tox"
ou
export SW=
Mis à jour par Emmanuel Cazenave il y a plus d'un an
- Statut changé de Rejeté à Nouveau
Valentin Deniaud a écrit :
Et tout de même, inverser cette logique pour que le comportement par défaut de tox soit le même partout, ça serait pas chouette ?
Thumbs up, les particularités on finit toujours par les oublier et à se prendre les pieds dedans.
Mis à jour par Benjamin Dauvergne il y a plus d'un an
Personne pour faire fonctionner le tox.ini de w.c.s. sur une machine vierge ?
PS: avec sitepackages=false comme partout.
Mis à jour par Emmanuel Cazenave il y a plus d'un an
Benjamin Dauvergne a écrit :
Personne pour faire fonctionner le tox.ini de w.c.s. sur une machine vierge ?
J'avais fait le taf pour y faire fonctionner le tox, tout à fait ok pour que quelqu'un fasse la deuxième partie "sur une machine vierge".
Mis à jour par Benjamin Dauvergne il y a plus d'un an
Y a ça aussi que j'aimerai dés-harmoniser :
wcs$ tox -e py3-django22 -- tests/test_wscall.py --pdb ... ERROR: --pdb is incompatible with distributing tests; try using -n0 or -nauto.
depuis --numprocesses on ne peut plus utiliser pdb :/
Mis à jour par Emmanuel Cazenave il y a plus d'un an
Ça marche en ajoutant -n 0 --dist no.
Mais oui je suis d'accord, c'est chiant d'avoir ça par défaut, ça serait mieux que Jenkins se débrouille pour passer les options xdist qui vont bien et qu'on soit tranquille en local.
Mis à jour par Benjamin Dauvergne il y a plus d'un an
Emmanuel Cazenave a écrit :
Benjamin Dauvergne a écrit :
Personne pour faire fonctionner le tox.ini de w.c.s. sur une machine vierge ?
J'avais fait le taf pour y faire fonctionner le tox, tout à fait ok pour que quelqu'un fasse la deuxième partie "sur une machine vierge".
Visiblement ça ne marche pas sur ma machine qui n'est pas particulièrement vierge et ou tous les autres tox.ini fonctionnent :
wcs$ tox -e py3-django22-codestyle-coverage GLOB sdist-make: /home/bdauvergne/wd/eo/wcs/setup.py py3-django22-codestyle-coverage create: /tmp/tox-bdauvergne/wcs/main/py3-django22-codestyle-coverage py3-django22-codestyle-coverage installdeps: pytest>=3.6, pytest-mock, pytest-cov, pytest-django, pytest-xdist, pytest-freezegun, WebTest, mechanize, gadjo, pyquery, mock, requests, responses, vobject, qrcode, Pillow, workalendar, python-magic, docutils, langdetect, git+https://git.entrouvert.org/debian/django-ckeditor.git, git+https://git.entrouvert.org/godo.js.git, django>=2.2,<2.3, django-ratelimit<3, pyproj, astroid!=2.5.7, pylint, Quixote>=3.0,<3.2, pre-commit, pyzbar, bleach py3-django22-codestyle-coverage inst: /tmp/tox-bdauvergne/wcs/main/.tmp/package/1/wcs-8.25.zip py3-django22-codestyle-coverage installed: aiodns==3.0.0,alabaster==0.7.12,ansible==6.4.0,ansible-core==2.13.4,apache-libcloud==3.4.1,apparmor==3.0.7,appdirs==1.4.4,argcomplete==2.0.0,argon2-cffi==21.1.0,asgiref==3.5.2,asn1crypto==1.5.1,astroid==2.12.11,asttokens==2.0.5,async-timeout==4.0.1,atomicwrites==1.4.0,attrs==22.1.0,Automat==20.2.0,Babel==2.8.0,backcall==0.2.0,bcrypt==3.2.0,beautifulsoup4==4.11.1,beniget==0.4.1,binaryornot==0.4.3,black==22.8.0,bleach==4.1.0,blinker==1.4,borgbackup==1.2.2,Bottleneck==1.3.2,breezy==3.2.2,Brlapi==0.8.4,Brotli==1.0.9,bugwarrior==1.8.0,bytecode==0.13.0,cached-property==1.5.2,cachetools==5.0.0,cairocffi==1.3.0,caldav==0.6.2,cbor2==5.4.3,certifi==2022.6.15,cffi==1.15.1,cfgv==3.3.1,chardet==4.0.0,charset-normalizer==2.0.6,chrome-gnome-shell==0.0.0,click==8.0.3,cmarkgfm==0.8.0,colorama==0.4.5,commonmark==0.9.1,configobj==5.0.6,consonance==0.1.5,constantly==15.1.0,convertdate==2.4.0,cookiecutter==1.7.3,coverage==6.2,cryptography==3.4.8,css-parser==1.0.7,cssselect==1.1.0,cssselect2==0.5.0,cupshelpers==1.0,cycler==0.11.0,dblatex==0.3.12,dbus-python==1.3.2,debugpy==1.6.2,decorator==5.1.1,defusedxml==0.7.1,Deprecated==1.2.13,devscripts==2.22.2,dh-virtualenv==1.2.2,dill==0.3.5.1,dissononce==0.34.3,distlib==0.3.6,distro==1.7.0,distro-info==1.1,Django==2.2.28,django-ckeditor @ git+https://git.entrouvert.org/debian/django-ckeditor.git@1de1a6a67b1b7c55545ea4261c2c6fbf072b14e6,django-filter==22.1,django-ratelimit==2.0.0,dnspython==2.2.1,docopt==0.6.2,docutils==0.17.1,dogpile.cache==1.1.8,dspawn==0.0,dulwich==0.20.46,elementpath==2.5.3,entrypoints==0.4,eobuilder==29.post3+g680bf08,et-xmlfile==1.0.1,evdev==1.6.0,execnet==1.9.0,executing==0.8.0,fabric==2.6.0,factur-x==1.8.1,fastbencode==0.0.12,fasteners==0.17.3,fastimport==0.9.14,fastjsonschema==2.15.1,feedgenerator==2.0.0,filelock==3.7.1,flake8==5.0.4,Flask==2.0.3,fonttools==4.37.1,freezegun==1.0.0,fs==2.4.16,future==0.18.2,gadjo==1.18,gajim==1.5.1,gast==0.5.2,gbp==0.9.28,Genshi==0.7.7,-e git+ssh://git@git.entrouvert.org/git-redmine@c02f7b08dddf99a2554fdf10b1ea69e993acc873#egg=git_redmine,gitdb==4.0.9,GitPython==3.1.27,GooCalendar==0.7.2,google-api-python-client==1.7.11,google-auth==1.5.1,google-auth-httplib2==0.1.0,google-auth-oauthlib==0.4.2,gpg==1.17.1,gprof2dot==2022.7.29,greenlet==1.1.2,gssapi==1.6.12,gunicorn==20.1.0,gyp==0.1,html2text==2020.1.16,html5lib==1.1,httpie==3.2.1,httpie-publik-auth==0.0,httplib2==0.20.4,hyperlink==21.0.0,identify==2.5.5,idna==3.3,ifaddr==0.1.7,imagesize==1.4.1,importlib-metadata==4.12.0,incremental==21.3.0,iniconfig==1.1.1,invoke==1.7.0,ipdb==0.13.9,ipykernel==6.15.3,ipython==8.4.0,ipython_genutils==0.2.0,ipywidgets==6.0.0,isodate==0.6.1,isort==5.6.4,itemadapter==0.7.0,itemloaders==1.0.6,itsdangerous==2.1.2,jaraco.classes==3.2.1,jdcal==1.0,jedi==0.18.0,jeepney==0.8.0,Jinja2==3.0.3,jinja2-time==0.2.0,jira==3.2.0,jmespath==1.0.1,jsonpointer==2.3,jsonschema==4.7.2,jupyter-client==7.3.4,jupyter-console==6.4.4,jupyter-core==4.11.1,jupyterlab-pygments==0.2.2,kaptan==0.5.12,kazam==1.4.5,keyring==23.9.3,keyrings.alt==4.2.0,kitchen==1.2.6,kiwisolver==1.3.2,langdetect==1.0.9,launchpadlib==1.10.16,lazr.restfulclient==0.14.4,lazr.uri==1.0.6,lazy-object-proxy==1.7.1,ldap3==2.9.1,LibAppArmor==3.0.7,libevdev==0.5,libtmux==0.10.1,llfuse==1.4.1,lmdb==1.3.0,lockfile==0.12.2,louis==3.23.0,lunardate==0.2.0,lxml==4.9.1,lz4==4.0.2+dfsg,Mako==1.2.2,Markdown==3.4.1,MarkupSafe==2.1.1,matplotlib==3.5.2,matplotlib-inline==0.1.6,mccabe==0.6.1,mechanize==0.4.8,mercurial==6.2.2,mkchromecast==0.3.9,mock==4.0.3,monotonic==1.6,more-itertools==8.10.0,mpmath==0.0.0,msgpack==1.0.3,multidict==5.1.0,mypy-extensions==0.4.3,nbclient==0.6.7,nbconvert==6.5.3,nbformat==5.5.0,nbxmpp==3.2.2,nest-asyncio==1.5.4,netaddr==0.8.0,netifaces==0.11.0,nodeenv==0.13.4,notebook==6.4.8,notify2==0.3,npm2deb==0.3.0,ntlm-auth==1.4.0,num2words==0.5.10,numexpr==2.8.3,numpy==1.21.5,oauth2client==4.1.3,oauthlib==3.2.1,odfpy==1.4.2,olefile==0.46,openpyxl==3.0.9,packaging==21.3,pandas==1.3.5,pandocfilters==1.5.0,paramiko==2.10.4,parsel==1.6.0,parso==0.8.1,pathspec==0.10.1,patiencediff==0.2.3,pbr==5.10.0,pdfrw==0.4,pelican==4.7.1,pexpect==4.8.0,phabricator==0.7.0,phonenumbers==8.12.1,pickleshare==0.7.5,Pillow==9.2.0,Pivy==0.6.7,pkginfo==1.8.2,platformdirs==2.5.2,pluggy==1.0.0+repack,ply==3.11,poetry-core==1.0.8,pre-commit==2.20.0,precis-i18n==1.0.2,prometheus-client==0.9.0,prompt-toolkit==3.0.31,Protego==0.2.1,protobuf==3.12.4,psutil==5.9.0,psycopg2==2.9.3,ptyprocess==0.7.0,pure-eval==0.0.0,py==1.10.0,py3dns==3.2.1,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycairo==1.20.1,pycares==4.1.2,PyChromecast==9.4.0,pycodestyle==2.9.1,pycparser==2.21,pycryptodomex==3.11.0,pycups==2.0.1,pycurl==7.45.1,pydevd==2.8.0+git20220826.8ee4065,PyDispatcher==2.0.5,pyflakes==2.5.0,PyGithub==1.55,Pygments==2.12.0,PyGObject==3.42.2,PyHamcrest==2.0.3,pyinotify==0.9.6,PyJWT==2.4.0,pykerberos==1.1.14,pylint==2.15.4,pyluach==2.0.1,PyMeeus==0.5.11,PyNaCl==1.5.0,pyOpenSSL==21.0.0,pypandoc==1.7.4,pyparsing==3.0.7,PyPDF4==1.27.0.1,pyphen==0.12.0,pyproj==3.4.0,PyQt5==5.15.7,PyQt5-sip==12.11.0,pyquery==1.4.3,pyrsistent==0.18.1,PySimpleSOAP==1.16.2,pysmbc==1.0.23,PySocks==1.7.1,pysodium==0.7.0.post0,PyStemmer==2.0.1,pytest==7.1.2,pytest-cov==4.0.0,pytest-django==4.5.2,pytest-forked==1.4.0,pytest-freezegun==0.4.2,pytest-mock==3.10.0,pytest-xdist==2.5.0,python-apt==2.3.0+b2,python-axolotl==0.2.3,python-axolotl-curve25519==0.4.1.post2,python-dateutil==2.8.1,python-debian==0.1.47,python-debianbts==3.2.3,python-dotenv==0.21.0,python-gitlab==3.5.0,python-ldap==3.4.2,python-magic==0.4.26,python-redmine==2.3.0,python-slugify==4.0.0,python-xapp==2.2.2,python-xlib==0.29,pythran==0.11.0,pytz==2022.2.1,pytz-deprecation-shim==0.1.0.post0,pyudev==0.22.0,pywinrm==0.3.0,pyxattr==0.7.2,pyxdg==0.27,PyYAML==5.4.1,pyzbar==0.1.9,pyzmq==22.3.0,qrcode==7.3.1,queuelib==1.6.2,Quixote==3.0,readme-renderer==37.1,recommonmark==0.7.1,regex==2021.11.10,reportbug==11.5.1,reportlab==3.6.11,requests==2.27.1,requests-file==1.5.1,requests-kerberos==0.12.0,requests-ntlm==1.1.0,requests-oauthlib==1.3.0,requests-toolbelt==0.9.1,resolvelib==0.8.1,responses==0.22.0,rfc3986==1.5.0,rfc3987==1.3.8,rich==12.4.4,roman==3.3,rsa==4.8,ruamel.yaml==0.17.16,ruamel.yaml.clib==0.2.6,scipy==1.8.1,scour==0.38.2,Scrapy==2.6.2,SecretStorage==3.3.3,selinux==3.4,Send2Trash==1.8.1b0,sentry-sdk==1.9.4,service-identity==18.1.0,setproctitle==1.3.1,simplejson==3.17.6,six==1.16.0,smmap==5.0.0,snowballstemmer==2.2.0,soupsieve==2.3.2,Sphinx==4.5.0,sphinx-markdown-tables==0.0.17,SQLAlchemy==1.4.31,sqlparse==0.4.2,stack-data==0.0.0,stevedore==4.0.0,supervisor==4.2.4,sympy==1.10.1,systemd-python==235,tables==3.7.0,tabulate==0.8.9,tasklib==2.4.3,taskw==2.0.0,terminado==0.15.0,testpath==0.6.0,textile==4.0.2,tinycss==0.4,tinycss2==1.1.1,tldextract==3.1.2,tmuxp==1.11.0,toml==0.10.2,tomli==2.0.1,tomlkit==0.11.5,tornado==6.2,tox==3.25.1,traitlets==5.4.0,transitions==0.8.11,tryton==6.0.18,twill==3.0.2,twine==4.0.1,Twisted==22.4.0,typed-ast==1.4.3,types-toml==0.10.8,typing_extensions==4.3.0,tzlocal==4.2,ufoLib2==0.13.1,unicodedata2==15.0.0,Unidecode==1.3.4,unidiff==0.7.3,uritemplate==4.1.1,urllib3==1.26.12,urwid==2.1.2,virtualenv==20.16.3+ds,virtualenv-clone==0.3.0,virtualenvwrapper==4.8.4,vit==2.2.0,vobject==0.9.6.1,w3lib==2.0.1,wadllib==1.3.6,waitress==2.1.2,wcs==8.25,wcwidth==0.2.5,WeasyPrint==0.42.3,webcolors==1.11.1,webencodings==0.5.1,WebOb==1.8.7,WebTest==3.0.0,Werkzeug==2.0.2,whichcraft==0.4.1,widgetsnbextension==2.0.0,workalendar==16.4.0,wrapt==1.14.1,xcffib==0.11.1,xdg==5,xlwt==1.3.0,xmlschema==1.10.0,xmltodict==0.13.0,XStatic==1.0.0,XStatic-Font-Awesome==4.7.0.0,XStatic-godo @ git+https://git.entrouvert.org/godo.js.git@c1c733757923b0c6461ce79fbfe0837f9f1bd911,XStatic-jQuery==3.5.1.1,XStatic-jquery-ui==1.13.0.1,XStatic-Leaflet==1.7.1.0,XStatic-Leaflet-GestureHandling==1.2.1.1,XStatic-OpenSans==1.0.0,XStatic-Select2==4.0.13.1,yamllint==1.26.3,youtube-dl==2021.12.17,yowsup==3.2.3,zeep==4.1.0,zeroconf==0.39.1,zim==0.74.3,zipp==1.0.0,zope.interface==5.4.0,zxcvbn==4.4.28 py3-django22-codestyle-coverage run-test-pre: PYTHONHASHSEED='0' py3-django22-codestyle-coverage run-test: commands[0] | py.test -v --cov-report xml --cov-report html --cov=wcs/ --cov-config .coveragerc -v --numprocesses=1 --dist loadfile --junitxml=junit-py3-django22-codestyle-coverage.xml tests/ WARNING: test command found but not installed in testenv cmd: /usr/bin/py.test env: /tmp/tox-bdauvergne/wcs/main/py3-django22-codestyle-coverage Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting. DEPRECATION WARNING: this will be an error in tox 4 and above! ImportError while loading conftest '/home/bdauvergne/wd/eo/wcs/tests/conftest.py'. tests/conftest.py:7: in <module> from wcs.forms.root import FormPage wcs/__init__.py:22: in <module> from . import monkeypatch # noqa isort: skip pylint: disable=wrong-import-position wcs/monkeypatch.py:23: in <module> import quixote E ModuleNotFoundError: No module named 'quixote' ERROR: InvocationError for command /usr/bin/py.test -v --cov-report xml --cov-report html --cov=wcs/ --cov-config .coveragerc -v --numprocesses=1 --dist loadfile --junitxml=junit-py3-django22-codestyle-coverage.xml tests/ (exited with code 4)
Mis à jour par Benjamin Dauvergne il y a plus d'un an
Emmanuel Cazenave a écrit :
Ça marche en ajoutant -n 0 --dist no.
Super, tout le monde peut ajouter SW=
alors.
Mis à jour par Emmanuel Cazenave il y a plus d'un an
Benjamin Dauvergne a écrit :
Super, tout le monde peut ajouter
SW=
alors.
Nivellement par le bas, #70164 pour prouver ma bonne foi.
Mis à jour par A. Berriot il y a plus d'un an
Benjamin Dauvergne a écrit :
Y a ça aussi que j'aimerai dés-harmoniser :
[...]
depuis --numprocesses on ne peut plus utiliser pdb :/
Emmanuel Cazenave a écrit :
Ça marche en ajoutant -n 0 --dist no.
Mais oui je suis d'accord, c'est chiant d'avoir ça par défaut, ça serait mieux que Jenkins se débrouille pour passer les options xdist qui vont bien et qu'on soit tranquille en local.
J'avais prévu une variable d'environnement NUMPROCESSES
(à 1 par défaut dans le tox.ini) pour ça, visiblement ça ne fonctionne pas ?
Mis à jour par Benjamin Dauvergne il y a plus d'un an
Il y a coverage aussi qui ralentit pas mal les tests en local si ça branche quelqu'un d'améliorer la vie des dévs.
PS: sur les autres briques, authentic n'a pas ce problème.
Mis à jour par Benjamin Dauvergne il y a plus d'un an
- Fichier 0001-tox.ini-remove-mandatory-sw-pytest-option-70155.patch 0001-tox.ini-remove-mandatory-sw-pytest-option-70155.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Valentin Deniaud il y a plus d'un an
- Statut changé de Solution proposée à Solution validée
Merci !
Mis à jour par Benjamin Dauvergne il y a plus d'un an
- Statut changé de Solution validée à Résolu (à déployer)
commit 8025072491ac37d985fcd6a1119b8dd77fbda8da Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed Oct 12 14:01:04 2022 +0200 tox.ini: remove mandatory --sw pytest option (#70155)
Mis à jour par Transition automatique il y a plus d'un an
- Statut changé de Résolu (à déployer) à Solution déployée
tox.ini: remove mandatory --sw pytest option (#70155)