-
Notifications
You must be signed in to change notification settings - Fork 11
Starting up with Tlb
TLB has 2 main components
- TLB Balancer
- TLB Server
The balancer is the code that sits in the build script that knows how to do the splitting, reordering and publishing of test data.
Balancer contains:
- Splitter: This takes care of splitting the given list of tests based on a certain criteria.
- Orderer: This takes care of re-ordering the tests based on a given criteria.
For example, the Ant JUnit support done using Ant FileSets for the JUnit task is a typical balancer. 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 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. 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 balancer need to execute. Once the tests are executed, the 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 figure out how to configure Splitters and Orderers.
Also, take a look at some Typical Balancer Example Setups
Tlb Server is the repository of the test run data. Tlb Balancer uses the server to obtain historical data and it also puts new data for runs.
Setting up TLB Server talks about the how to configure a Tlb server. Also, take a look at some Typical Server Example Setups