Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
The original idea of this PR is to build architectural rules for ITCase and quickly found that current architecture test submodule only focuses on production code. In order to check the architecture violation of test code, followings should be done:
- build the architecture test infra for test code
- isolate the classpaths of production code and test code, i.e. separation of concers.
- define architectural rules for ITCase
- create ArchUnit test for some submodules
The first try was using test jars of submodules and check the architectural violation centrally. There are some cons of this solution. First, it will need each submodule to create standard test jars that have conflict with some submodules who need extra exclusion filter for their test jars. Second, production code and test code mixed up, which makes it very difficult to define the scope of analyse classes for each rule, because some rules should only have effect on production code and others should only be used for test code. As second try, a distributed solution will be used. The architecture-test module will be split into three submodules: base for ArchUnit common extension, production for ArchUnit test of production code, test for defining rules for test code centrally. The real ArchUnit tests will be distributed and developed within submodules where architectural violation check is required.
Architectural rules are required to verify that all IT cases should have:
- for JUnit4
a public, static, final member of type MiniClusterWithClientResource annotated with ClassRule.
or
a public, non-static, final member of type MiniClusterWithClientResource annotated with Rule.
- for JUnit5
a public, static, final member of type MiniClusterExtension
and
a public, static, final member of type AllCallbackWrapper annotated with RegisterExtension
The inheritance hierarchy need to be checked, because the member of MiniCluster could be defined in the super class.
Attachments
Issue Links
- is a child of
-
FLINK-26009 ArchUnit for Flink
- Open
- is required by
-
FLINK-25892 Develop ArchUnit test for connectors
- Resolved
- links to