Extend the IT framework to allow tests in extensions#13877
Extend the IT framework to allow tests in extensions#13877abhishekagarwal87 merged 53 commits intoapache:masterfrom
Conversation
Report stats & close statement
Simple server + query test works
The gRPC shaded jar module causes issues when loaded into an IDE. This PR hides the module from Maven (and hence IDEs) by building it implicitly in the grpc-query module. It is a hack, but it works.
grpc protobufwriter
add empty response and GrpcResponseHandler tests
Allow ITs outside of the 'cases' directory Refactoring
Build the grpc-query extension archive Build a jar for the test Protobuf message Fixes to the extension path mechanism
* Refactor template into cluster directory * Add verify, setup scripts * Forbid snapshots from upstream repos * Basic grpc-query IT test
* run command to only run tests * test always stops containers * prune -> prune-volumnes * prune-containers to stop all running containers * github prunes containers and volumes
abhishekrb19
left a comment
There was a problem hiding this comment.
Thanks for the detailed code comments. LGTM.
|
This PR is blocked on a failure in the Kafka tests. Debugging failed to determine if a change in this PR caused the failure, or if the tests are just reliably flaky. Kafka failures seem uncorrelated to the changes made while debugging, and the tests fail so often it is hard to determine when a code path might be clean. Let's just put this on hold until the Kafka issue is resolved. |
|
The Kafka tests have failed for the last month. At first I thought it was because the PR contained a change to the way Druid locates extensions. But, I removed that code (having found another solution to adding test-specific extensions), yet Kafka still fails. I suspect the test itself is flaky. The test was converted to the new IT framework to allow debugging (in a separate PR). However, the test ran perfectly on the local machine after the conversion. So, let's just assume the Kafka test is flaky and ignore it. |
|
The gRPC query PR, #14024, depends on this code. In fact, this PR was pulled out of (an early version of) the gRPC extension. Once this PR is merged, we will merge master into the rRPC PR to remove these files from the rRPC PR. |
# Conflicts: # integration-tests-ex/cases/pom.xml
tejaswini-imply
left a comment
There was a problem hiding this comment.
Thanks for the changes, @paul-rogers. LGTM.
The "new" IT framework provides a convenient way to package and run integration tests (ITs), but only for core modules. We have a use case to run an IT for a
contribextension: the proposed gRPC query extension. This PR provides the IT framework functionality to allow non-core ITs.The
it.shscript takes an option third parameter to specify the relative path to the Maven module that holds the test:./it.sh test MyCategory extensions-contrib/my-extension-itBecause of the Maven build order, the ITs for an extension must be in a Maven module separate from the extension itself. In this case,
my-extensionis the extension, whilemy-extension-itare the ITs for that extension.The layout in the extension mimics the existing
casesmodule. Provide a Maven file that runs the tests using FailSafe. Provide aclusterdirectory structured as explained in the IT docs.Extra Extensions
Contrib extensions are not added to the base Docker image. They can still be used in a test:
extensionsdirectory in the shared folder (mounted at/sharedin the container.)extensions/my-extn.docker_compose.pyfile:/shared/extensions/my-extnRevision to IT Structure
As part of this work, several changes were made to the structure of the existing IT directory.
templates/Category.pytocluster/Category/docker-compose.py.script peforms pre-test checks. The awkward code that was in.it.shto check for required environment variables moved intoverify.sh`.cluster/Category/setup.shscript does any additional setup needed before launching an IT cluster. Use this to add additional files to theshareddirectory, for example. Using the script is far easier than trying to script in Maven.cases/pom.xml. We were not using them: we now useit.shto do this work.it.shandcluster.shscripts are now aware of two modules: the "base"casesmodule, and the "test" module. Before now, those were the same. Not they can differ.Prevent Snapshot Downloading
Also added configuration to the root
pom.xmlfile to prevent an attempt to download snapshots from upstream. This most often happens when dependencies are missing and Maven cannot find a required Druid module, and instead tries to ask upstream repos. Bad Things would happen if it actually found such jars.Release note
Added the
druid.extensions.pathconfig setting. This setting is optional and is normally not set. Primarily for testing. Seeconfiguration/index.mdfor details.This PR has: