[
https://issues.apache.org/jira/browse/FLINK-1827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15287383#comment-15287383
]
Stephan Ewen commented on FLINK-1827:
-------------------------------------
I think we should restore the test util classes for the {{main}} scope in the
{{flink-test-utils}} project.
The {{flink-test-utils}} project was originally created exactly to host the
relevant test classes, so that other projects can make simple use of them,
without the test-jar workaround.
If I understand Maven correctly, a {{test-jar}} is a fix or a project layout
structure that it not following the proper idiomatic pattern, where every
reusable utility collection should have its own dependency.
While there are good reasons to sometimes use test jars rather than factor the
utils into dedicated projects (to reduce the number of projects, or at least
make it look like that), for the definite collection of reusable test utils, we
should not use a workaround. Like [~joshng] said, it has a couple of drawbacks,
especially around transitive dependencies.
If the main cause for this issue was the test dependency on ScalaTest, it
should be enough to move the {{FlinkTestBase}} classes into the test jar. Or,
given that the ML project is the only user of that class, why not simply move
it directly to the ML test project, and remove the ScalaTest dependency from
{{flink-test-utils}}?
> Move test classes in test folders and fix scope of test dependencies
> --------------------------------------------------------------------
>
> Key: FLINK-1827
> URL: https://issues.apache.org/jira/browse/FLINK-1827
> Project: Flink
> Issue Type: Improvement
> Components: Build System
> Affects Versions: 0.9
> Reporter: Flavio Pompermaier
> Priority: Minor
> Labels: test-compile
> Fix For: 1.1.0
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> Right now it is not possible to avoid compilation of test classes
> (-Dmaven.test.skip=true) because some project (e.g. flink-test-utils)
> requires test classes in non-test sources (e.g.
> scalatest_${scala.binary.version})
> Test classes should be moved to src/main/test (if Java) and src/test/scala
> (if scala) and use scope=test for test dependencies
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)