Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allure step in thread (fixes #563) #605

Closed

Conversation

nigredon1991
Copy link

@nigredon1991 nigredon1991 commented Jul 1, 2021

Test for example with thread:

from concurrent.futures import ThreadPoolExecutor

import allure
import pytest
@allure.step("lala")
def lala(x=1):
    print(f"run {x}")
    return 1


@allure.step("test")
def test_lala():
    with allure.step("Start in thread"):
        with ThreadPoolExecutor(max_workers=2) as executor:
            f_result = executor.map(lala, [1, 2])
        print(list(f_result))

Without this request allure report looks like this:
image

And with this request report looks like this:
image

In the request, the generation of the report has been corrected if threads are created during the launch process. Each step now remembers its parent, even if it was launched in a thread.

Context

Fix for #563

Checklist

@CLAassistant
Copy link

CLAassistant commented Jul 1, 2021

CLA assistant check
All committers have signed the CLA.

@rad96
Copy link
Contributor

rad96 commented Jul 2, 2021

@nigredon1991
Hello
Why tests not executed for this Pull Request?
Also, can you write some tests for this functionality?
(I asked because maintainers will ask too i think)

Now step correct showing in Thread
@nigredon1991 nigredon1991 force-pushed the allure_step_in_thread branch from 2179ac3 to 138ff49 Compare July 2, 2021 15:14
@nigredon1991
Copy link
Author

@nigredon1991
Hello
Why tests not executed for this Pull Request?
Also, can you write some tests for this functionality?
(I asked because maintainers will ask too i think)

If I understand correctly, then to launch I need an approval from maintainers.

@rad96
Copy link
Contributor

rad96 commented Jul 3, 2021

@nigredon1991
Hello
Why tests not executed for this Pull Request?
Also, can you write some tests for this functionality?
(I asked because maintainers will ask too i think)

If I understand correctly, then to launch I need an approval from maintainers.

Check for example this pull request:
#560 (comment)
You can see section with test actions executed:
image

Do you have actions enabled for your repo?

@nigredon1991 nigredon1991 marked this pull request as draft July 3, 2021 09:59
@nigredon1991
Copy link
Author

@nigredon1991
Hello
Why tests not executed for this Pull Request?
Also, can you write some tests for this functionality?
(I asked because maintainers will ask too i think)

If I understand correctly, then to launch I need an approval from maintainers.

Check for example this pull request:
#560 (comment)
You can see section with test actions executed:
image

Do you have actions enabled for your repo?

Thank you. Otherwise I didn’t think of it.

threading.get_native_id() -> threading.get_ident()
@rad96
Copy link
Contributor

rad96 commented Jul 7, 2021

Looks like you still need write at least one test for this case
And remove draft status from PR

@nigredon1991 nigredon1991 marked this pull request as ready for review July 8, 2021 10:28
@nigredon1991
Copy link
Author

Tests added.

@rad96
Copy link
Contributor

rad96 commented Jul 8, 2021

So now we need to summon maintainer :)

@sseliverstov Can you please review this PR?

@sseliverstov
Copy link
Contributor

Great job! Unfortunately, I can review it right now. I going to do it next week. Feel free to summon me again.

@rad96
Copy link
Contributor

rad96 commented Jul 12, 2021

Great job! Unfortunately, I can review it right now. I going to do it next week. Feel free to summon me again.

@sseliverstov so... new week now
Can you review this PR for us? :)

@bugsnub
Copy link

bugsnub commented Jul 15, 2021

Someone, please review and merge this. It is a long waiting PR/Change.

@nigredon1991
Copy link
Author

@sseliverstov, can you review this PR? :)

@nigredon1991
Copy link
Author

Maybe I need to do something else so that can merge?

@rad96
Copy link
Contributor

rad96 commented Aug 4, 2021

@sseliverstov any feedback?

@nigredon1991
Copy link
Author

Maybe I need to do something else so that can merge?

@nigredon1991 nigredon1991 deleted the allure_step_in_thread branch August 1, 2022 07:45
beckerGil pushed a commit to beckerGil/allure-python that referenced this pull request Apr 10, 2023
IvanBuruyane pushed a commit to IvanBuruyane/allure-python that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants