New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-10517][rest] Add stability test #7986
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTest.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTest.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTest.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutine.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutine.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTest.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutine.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
static final class RestAPISnapshot { | ||
public List<JsonNode> calls; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach of deserializing late is awkward but I do not know a solution yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only solution i see is have a well-defined RestAPISnapshot (i.e. pull the details from the routines in here), but tbh I quite like that every routine is able to freely define it's own container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not know a solution but I think I should express myself better why I think current approach can be improved:
- RestAPISnapshot
looks like domain object but contains raw data that is not deserialized
- two points of deserialization
- deserialization mixed with business logic, i.e., in the compatibility check we deserialize
I think it's fine that every routine defines it's own container, and there should be a way not to scatter the deserialization logic. Unfortunately I am on vacation now, and I cannot give you a definite recommendation on how to proceed as I have not thought this problem through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided that I can live with deserializing the containers late. I think an alternative could be to deserialize eagerly everything as Object
with a custom jackson deserializer.
...runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutines.java
Show resolved
Hide resolved
...time/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityCheckResult.java
Outdated
Show resolved
Hide resolved
...time/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityCheckResult.java
Show resolved
Hide resolved
...time/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityCheckResult.java
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutine.java
Outdated
Show resolved
Hide resolved
...runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutines.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTest.java
Show resolved
Hide resolved
...time/src/test/java/org/apache/flink/runtime/rest/util/DocumentingDispatcherRestEndpoint.java
Outdated
Show resolved
Hide resolved
...-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/CompatibilityRoutine.java
Outdated
Show resolved
Hide resolved
I think overall this looks good. I have left some minor comments. |
51396c9
to
5795f3d
Compare
What is the purpose of the change
This PR adds a stability test for the REST API to prevent API breaking changes.
The test operates against an API snapshot (created by the test if
-Dgenerate-rest-snapshot
is set).One snapshot is created for each
RestAPIVersion
, each being an array of all supported rest calls.The test verifies the following:
The implementation of these checks can be found in
CompatibilityRoutines
.