Uploaded image for project: 'WildFly Arquillian'
  1. WildFly Arquillian
  2. WFARQ-160

Propagate JUnit 'failed assumption' exception types from ServerSetupObserver

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 5.1.0.Beta2
    • None
    • None

      It's currently not possible to try and abort test class execution from a ServerSetupTask.

      AIUI the way ARQ + WFARQ works is:

      1) Call the ServerSetupObserver (as it (@Observes BeforeDeploy).
      2) Deploy
      3) Invoke any @BeforeClass method.

      Users might logically put assumption checks in a ServerSetupTask, because if some environmental condition is not met ServerSetupTask cannot work. But ServerSetupObserver swallows throwables, and that means the 2) Deploy step happens, which may fail due to preconditions from the ServerSetupTask not being met.

      Users would likely try and do assumption checks in the @BeforeClass method, but that doesn't work, since those checks are executed after the deploy. This enhancement would not make doing that work, but it would add least provide a reasonably intuitive way to abort execution.

      I think simply propagating assumption failure exceptions from ServerSetupObserver will solve this problem. My impression from poking at ARQ code is all three of the items above all execute within the context of JUnit calling a @BeforeClass method; it's just that the ARQ runner interposes steps 1 and 2 before actually calling the method. So I hope just throwing on the assumption failure exception will either be handled nicely by ARQ, or it will propagate on the JUnit logic, which will handle it the same as it handles such an exception from non-ARQ test code.

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: