2017 © Pedro Peláez
 

library game-of-tests-laravel

Laravel package for a Game of Tests.

image

swisnl/game-of-tests-laravel

Laravel package for a Game of Tests.

  • Thursday, July 12, 2018
  • by swisnl
  • Repository
  • 13 Watchers
  • 7 Stars
  • 142 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 16 Versions
  • 4 % Grown

The README.md

Game of Tests laravel

Latest Stable Version License, (*1)

This package aims to enable a quick implementation of a Game of Tests in Laravel. Is uses the package swisnl/game-of-tests and gives you a set of commands and basic templates to make your own Game of Tests., (*2)

This package serves as a way to search through git repositories and find PHP tests. I was inspired by the the Spotify testing game I ran in to., (*3)

The reason i wanted to my own implementation for PHP was to help gamify testing in the company and encourage testing in general in the teams., (*4)

, (*5)

How does it work?

The Game of Tests works by scanning Git repositories and scanning for known test files. It uses Git blame to attribute tests to developers. You can update through multiple artisan commands for Github, bare directories, or single repositories., (*6)

For now it supports PhpUnit, Codeception and Behat for PHP and Ava, Jasmine, Jest, Mocha, Tape and QUnit for JavaScript and True for SCSS. Feel free to contribute new parsers to swisnl/game-of-tests., (*7)

Demo

I made a demo available which uses this package and show the Game of Tests for the Laravel Github organisation at http://gameoftests.swis.nl. For in information on installing the demo locally, please check out swisnl/game-of-tests-laravel-demo., (*8)

Author

Created by Björn Brala (@bbrala)., (*9)

Installation

  1. Require this repository

composer require swisnl/game-of-tests-laravel, (*10)

  1. Add the service provider to app.php
    ...
    \Swis\GotLaravel\Providers\GameOfTestsProvider::class,
    ...
  1. Publish and run the migration
php artisan vendor:publish --tag="migrations"
php artisan migrate
  1. (optional) Publish the config and views
php artisan vendor:publish --tag="config"
php artisan vendor:publish --tag="views"

This published the config. See Configuration for the available options., (*11)

Available routes

Routes are based on the configuration of route-prefix. Default value is got., (*12)

URL Description
/got List ranking of all time
/got/score-for-month Ranking of the current month. Optionally you can add: ?monthsBack=[months] to go back any amount of months. For example to get the tests of last month: app.url/got/score-for-month?monthsBack=1.
/got/score-for-months-back Ranking of the last [months] months (default 1 month). You can add: ?monthsBack=[months] to go back any amount of months. For example to get the tests of last 3 months: app.url/got/score-for-month?monthsBack=3.
/got/{user} List of parsed tests of {user}. You can add: ?fromMonthsBack=[months] to go back any amount of months. For example to get the tests of last 3 months: app.url/got/bjorn-brala?fromMonthsBack=3, or you can add ?monthsBack=[months] to show results for [months] back. For example to get the tests of last month: app.url/got/bjorn-brala?monthsBack=1.

Commands

You have a few commands available to update your data., (*13)

got:inspect-directory

Inspect a directory with bare resposities., (*14)

Usage:
  got:inspect-directory [options] [--] <directory>

Arguments:
  directory

Options:
      --skippast[=SKIPPAST]  Skip all before (and including) this
      --modified[=MODIFIED]  Repository modified since (uses strtotime)
      --only[=ONLY]          Skip every directory except this one
      --dry-run              Only inspect, do not insert into the database

got:inspect-github

Inspect a github organisation., (*15)

Usage:
  got:inspect-github [options] [--] <organisation>

Arguments:
  organisation

Options:
      --modified[=MODIFIED]  Repository modified since (uses strtotime)
      --dry-run              Only inspect, do not insert into the database

got:inspect

Inspect a Git url., (*16)

Usage:
  got:inspect [options] [--] <repositoryUrl>

Arguments:
  repositoryUrl

Options:
      --dry-run   Only inspect, do not insert into the database

got:normalize-names

Normalize author names based on the config setting., (*17)

Usage:
  got:normalize-names

Configuration

normalize-names

normalize-names : array, (*18)

Normalize the names in the array to one single result. Sometimes people are bad with their git name. This will normalize names of committees to the array key., (*19)

Example

'Björn Brala' => ['bjorn', 'bbrala'], (*20)

route-prefix

route-prefix : string, (*21)

Prefix for Game of Tests routes., (*22)

Example

'route-prefix' => 'got', (*23)

excluded-remotes

excluded-remotes : array, (*24)

What remote should not be included in the statistics. This is database LIKE argument., (*25)

Example

'excluded-remotes' => [
    'git@bitbucket.org:swisnl/test-%',
]

excluded-filenames

excluded-filenames : array, (*26)

What filename should not be included in the statistics. This is database LIKE argument., (*27)

Example

'excluded-filenames' => [
    'tests/ExampleTest.php',
    'vendor/%',
    'tests/_%',
]

excluded-authors

excluded-authors : array, (*28)

What authors should not be included in the statistics. This is database LIKE argument., (*29)

cache

cache : boolean (default true), (*30)

Enable caching for GitHub requests so rate limiting is not a problem., (*31)

Example

'excluded-authors' => [
    'Automated Commiter',
    'System'
]

The Versions

12/07 2018
05/06 2017

dev-laravel-upgrade

dev-laravel-upgrade

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

05/06 2017
22/08 2016
02/08 2016
02/08 2016

dev-github-api-2

dev-github-api-2

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

01/08 2016

1.0.0-rc4

1.0.0.0-RC4

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

29/07 2016

1.0.0-rc3

1.0.0.0-RC3

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

29/07 2016

0.1.3

0.1.3.0

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

29/07 2016

1.0.0-rc2

1.0.0.0-RC2

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

29/07 2016

1.0.0-rc1

1.0.0.0-RC1

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

14/07 2016

0.1.2

0.1.2.0

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

11/07 2016

0.1.1

0.1.1.0

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests

11/07 2016

0.1.0

0.1.0.0

Laravel package for a Game of Tests.

  Sources   Download

MIT

The Requires

 

laravel game-of-tests