nzw921rx opened a new pull request, #12895:
URL: https://github.com/apache/seatunnel/pull/12895

   > This is a contribution to Apache SeaTunnel.
   
   ## Purpose
   
   Fix the E2E harness behavior described in #12889: suites that have no 
applicable container for the selected engine were failing with 
`PreconditionViolationException` instead of being skipped.
   
   ## Root cause
   
   `@DisabledOnContainer` is a project annotation consumed by `AnnotationUtil`; 
it is not a JUnit `ExecutionCondition`. When `RUN_ENGINES` selects only Zeta, 
suites annotated to disable Zeta (and Flink/Spark) end up with zero containers. 
`TestCaseInvocationContextProvider` then returns an empty stream, so JUnit 
fails every test in the class. `@BeforeAll` also runs even though no test can 
execute.
   
   ## Changes
   
   - Add `ContainerSelectionCondition`, an `ExecutionCondition` that is 
evaluated before `@BeforeAll`.
   - Filter the containers selected by `RUN_ENGINES` through class-level and 
method-level `@DisabledOnContainer`.
   - Disable the suite or method when at least one container was discovered but 
none remains applicable, and log the reason.
   - Keep the suite enabled when no container was discovered at all, so a real 
discovery misconfiguration still fails visibly.
   
   ## Behavior
   
   | Discovered containers | Applicable after filtering | Result |
   | --- | --- | --- |
   | none | n/a | enabled, fails visibly as before |
   | some | at least one | enabled |
   | some | none | skipped, with the reason logged |
   
   ## Validation
   
   - `./mvnw spotless:apply`
   - `./mvnw -pl seatunnel-e2e/seatunnel-e2e-common 
-Dtest=ContainerSelectionConditionTest -DfailIfNoTests=false test` -> 6/6 passed
   - No production code, configuration, or data format changes.
   
   Related issue: #12889
   


-- 
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]

Reply via email to