Skip to content

Starting up with Tlb

Janmejay Singh edited this page Oct 6, 2010 · 5 revisions

Using TLB

TLB has 2 main components

  1. TLB Balancer
  2. TLB Server

TLB Balancer

The balancer sits in the build script and knows how to split and re-order tests and publish test data.

Balancer contains:

  • Splitter: Which takes care of splitting the given list of tests using given criteria.
  • Orderer: Which takes care of re-ordering the tests based on a given criteria.

For example, the Ant JUnit support is done using Ant FileSets for the JUnit task. This task obtains the historical test data from the TLB Server and uses it to split and order the tests.

In order for the balancer to work, the following environment variables need to be set:

  • TLB_URL
  • TALK_TO_SERVICE
  • TLB_CRITERIA
  • CRITERIA_DEFAULTING_ORDER (required when a specific type of criteria is used, called DefaultingTestSplitterCriteria)
  • TLB_ORDERER
  • TOTAL_PARTITIONS
  • PARTITION_NUMBER
  • TLB_JOB_NAME
  • JOB_VERSION

Given TLB_URL and TALK_TO_SERVICE, the balancer knows how to talk to the Tlb/Go Server. Based on TLB_CRITERIA and CRITERIA_DEFAULTING_ORDER it figures out what information to fetch from the Tlb Server for given TLB_JOB_NAME and JOB_VERSION. TOTAL_PARTITIONS and PARTITION_NUMBER indicate which partition the current process is, and how many splits there are, in sum total, hence allows for actual splitting and selection of the split that the process itself need to execute. As tests in a partition are executed, TLB_JOB_NAME is used to post the test data back to the Tlb Server(so that it can be used for future runs). JOB_VERSION ensures all partitions see the same snapshot of data, hence ensures no test is run on more than one partition, and more importantly, no tests are ignored while partitioning.

For all the configurable environment variables and discription of possible values, please refer Configuration Variables.

Take a look at Splitter/Balancer Criteria Configuration and Orderer Configuration to understand how to configure Splitters and Orderers.
Also, take a look at some Typical Balancer Example Setups

TLB Server

Tlb Server is the repository of the test run data. Tlb Balancer uses the server to obtain historical data and it also posts new data for runs it performs.

Setting up TLB Server talks about the how to configure a Tlb server instance. Also, take a look at some Typical Server Example Setups