Skip to content
Jean-François Im edited this page Jun 3, 2015 · 1 revision

Writing tests for Pinot 2.0

Test naming

Tests should always have a class name that ends with Test (ie. ControllerTest) with test methods that start with test (ie. testControllerFailover). Integration tests should be clearly identified in the class name (ie. SomethingIntegrationTest) and placed in the pinot-integration-tests Maven project. Use TestNG annotations (eg. @Test, @BeforeClass, @BeforeMethod) to identify test and setUp/tearDown methods.

Test facilities

Various utilities exist to spawn test fixtures and should be used whenever necessary. For example, pinot-common contains ZkTestUtils and KafkaTestUtils to start ZooKeeper and Kafka, respectively. If in doubt as to whether something exists to make writing a test easier or more readable, look at the code for other unit tests or ask pinot-core@linkedin.com.

For integration tests that use several components of the whole stack, BaseClusterIntegrationTest (and its parent, ClusterTest) contains various methods to start brokers, servers and controllers, methods to create resources and tables and methods to send queries and count records in order to make the set up of an integration test only a few lines of code.

Home

Pinot Documentation

Pinot Administration

Contributor

Design Docs

  • Multitenancy
  • Architecture
  • Query Execution
  • [Pinot Core Concepts and Terminology] (Pinot-Core-Concepts-and-Terminology)
  • [Low level kafka Consumers] (Low-level-kafka-consumers)
  • [Expressions & UDF Support] (Expressions-&-UDF-support)

Clone this wiki locally