Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-18258

AssumeTestGroupUtil should log exception if docker is unavailable and not assume false is ok

XMLWordPrintable

    • ---
    • ---

      As discussed on https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/topic/Testcontainer.20tests.20not.20running.20sometimes.3F we are seeing cases where CI jobs that should be running tests that use testcontainers are not, almost certainly because AssumeTestGroupUtil.isDockerAvailable() is returning false.

      That method works by trying to create a docker client, catching any exception, and returning false. That's ok if the failure is the anticipated "there's no docker on this system." But if the failure is for some other reason there's no output to help diagnose what happened. So, any caught exception should be logged.

      Further, before throwing any AssumptionViolationException, AssumeTestGroupUtil.assumeDockerAvailable() should check if system property "org.wildfly.test.require.docker" is set to "true". If it is, throw a RuntimeException instead of AssumptionViolationException. This will allow CI jobs that expect docker availability to be configured to report failures if it is not. (To discuss: we could perhaps instead check if the prop is not "false" or give it a name with an inverted meaning. However, that means developers running the TS on their own workstations would have to set the prop if docker is not available.)

            dkafe Dimitris Kafetzis
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: