cfn test throwing python exception

Aperta
#1,065 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
aws, python
Ambito
cli, testing

Direzione di ricerca

Inizia con la suite di test dei contratti cfn e riproduci il comando su macOS senza sudo. Esamina perché la raccolta di pytest raggiunge /Library/OSAnalytics/init.py; è completato quando il test del contratto indicato viene eseguito senza un PermissionError e senza richiedere sudo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
336
Fork
173
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws-cloudformation/cloudformation-cli

Tutte le issue di aws-cloudformation/cloudformation-cli

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.