Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1298

Configure fork=once so that TRACE logs can be gathered more easily

    XMLWordPrintable

Details

    Description

      We currently run our testsuite with fork=none which causes us some small issues:

      • First, we're exposed to whatever system properties Maven might use internally which could impact our build.
      • Secondly, it makes it difficult to have per-project log4j settings that are not hardcoded in the source code.

      So, what is suggested here is that we switch to fork=once so that each module's testsuite runs in a different JVM. The overhead of this is apparently pretty small (needs double checking).

      In terms of logging, this potentially enables each module to have its own 'trace-enabling' profile pointing to its own TRACE enabled log4j file, making it quite easy for each module to define what TRACE is relevant for each. For example:

      <project> 
        <profiles> 
          <profile> 
            <id>trace-tests</id> 
            <build> 
              <plugins> 
                <plugin> 
                  <artifactId>maven-surefire-plugin</artifactId> 
                  <configuration> 
                    <systemPropertyVariables> 
                      <log4j.configuration>${basedir}/src/test/trace/log4j.xml</log4j.configuration> 
                    </systemPropertyVariables> 
                  </configuration> 
                </plugin> 
              </plugins> 
            </build> 
          </profile> 
        </profiles> 
      </project>
      

      This has another advantage which is allowing us to override the log output directory selectively which is handy in a CI environment such as CloudBees:

      • First, set the logs location to be dependant on another system property, i.e.:
        location=${log4j.outputDirectory}/infinispan.log
      • And then, selectively change it:
        <systemPropertyVariables> 
        <log4j.configuration>${basedir}/src/test/trace/log4j.xml</log4j.configuration> 
        <log4j.outputDirectory>${project.build.directory}/test-logs</log4j.outputDirectory> 
        </systemPropertyVariables>

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            rh-ee-galder Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: