paul-rogers commented on code in PR #13660:
URL: https://github.com/apache/druid/pull/13660#discussion_r1070067680


##########
integration-tests-ex/docs/guide.md:
##########
@@ -239,3 +239,29 @@ test. Your test will run in parallel with all other IT 
categories, which is why
 we offered the advice above: the test has to have a good reason to fire up yet
 another build task.
 
+### Choosing the Middle Manager or Indexer
+
+Tests should run on the Middle Manager by default. Tests can optionally runn 
on the
+Indexer. To run on Indexer:
+
+* In the environment, `export DRUID_INTEGRATION_TEST_INDEXER=indexer`. (Use 
`middleManager`
+  otherwise. If the variable is not set, `middleManager` is the default.)
+* The `cluster/<category>/docker-compose.yaml` file should be for the Middle 
manager. Create
+  a separate file called `cluster/<category>/docker-compose-indexer.yaml` to 
define the
+  Indexer-based cluster.
+* The test `src/test/resources/cluster/<category>/docker.yaml` file should 
contain a conditional

Review Comment:
   If you have one category, that includes 10 `@Test` cases, and one of those 
test cases can't run in Indexer, then the easiest solution is for us to provide 
an `isIndexer()` method. The test case can be written as:
   
   ```java
   @Test
   public void myMMOnlyTest()
   {
     if (TestUtils.isIndexer()) {
       // This test can't run on indexer
       return
     }
     // MM-only test case here
   }
   ```
   
   We could make this fancy, by defining an annotation, and using our 
`DruidTestRunner` to do filtering.
   
   The implementation of `isIndexer()` is simply 
`"indexer".equals(System.getenv("DRUID_INTEGRATION_TEST_INDEXER"))`, assuming 
we set the env var in both places. That's a bit of a hassle in an IDE. So, a 
fancier solution is to check the cluster to see if any Indexer is running. Easy 
enough to code up if needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to