AssertionError message to nagios output
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with the pytest command using the --nagios option and compare its output with the same command without --nagios, using the shown AssertionError case. Trace how the assertion message is handled for the Nagios result and verify that the failing test's message appears in the final Nagios output while the pass/fail summary remains intact.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello I have a simple test where I print the filename if the file exists.
/home/nagios/monitoring-env/bin/pytest -v -s -qq --nagios --tb long --inputfile=test.txt /usr/local/ncpa/plugins/test_myinfra.py
input file: test.txt
File Found: '/usr/local/ncpa/plugins/test.txt'
TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 0.06 seconds
In nagios I do see the print statement: File Found: '/usr/local/ncpa/plugins/test.txt'
I have a simple assert in my code;
assert len(list_match)==1 , " File NOT Found:" + str(list_match).strip('[]')
If i run the test without nagios I do see the AssertionError
/home/nagios/monitoring-env/bin/pytest -v -s --inputfile=test.txt /usr/local/ncpa/plugins/test_myinfra.py
E AssertionError: File NOT Found: '/usr/local/ncpa/plugins/test.txt'
TESTINFRA CRITICAL - 0 passed, 1 failed, 0 skipped in 0.10 seconds
How can I have the AssertionError message displayed in Nagios when running the command below?
/home/nagios/monitoring-env/bin/pytest -v -s -qq --nagios --tb long --inputfile=test.txt /usr/local/ncpa/plugins/test_myinfra.py
TESTINFRA CRITICAL - 0 passed, 1 failed, 0 skipped in 0.06 seconds
- Lenguaje dominante
- Python
- Estrellas
- 2.5k
- Forks
- 359
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytest-dev/pytest-testinfra
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 58/100
pytest-dev/pytest-testinfra#815 ·
-
service is_enabled does not work with exit code 4Posiblemente ocupada @pfuntner la tomó hace 578 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
pytest-dev/pytest-testinfra#801 · 1 comentario ·
-
Chroot backendAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
pytest-dev/pytest-testinfra#789 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
pytest-dev/pytest-testinfra#788 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
pytest-dev/pytest-testinfra#786 ·
Todos los issues de pytest-dev/pytest-testinfra
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
yt-project/yt#5624 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NousResearch/hermes-agent#148376 ·
Los mantenedores suelen responder en 1 día
-
Analysis
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SACGF/variantgrid#2615 ·
Los mantenedores suelen responder en 1 día