Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made logs.badge.branch capable of accepting a regular expression #1538

Commits on Jul 21, 2021

  1. New logs.badge.matchBranchRegex config to match multiple branches i…

    …n reporting
    
    By configuring `logs.badge.matchBranchRegex`, it is possible to set multiple branches to report
    their mutation score to upstream tools:
    
    ```json
    {
        "source": {
            "directories": ["src/"]
        },
        "logs": {
            "badge": {
                "matchBranchRegex": "/^release-.*$/"
            }
        }
    }
    ```
    
    Note that `logs.badge.matchBranchRegex` is mutually exclusive with `logs.badge.branch`, which
    is much more restrictive: the two cannot be used together.
    
    Fixes infection#1536
    Ocramius committed Jul 21, 2021
    Configuration menu
    Copy the full SHA
    a0d0b99 View commit details
    Browse the repository at this point in the history
  2. Made logs.badge.branch capable of accepting a regular expression

    By configuring `logs.badge.branch` with a `/`-delimited regular expression, we can collect
    reports about a number of branches.
    
    ```json
    {
        "source": {
            "directories": ["src/"]
        },
        "logs": {
            "badge": {
                "branch": "/^release-.*$/"
            }
        }
    }
    ```
    
    Note that `logs.badge.matchBranchRegex`, initially proposed as an alternative, has also been removed.
    
    We can safely assume that a `branch` value starting and ending with `/` is a regular expression, because
    git branches starting or ending with `/` are not valid anyway.
    
    Fixes infection#1536
    Ocramius committed Jul 21, 2021
    Configuration menu
    Copy the full SHA
    3c1e4da View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fc5634d View commit details
    Browse the repository at this point in the history
  4. Refactored BadgeTest so that we do verify branch match semantics th…

    …rough a data provider
    
    Previously, we had a single test with multiple assertions.
    
    Ref: infection#1538 (comment)
    Ocramius committed Jul 21, 2021
    Configuration menu
    Copy the full SHA
    2925fe2 View commit details
    Browse the repository at this point in the history