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

Fix TestSQLRepositoryFulltextConfig on MongoDB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.2
    • Fix Version/s: 9.2
    • Component/s: Runtime, Tests

      Description

      Since new Runtime NXP-19326, this test failed each time.

      This is due to @LocalDeploy annotations on method which deploys a sql repository contribution which overrides the MongoDB repository declaration.
      By starting earlier due to alphabetical order. As it @Before method is never called because test failed just before.

      We could probably add a require in culprit contribution to fix the problem. As it, @Before method should be called and ignore the tests.

      But here we want to ignore the test based on CoreFeature initialization:

          @Before
          public void setUp() {
              assumeTrue(coreFeature.getStorageConfiguration().isVCS());
              // MySQL fulltext is funky with respect to what words it finds in small databases
              // so don't bother testing on MySQL, this is mostly a configuration test anyway
              assumeTrue(!coreFeature.getStorageConfiguration().isVCSMySQL());
          }
      

      I can annotate my test class with ConditionalIgnoreRule.Ignore and reflect the condition in the implementation to provide.

      Just doing this will work, but we will have an error for the first test, because it first tries to deploy the culprit contribution and then the test is ignored. This is due to ConditionalIgnoreRule mechanism working as a MethodRule.

      When I annote my class, I expect the condition to be run before running the test, just after class initialization. Currently putting annotation on class or on a method has the same effect, condition is evaluated after all features beforeMethodRun step, so after deploy annotations on method processing.

      So two things to do:

      • NXP-22623
      • Fix the test by using ConditionalIgnoreRule.Ignore because how the test is ignored now can't work at this step

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours
                  6h