allure-framework / allure-framework/allure-python

Resolving 'fullName' Field Issue in Allure-Pytest: A Local Solution and Call for Official Adjustment

Aperta
#751 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
814
Fork
260
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello, currently I am using Allure TestOps to manage my automated tests, and after much searching, I finally found a small issue that was not noticeable before in allure-pytest. The problem is that when I run tests with examples using (@pytest.mark.parametrize) with more than one test, at the end of the execution, the result.json file is filled with the "fullName" field containing only the test name without the examples appended. In other words, when I add the execution results to TestOps, it considers it as a single test instead of the multiple tests I have in the parametrize. Here's an example below:

![image](https://github.com/allure-framework/allure-python/assets/58951154/10e65dca-6f50-48ef-8b2c-51aaf4d2ded6)

After cloning the allure-python repository, I was able to identify that in the utils.py file of allure-pytest, on line 122, the method "allure_full_name" is located. What I did to test it locally was to modify the line that previously read:

test = item.originalname if isinstance(item, pytest.Function) else item.name.split("[")[0]

to:
test = item.name

After reinstalling the library locally, the issue was resolved as evidenced below:

![image](https://github.com/allure-framework/allure-python/assets/58951154/c271343c-eb72-4753-8d0f-0b50ae68b917)

I didn't encounter any functionality issues with allure-pytest after making this local modification. Can you make this adjustment officially in the library?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Iniziate in allure-pytest/utils.py, nel metodo allure_full_name intorno alla riga 122, e riproducete il problema con un test pytest.mark.parametrize con più esempi. Esaminate il result.json generato e verificate che ogni risultato parametrizzato abbia un fullName distinto, in modo che TestOps riconosca i test separatamente.

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

Valutazione

Stack tecnologico
python
Ambito
testing
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.