tzulitai opened a new pull request #28: [FLINK-16159] [tests, build] Add 
verification integration test + integrate with Maven build
URL: https://github.com/apache/flink-statefun/pull/28
 
 
   This PR achieves the following goals:
   - Adds a `statefun-integration-tests` module that is meant to maintain 
integration tests in the future.
   - Adds `statefun-sanity-itcase` to the integration tests module, which 
includes a simple application used for sanity verification and a JUnit-driven 
test that performs the verification over a docker setup.
   - Adds a Maven build profile so that the integration tests can be run with a 
simple command: `mvn clean verify -Prun-integration-tests`
   
   ---
   
   ### The verification app and test
   
   The verification app (`SanityVerificationModule`) is a simple application 
used for sanity verification.
   - The application reads commands from a Kafka ingress
   - Has multiple functions binded (currently 2 in this PR) that reacts to the 
commands (see class-level Javadoc) of `SanityVerificationModule` for a full 
description on the set of commands)
   - Reflects any state updates in the functions back to a Kafka egress.
   
   The Junit-driven test does the following:
   - Uses Testcontainers (https://www.testcontainers.org/) to start a Kafka 
broker, builds the image for the verification app on the fly and also starts a 
master + worker container for the app.
   - Writes some commands to the Kafka ingress topic
   - Reads state outputs for the Kafka egress topic, and verifies that they are 
correct
   
   Right now the test scenario does not have any randomization to it.
   We may consider to add that in the future as a follow-up.
   
   ---
   
   ### Maven `run-integration-tests` build profile and structure setup
   
   With this PR, to add new container-based integration tests in the future, a 
developer has to do the following:
   - Add a new sub-module under `statefun-integration-tests`
   - Add source code for the Stateful Functions application to test against
   - Add a test class named with the pattern `*ITCase` that setups the 
containers using testcontainers, and implements the test verification logic as 
a JUnit test. The classname pattern is important because only then would it be 
skipped by the unit test phase, and only kicks in with the 
`run-integration-tests` profile.
   
   To build while also running the integration tests, one simply does:
   `mvn clean verify -Prun-integration-tests` in the project root directory.
   
   This always re-builds the base Stateful Functions image before running the 
ITCases.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to