All Projects → leonid-shevtsov → Split_tests

leonid-shevtsov / Split_tests

Utility to split test files into parallel CI containers

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Split tests

koshry
Run on CI, Apply Rules on the Build and Get the Result back to the Pull Request.
Stars: ✭ 59 (+180.95%)
Mutual labels:  travis-ci, continuous-integration
Clean Marvel Kotlin
This repository contains a detailed sample app that implements Clean architecture and MVP in Kotlin using RxJava2, Retrofit
Stars: ✭ 27 (+28.57%)
Mutual labels:  travis-ci, continuous-integration
cpp14-project-template
A simple, cross-platform, and continuously integrated C++14 project template
Stars: ✭ 64 (+204.76%)
Mutual labels:  travis-ci, continuous-integration
docker-fastpath
Only Build Your Docker Images Once
Stars: ✭ 52 (+147.62%)
Mutual labels:  travis-ci, continuous-integration
travis-minikube
Run minikube on Travis CI
Stars: ✭ 89 (+323.81%)
Mutual labels:  travis-ci, continuous-integration
developer-ci-benefits
Talk docs—includes CI (Continuous Integration) benefits, description, and setup tips 💡💪
Stars: ✭ 29 (+38.1%)
Mutual labels:  travis-ci, continuous-integration
travis
⛔ ARCHIVED ⛔ Set Up 'Travis' for Testing and Deployment
Stars: ✭ 61 (+190.48%)
Mutual labels:  travis-ci, continuous-integration
travis-ci-tutorial-java
Just to learn how to use travis-ci in a java project!
Stars: ✭ 38 (+80.95%)
Mutual labels:  travis-ci, continuous-integration
Builds Tab
Web extension that adds builds tab to Github
Stars: ✭ 24 (+14.29%)
Mutual labels:  continuous-integration, travis-ci
LocalSupport
A directory of local support services and volunteer opportunities
Stars: ✭ 60 (+185.71%)
Mutual labels:  travis-ci, continuous-integration
nightly-docker-rebuild
Use nightli.es 🌔 to rebuild N docker 🐋 images 📦 on hub.docker.com
Stars: ✭ 13 (-38.1%)
Mutual labels:  travis-ci, continuous-integration
Cranium
🤖 A portable, header-only, artificial neural network library written in C99
Stars: ✭ 501 (+2285.71%)
Mutual labels:  continuous-integration, travis-ci
plugin.video.sendtokodi
📺 plays various stream sites on kodi using youtube-dl
Stars: ✭ 86 (+309.52%)
Mutual labels:  travis-ci, continuous-integration
noise-php
A starter-kit for your PHP project.
Stars: ✭ 52 (+147.62%)
Mutual labels:  travis-ci, continuous-integration
continuous-integration-with-python
How to test your python code. How to automatically run your tests for your Python code. How to get reports of the tests coverage
Stars: ✭ 25 (+19.05%)
Mutual labels:  travis-ci, continuous-integration
dump-env
A utility tool to create .env files
Stars: ✭ 81 (+285.71%)
Mutual labels:  travis-ci, continuous-integration
arduino-ci-script
Bash script for continuous integration of Arduino projects
Stars: ✭ 25 (+19.05%)
Mutual labels:  travis-ci, continuous-integration
travis-ci-latex-pdf
Overview of different methods to build LaTeX with GitHub Actions or Travis-CI (idea by @jackolney but completely rewritten by @PHPirates and contributors).
Stars: ✭ 113 (+438.1%)
Mutual labels:  travis-ci, continuous-integration
firebase-ci
Simplified Firebase interaction for continuous integration
Stars: ✭ 71 (+238.1%)
Mutual labels:  travis-ci, continuous-integration
drupal9ci
One-line installers for implementing Continuous Integration in Drupal 9
Stars: ✭ 137 (+552.38%)
Mutual labels:  travis-ci, continuous-integration

split_tests

Splits a test suite into groups of equal time, based on previous tests timings.

This is necessary for running the tests in parallel. As the execution time of test files might vary drastically, you will not get the best split by simply dividing them into even groups.

Compatibility

This tool was written for Ruby and CircleCI, but it can be used with any file-based test suite on any CI. Since then, CircleCI has introduced built-in test splitting. Also since then, the tool has been applied on GitHub Actions, that do not provide test splitting.

It is written in Golang, released as a binary, and has no external dependencies.

Usage

Download and extract the latest build from the releases page.

Using the CircleCI API

Get an API key and set CIRCLECI_API_KEY in the project config.

rspec $(split_tests -circle-project github.com/leonid-shevtsov/split_tests)

(The tool returns the set of files for the current split, joined by spaces.)

Using a JUnit report

rspec $(split_tests -junit -junit-path=report.xml -split-index=$CI_NODE_INDEX -split-total=$CI_NODE_TOTAL)

Or, if it's easier to pipe the report file:

rspec $(curl http://my.junit.url | split_tests -junit -split-index=$CI_NODE_INDEX -split-total=$CI_NODE_TOTAL)

Naive split by line count

If you don't have test times, it might be reasonable for your project to assume runtime proportional to test length.

rspec $(split_tests -line-count)

Naive split by file count

In the absence of prior test times, split_tests can still split files into even groups by count.

rspec $(split_tests)

Arguments

$./split_tests -help

  -circleci-branch string
        Current branch for CircleCI (or set CIRCLE_BRANCH) - required to use CircleCI
  -circleci-key string
        CircleCI API key (or set CIRCLECI_API_KEY environment variable) - required to use CircleCI
  -circleci-project string
        CircleCI project name (e.g. github/leonid-shevtsov/split_tests) - required to use CircleCI
  -glob string
        Glob pattern to find test files (default "spec/**/*_spec.rb")
  -exclude-glob string
        Glob pattern to exclude test files
  -help
        Show this help text
  -junit
        Use a JUnit XML report for test times
  -junit-path string
        Path to a JUnit XML report (leave empty to read from stdin; use glob pattern to load multiple files)
  -line-count
        Use line count to estimate test times
  -split-index int
        This test container's index (or set CIRCLE_NODE_INDEX) (default -1)
  -split-total int
        Total number of containers (or set CIRCLE_NODE_TOTAL) (default -1)

Compilation

This tool is written in Go and uses Go modules.

  • Install Go
  • Checkout the code
  • make

(c) Leonid Shevtsov 2017-2020

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].