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

on_ignore event may be triggered for tests that have passed prior to an error in beforeClass() on retry #19

Closed
ArturSpirin opened this issue Aug 21, 2019 · 0 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@ArturSpirin
Copy link
Owner

ArturSpirin commented Aug 21, 2019

  1. Python version python --version >> 2.7 & 3.5+
  2. Test Junkie version pip show test_junkie >> 0.7a4 and prior
  3. Platform aka Windows 10 or Linux Mint 18.1 >> All
  4. Command used, if running via terminal >> N/A
  5. Smallest code snippet that can reproduce the issue and /or description of the issue
from test_junkie.decorators import Suite, test, beforeClass
from tests.junkie_suites.TestListener import TestListener


@Suite(retry=2,
       listener=TestListener,
       priority=2, feature="Store", owner="Mike", parameters=[1, 2])
class NewProductsSuite:

    ATT = 1

    @beforeClass()
    def before_class1(self):
        if NewProductsSuite.ATT == 2:
            raise Exception("Derp")
        NewProductsSuite.ATT += 1

    @test(component="Admin", tags=["store_management"], parameters=[10, 20], parallelized_parameters=True)
    def edit_product(self, parameter, suite_parameter):
        print("edit_product")

    @test(component="Admin", tags=["store_management"])
    def archive_product(self):
        print("archive_product")


if "__main__" == __name__:
    from test_junkie.runner import Runner
    runner = Runner([NewProductsSuite])
    runner.run(test_multithreading_limit=4)

Expected behavior

archive_product should not be marked failed after it has passed initially.

Actual behavior

archive_product gets two metric updates, one is marked success and the other is marked as error due to exception in before class.


If attaching logs, make sure to remove any personal information, credentials, tokens, keys - anything that you don't
want to become public.

@ArturSpirin ArturSpirin added the bug Something isn't working label Aug 21, 2019
@ArturSpirin ArturSpirin self-assigned this Aug 21, 2019
@ArturSpirin ArturSpirin added this to In progress in Bugs Aug 25, 2019
@ArturSpirin ArturSpirin moved this from In progress to Done in Bugs Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Bugs
  
Done
Development

No branches or pull requests

1 participant