cfn test throwing python exception

Ouverte
#1,065 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
aws, python
Domaine
cli, testing

Piste de recherche

Commencez par la suite de contrats de test cfn et reproduisez la commande sur macOS sans sudo. Examinez pourquoi la collecte de pytest atteint /Library/OSAnalytics/init.py ; c'est terminé lorsque le test de contrat nommé s'exécute sans PermissionError et sans nécessiter sudo.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

When I run the command "cfn test -- -k contract_create_read" I get PermissionError (see full error log below).
It does work when I use sudo "sudo cfn test -- -k contract_create_read" but I know it could work without ןא because it does in other environments.
I have local lambda simulator running in my mac, I run it using sam command.
The Full log is:
Resource schema is valid.
======================================================================================== test session starts ========================================================================================
platform darwin -- Python 3.11.4, pytest-8.0.0, pluggy-1.4.0 -- /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
cachedir: .pytest_cache
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/Users/dfedida/IdeaProjects/fsxnontap_cfn/fsxn_ontap_resource_provider/netapp_cfn/resource_Exportpolicy/.hypothesis/examples'))
rootdir: /private/var/folders/p8/wql98__s32jd3mfk_zn7svrc0000gp/T
configfile: pytest_ay7csx_1.ini
plugins: dependency-0.6.0, random-order-1.1.1, hypothesis-6.98.4, localserver-0.8.1
collected 0 items / 1 error

============================================================================================== ERRORS ===============================================================================================
___________________________________________________________________________________ ERROR collecting test session ___________________________________________________________________________________
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pluggy/_hooks.py:501: in call
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pluggy/_manager.py:119: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_pytest/python.py:210: in pytest_collect_directory
if pkginit.is_file():
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py:1267: in is_file
return S_ISREG(self.stat().st_mode)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py:1013: in stat
return os.stat(self, follow_symlinks=follow_symlinks)
E PermissionError: [Errno 13] Permission denied: '/Library/OSAnalytics/init.py'
====================================================================================== short test summary info ======================================================================================
ERROR ../../../../../../../private/var/folders/p8/wql98__s32jd3mfk_zn7svrc0000gp/T/::Library - PermissionError: [Errno 13] Permission denied: '/Library/OSAnalytics/init.py'
========================================================================================= 1 error in 0.08s ==========================================================================================
ERROR: found no collectors for /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/rpdk/core/contract/suite

Langage dominant
Python
Étoiles
336
Forks
173
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de aws-cloudformation/cloudformation-cli

Toutes les issues de aws-cloudformation/cloudformation-cli

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.