Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Github Action for splitting a test suite for parallelization with equal time

License

NotificationsYou must be signed in to change notification settings

madeddie/actions-split-tests

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Action for splitting a test suite into equal time groups for parallel execution.

Introduction

This actions allows you to split up a suite of tests so they can be executed in parallel across a fleet of runners. The overall goal is to reduce developer feedback time by distributing the load.

Usage

Splitting Methods

File Count (Default)

This is a naive split into an even number of files per group. It is the default splitting method.

Line Count

Another naive split, but this time based on the number of lines per test. It is used by settingline-count: true

JUnit Report

This is the most intelligent split mechanism, using previous execution durations for each test from the JUnit report. It is used by setting thejunit-path to the location of a previous execution's JUnit results report in your repository

Inputs

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
split-indexIndex of this instance executing the testsinteger
split-totalTotal number of instances executing the testsinteger
globGlob pattern to find test files (default "spec/**/*_spec.rb")stringspec/**/*_spec.rb
exclude-globGlob pattern to exclude test filesstring""
junit-pathPath to a JUnit XML report to use for test timingsstring""
line-countUse line count to estimate test durationboolfalse

Outputs

NAMEDESCRIPTIONTYPE
test-suiteA subset of tests, based on the the split index and split typestring
split-indexIndex of this instance executing the testsnumber
split-totalTotal number of instances executing the testsnumber

Example Workflow

env:total-runners:5jobs:runner-indexes:runs-on:ubuntu-latestname:Generate runner indexesoutputs:json:${{ steps.generate-index-list.outputs.json }}steps:      -id:generate-index-listrun:|          MAX_INDEX=$((${{ env.total-runners }}-1))          INDEX_LIST=$(seq 0 ${MAX_INDEX})          INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST})          echo "::set-output name=json::${INDEX_JSON}"run-parallel-tests:runs-on:ubuntu-latestname:"Runner #${{ matrix.runner-index }}: Run test suite in parallel"needs:      -runner-indexesstrategy:matrix:runner-index:${{ fromjson(needs.runner-indexes.outputs.json) }}steps:      -uses:actions/checkout@v2      -uses:chaosaffe/split-tests@v1-alpha.1id:split-testsname:Split testswith:glob:examples/spec/**/*_spec.rbsplit-total:${{ env.total-runners }}split-index:${{ matrix.runner-index }}      -run:'echo "This runner will execute the following tests: ${{ steps.split-tests.outputs.test-suite }}"'

The complete workflow can be found at.github/workflows/example.yaml

Dependencies

This action usesleonid-shevtsov/split_tests under-the-hood to accomplish the test splitting

About

Github Action for splitting a test suite for parallelization with equal time

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp