cfn test throwing python exception

Offen
#1,065 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
aws, python
Bereich
cli, testing

Rechercherichtung

Beginne mit der cfn-Test-Contract-Suite und reproduziere den Befehl unter macOS ohne sudo. Untersuche, warum die pytest-Collection /Library/OSAnalytics/init.py erreicht; fertig ist es, wenn der benannte Contract-Test ohne PermissionError oder sudo-Anforderung ausgeführt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Python
Sterne
336
Forks
173
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus aws-cloudformation/cloudformation-cli

Alle Issues in aws-cloudformation/cloudformation-cli

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.