Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1902

Provide SPI for conditional execution of test methods

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 1.1.6.Final
    • 1.1.5.Final
    • Base Implementation
    • None

      aslak@redhat.com

      Let me explain.

      We want to do this:

      @RunWith(Arquillian.class)
      @RunAsClient
      public class TestCase
      {
          @Test
          @Jira("ARQ-1")
          public void test() {
              // this test method will be executed 
              // because Aslak created EJB Jar archive (JIRA status = done)
          }
      
          @Test
          @Jira("ARQ-xyz")
          public void test() {
              // this methods will NOT be executed (will be skipped)
              // becase lets say that its status is "open / unresolved"
          }
      }
      

      While looking into the code, it seems these classes are most important (1), (2).

      So my initial approach was that I wanted to kind of "hook" into that execution and dynamically resolve if that test method is going to be executed or not but I am failing to do so since there is not any SPI which would load my test-method-execution-decider which would tell if that method is going to be executed or if it will be marked as skipped.

      In that decider, I would dynamically log in to jira and read if that jira is resolved or nor and behave accordingly.

      Is there any will to push this to upstream once implemented? Default decider would indeed execute that method every time and I would just put my own decider and whole JIRA api on class path in my custom extension.

      (1) https://github.com/arquillian/arquillian-core/blob/master/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/execution/ClientTestExecuter.java#L44

      (2) https://github.com/arquillian/arquillian-core/blob/master/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/execution/LocalTestExecuter.java#L55

              smikloso Stefan Miklosovic (Inactive)
              smikloso Stefan Miklosovic (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: