Projet

Général

Profil

Bug #84940

erreur sur les vitest depuis la v1.1.0

Ajouté par Thomas Noël il y a 4 mois. Mis à jour il y a 4 mois.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
19 décembre 2023
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Suite au passage de vitest en v1.1.0 il y a deux heures, on a ces erreurs sur nos tests :

16:58:46  vitest cannot reuse: -r flag
16:58:46  vitest create: /tmp/tox-jenkins/passerelle/3080/vitest
16:58:46  [1304829] /tmp/tox-jenkins/passerelle/3080$ /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3 vitest >vitest/log/vitest-0.log
16:58:46  vitest installdeps: nodeenv
16:58:46  [1304838] /var/lib/jenkins/workspace/le_wip_84895-scrib-abstract-soap$ /bin/bash setup-vitest.sh nodeenv >../../../../../tmp/tox-jenkins/passerelle/3080/vitest/log/vitest-1.log
16:58:55  vitest develop-inst: /var/lib/jenkins/workspace/le_wip_84895-scrib-abstract-soap
16:58:55  write config to /tmp/tox-jenkins/passerelle/3080/vitest/.tox-config1 as '409276cb52787e20907912730020ca0f84204a375c30a79fcb494ffde0e0f116 /usr/bin/python3\n3.21.4 0 1 0\n00000000000000000000000000000000 nodeenv'
16:58:55  [1305019] /var/lib/jenkins/workspace/le_wip_84895-scrib-abstract-soap$ /bin/bash setup-vitest.sh -e . >../../../../../tmp/tox-jenkins/passerelle/3080/vitest/log/vitest-2.log
16:59:13  [1305459] /var/lib/jenkins/workspace/le_wip_84895-scrib-abstract-soap$ /tmp/tox-jenkins/passerelle/3080/vitest/bin/python -m pip freeze >../../../../../tmp/tox-jenkins/passerelle/3080/vitest/log/vitest-3.log
16:59:13  vitest installed: asgiref==3.7.2,attrs==23.1.0,bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cmislib-maykin==0.7.4,cryptography==41.0.7,defusedxml==0.7.1,Django==3.2.23,django-model-utils==4.2.0,elementpath==3.0.2,et-xmlfile==1.1.0,feedparser==6.0.11,gadjo==1.66,httplib2==0.22.0,idna==3.6,iso8601==2.1.0,isodate==0.6.1,jsonschema==3.0.2,Levenshtein==0.23.0,lml==0.1.0,lxml==4.9.3,nodeenv==1.8.0,odfpy==1.4.1,openpyxl==3.0.10,paramiko==3.4.0,-e git+https://git.entrouvert.org/entrouvert/passerelle.git@8387acd3f0fb8785b07182db7a18b48d73391182#egg=passerelle,pdfrw==0.4,phonenumbers==8.13.26,phpserialize==1.3,Pillow==10.1.0,platformdirs==4.1.0,pyasn1==0.5.1,pyasn1-modules==0.3.0,pycparser==2.21,pycryptodomex==3.19.0,pyexcel-io==0.6.6,pyexcel-ods==0.6.0,pyexcel-xls==0.7.0,pyexcel-xlsx==0.6.0,PyNaCl==1.5.0,pyOpenSSL==23.3.0,pyparsing==3.1.1,pypng==0.20220715.0,pyproj==3.6.1,pyrsistent==0.20.0,python-dateutil==2.8.2,python-ldap==3.4.4,pytz==2023.3.post1,qrcode==7.4.2,rapidfuzz==3.5.2,requests==2.31.0,requests-file==1.5.1,requests-toolbelt==1.0.0,roman==4.1,sgmllib3k==1.0.0,six==1.16.0,sqlparse==0.4.4,suds==1.1.2,typing-extensions==4.9.0,Unidecode==1.3.7,urllib3==1.26.18,vobject==0.9.6.1,xlrd==2.0.1,xlwt==1.3.0,xmlschema==2.0.4,xmltodict==0.13.0,XStatic==1.0.3,XStatic-Font-Awesome==4.7.0.0,XStatic-jQuery==3.5.1.1,XStatic-jquery-ui==1.13.0.1,XStatic-OpenSans==1.0.0,zeep==4.2.1
16:59:13  vitest run-test-pre: PYTHONHASHSEED='2162993343'
16:59:13  vitest run-test: commands[0] | npx vitest --run
16:59:13  [1305476] /var/lib/jenkins/workspace/le_wip_84895-scrib-abstract-soap$ /tmp/tox-jenkins/passerelle/3080/vitest/bin/npx vitest --run
16:59:13  The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
16:59:13  
16:59:13   RUN  v1.1.0 /var/lib/jenkins/workspace/le_wip_84895-scrib-abstract-soap
16:59:13  
16:59:14   ❯ tests/js/qrcode.test.js  (7 tests | 6 failed) 129ms
16:59:14     ❯ tests/js/qrcode.test.js > qrcode reader shows valid qrcode informations
16:59:14       → "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14     ❯ tests/js/qrcode.test.js > qrcode reader shows error on not yet valid or expired qrcodes
16:59:14       → "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14     ❯ tests/js/qrcode.test.js > qrcode reader shows error on invalid qrcode
16:59:14       → "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14     ❯ tests/js/qrcode.test.js > qrcode reader shows error on invalid signature
16:59:14       → "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14     ❯ tests/js/qrcode.test.js > qrcode reader can toggle fullscreen
16:59:14       → "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14     ❯ tests/js/qrcode.test.js > qrcode reader accepts certificate without validity dates
16:59:14       → "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14  
16:59:14  ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 6 ⎯⎯⎯⎯⎯⎯⎯
16:59:14  
16:59:14   FAIL  tests/js/qrcode.test.js > qrcode reader shows valid qrcode informations
16:59:14   FAIL  tests/js/qrcode.test.js > qrcode reader shows error on not yet valid or expired qrcodes
16:59:14   FAIL  tests/js/qrcode.test.js > qrcode reader shows error on invalid qrcode
16:59:14   FAIL  tests/js/qrcode.test.js > qrcode reader shows error on invalid signature
16:59:14   FAIL  tests/js/qrcode.test.js > qrcode reader can toggle fullscreen
16:59:14   FAIL  tests/js/qrcode.test.js > qrcode reader accepts certificate without validity dates
16:59:14  Error: "setSystemTime" was called already and date was mocked. Reset timers using `vi.useRealTimers()` if you want to use fake timers again.
16:59:14   ❯ Object.mock [as value] tests/js/qrcode.test.js:74:8
16:59:14       72|       }
16:59:14       73|     })
16:59:14       74|     vi.useFakeTimers()
16:59:14         |        ^
16:59:14       75| 
16:59:14       76|     reader.remove()
16:59:14  
16:59:14  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/6]⎯
16:59:14  
16:59:14   Test Files  1 failed (1)
16:59:14        Tests  6 failed | 1 passed (7)
16:59:14     Start at  16:59:11
16:59:14     Duration  2.64s (transform 651ms, setup 0ms, collect 509ms, tests 129ms, environment 90ms, prepare 1.31s)
16:59:14  
16:59:15  ERROR: InvocationError for command /tmp/tox-jenkins/passerelle/3080/vitest/bin/npx vitest --run (exited with code 1)

