Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-32922

Improve how test properties are handled

    XMLWordPrintable

    Details

      Description

      We have more and more possibilities when it comes to unit test Nuxeo against third party services.
      The repository could use an SQL DB or MongoDB, directories could be stored in SQL DB or MongoDB, the stream implementation could be in memory or use Kafka, the audit could be stored in SQL DB, MongoDB or ElasticSearch and soon we will also have such kind of possibilities for the search service.
      All these possibilities create a huge matrix to test, fortunately there are possible dependencies between Nuxeo backends. For instance directories or audit could be stored in MongoDB if the repository is stored in MongoDB.

      Purpose of this ticket is to introduce a mechanism to express such dependencies and leverage them.
      Currently we have one dependency expressed in Nuxeo code base, it is present in the directory feature. The DirectoryFeature check for its own test property to deploy the right implementation, or if it is not configured, the feature uses the repository test property (handled by CoreFeature).
      Secondary purpose is to ease how we give these properties to Nuxeo test framework. Currently we have to list them in the root pom, like this:

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                ...
                <systemPropertyVariables>
                  ...
                  <!-- Used by org.nuxeo.ecm.core.storage.sql.DatabaseHelper -->
                  <nuxeo.test.vcs.db>${nuxeo.test.vcs.db}</nuxeo.test.vcs.db>
                  ...
                </systemPropertyVariables>
                ...
              </configuration>
            </plugin>
      

      Current usages to pass properties to Maven are

      • on command line (mainly development)
      • by properties files (mainly CI)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: