osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PROPOSAL] Move testing utilities to a common place.


Hi all, 

we recently started implementing load tests for core apache beam operations[1] and noticed that there's some code that could be placed in a common module and used by Nexmark, IOIT and the load tests (and therefore not duplicated in multiple places). The examples are: 
  • code for collecting metrics from Nexmark suites. Most of the classes are not coupled with Nexmark related nomenclature or functionality. I mean specifically: Monitor.java, queries for collecting the metrics (getCount/Distribution/TimeMetrics),
  • some of the NexmarkUtils,
  • Gradle configuration and tasks related to testing (where applicable),
  • code for saving the metrics to a BigQuery database. I noticed that this is exactly the same way this should be done in load tests so in order not do duplicate the code it could be also extracted to a common module,
  • possibly more code that could be used in all of the tests (logging, publishing results etc).
Therefore, I propose one of the following: 
  1. creating a module called "sdks/tests" and place "load-tests" and "nexmark" modules inside it. Place the common code in "sdks/tests/common" (or similar) and reuse it in every testing code that needs it.
  2. creating only a module for common code and not migrate nexmark and load-tests modules.
I'm in favor of No. 1. I think it's a consistent way and keeps testing code close.

Please also notice that extracting the above-mentioned code to some common module that can be imported elsewhere will allow using it in other tests like the IOITs. This, in turn, will allow gathering more precise metrics not only in Nexmark and load tests (we could import only the "common" dependency and use it in io's tests).

WDYT? 

Best regards, 
Łukasz