GeezerVison is showing github.com — Allure step in thread not show in report. · Issue #563 · allure-framework/allure-python
Allure step in thread not show in report. #563DescriptionI'm submitting a ...
- [* ] bug report
- feature request
- support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
Steps do not appear in the report if they were launched inside a thread.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
This example code for reproduce:
import allure
from concurrent.futures import ThreadPoolExecutor
@allure.step("lala")
def lala(x=1):
print('run lala')
def test_lala():
with ThreadPoolExecutor(max_workers=2) as executor:
executor.map(lala)

What is the expected behavior?
I would like the steps to appear in the report.
What is the motivation / use case for changing the behavior?
I need to run tests that execute commands remotely on multiple devices, so it's convenient to use threads, but the report does not contain steps declared inside the thread. Can you tell me if this can be done differently, or somehow forward the state to the parent thread.
Please tell us about your environment:
Other informationActivitybugsnub commented on Feb 15, 2021 even allure.attach when is running inside threads is not working.
See this sample code:
import pytest
import allure
import random
from concurrent.futures import ThreadPoolExecutor, as_completed
def test_01_allure_attach():
def thread_function():
body = str(random.random())
allure.attach(body=body, name=body)
with ThreadPoolExecutor(max_workers=5) as executor:
thread_executor = {executor.submit(thread_function): x for x in range(0, 10)}
for completed_thread in as_completed(thread_executor):
iteration = thread_executor[completed_thread]
print(iteration)
def test_02_allure_attach():
for x in range(0, 10):
body = str(random.random())
allure.attach(body=body, name=body)
now when you generate allure report, 2nd test is showing attachments while 1st one is not showing.

 nikitapalta commented on May 27, 2021 Is there a resolution to this problem? I am facing similar issue in my automation as well. nigredon1991 commented on Jun 30, 2021 bugsnub commented on Jun 30, 2021 Can you raise a PR to get this merged in mainstream?
Thanks,
Anshuman
…nigredon1991 commented on Jul 1, 2021 qingqingweiran commented on Dec 31, 2021 added a commit that references this issue on Jul 29, 2022This issue will close once commit d3bfabb is merged into the 'master' branch.d3bfabb added a commit that references this issue on Apr 10, 2023This issue will close once commit 9141c48 is merged into the 'master' branch.9141c48 added a commit that references this issue on Mar 19, 2024This issue will close once commit 3b71718 is merged into the 'master' branch.3b71718
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|