Révisions associées

Révision b377b87d (diff)
Ajouté par Corentin Séchet il y a 4 mois

js: fix vitest version used (#84940)

Historique

#1

Mis à jour par Thomas Noël il y a 4 mois

Est-ce qu'on irait vers quelque chose comme :

--- a/setup-vitest.sh
+++ b/setup-vitest.sh
@@ -3,4 +3,4 @@
 pip install $*
 nodeenv --prebuilt --python-virtualenv
 source $VIRTUAL_ENV/bin/activate # source again to activate npm from env
-npm install -g vitest happy-dom
+npm install -g vitest@"<1.1.0" happy-dom

ou faut-il corriger/adapter les tests ?

#2

Mis à jour par Corentin Séchet il y a 4 mois

  • Assigné à mis à Corentin Séchet

C'est mieux de fixer la version, oui, si ça pète impromptument au rythme des changements cassants des développeurs de librairies web, on est pas sortis.

Le mieux ça serait d'avoir un package.json mais je sais pas si les gens seront d'accord, en attendant je vais faire ça.

#3

Mis à jour par Robot Gitea il y a 4 mois

  • Statut changé de Nouveau à Solution proposée

Corentin Sechet (csechet) a ouvert une pull request sur Gitea concernant cette demande :

#4

Mis à jour par Robot Gitea il y a 4 mois

  • Statut changé de Solution proposée à Solution validée

Thomas NOËL (tnoel) a approuvé une pull request sur Gitea concernant cette demande :

#5

Mis à jour par Robot Gitea il y a 4 mois

  • Statut changé de Solution validée à Résolu (à déployer)

Corentin Sechet (csechet) a mergé une pull request sur Gitea concernant cette demande :

#6

Mis à jour par Transition automatique il y a 4 mois

  • Statut changé de Résolu (à déployer) à Solution déployée
#7

Mis à jour par Transition automatique il y a 2 mois

Automatic expiration

Formats disponibles : Atom PDF