GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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. #563

New issue
Copy link
New issue
Copy link
Closed
#647
Closed
Allure step in thread not show in report.#563
#647
Copy link

Description

@nigredon1991
nigredon1991
opened on Feb 12, 2021
Issue body actions

I'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)                              

image

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:

  • Allure version: 2.7.0
  • Test framework: [email protected]
  • Allure adaptor: [email protected]

Other information

Activity

  1. bugsnub commented on Feb 15, 2021

    @bugsnub
    bugsnub
    on Feb 15, 2021
    More actions

    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.
    ss-01
    ss-02

  2. nikitapalta commented on May 27, 2021

    @nikitapalta
    nikitapalta
    on May 27, 2021
    More actions

    Is there a resolution to this problem? I am facing similar issue in my automation as well.

  3. nigredon1991 commented on Jun 30, 2021

    @nigredon1991
    nigredon1991
    on Jun 30, 2021
    Author
    More actions

    @nikitapalta, I solved this problem for myself here:

    https://github.com/nigredon1991/allure-python/tree/allure_step_in_thread

    You can try to test, maybe I will make a request.

  4. bugsnub commented on Jun 30, 2021

    @bugsnub
    bugsnub
    on Jun 30, 2021 via email
    More actions
    Can you raise a PR to get this merged in mainstream? Thanks, Anshuman
    …
    On 30-Jun-2021, at 4:14 PM, Nikolay Glazov ***@***.***> wrote: @nikitapalta <https://github.com/nikitapalta>, I solved this problem for myself here: https://github.com/nigredon1991/allure-python/tree/allure_step_in_thread <https://github.com/nigredon1991/allure-python/tree/allure_step_in_thread> You can try to test, maybe I will make a request. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#563 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AF5D25JSFCCAIUC55DC6ZS3TVLYRPANCNFSM4XQTM5OA>.
  5. nigredon1991 commented on Jul 1, 2021

    @nigredon1991
    nigredon1991
    on Jul 1, 2021
    Author
    More actions

    Created request #605.

  6. qingqingweiran commented on Dec 31, 2021

    @qingqingweiran
    qingqingweiran
    on Dec 31, 2021
    More actions

    @nigredon1991 is it support process?

  7. sseliverstov
    closed this as completedin #647on Jul 29, 2022
  8. sseliverstov
    added a commit that references this issue on Jul 29, 2022

    alternate realization of threads support (fixes #563, fixes #605, via #…

    This issue will close once commit d3bfabb is merged into the 'master' branch.
    d3bfabb
  9. beckerGil
    added a commit that references this issue on Apr 10, 2023

    alternate realization of threads support (fixes allure-framework#563, f…

    This issue will close once commit 9141c48 is merged into the 'master' branch.
    9141c48
  10. IvanBuruyane
    added a commit that references this issue on Mar 19, 2024

    alternate realization of threads support (fixes allure-framework#563, f…

    This issue will close once commit 3b71718 is merged into the 'master' branch.
    3b71718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.