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

Release 1.6.2 #851

Merged
merged 27 commits into from
Dec 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
67ef711
update readme for 1.6.1
Dec 8, 2020
69d3956
publish snapshot on merge to master
Dec 10, 2020
2f58459
make report options object available to listeners
Dec 10, 2020
26bf9f7
Reduce travis matrix
Dec 11, 2020
85dcb48
Merge pull request #842 from hcoles/listener-args
hcoles Dec 11, 2020
c6cadf6
Replace travis ci
Dec 11, 2020
2bbc6dc
Remove java 8 linux build from azure pipelines
Dec 11, 2020
3251b05
Merge pull request #843 from hcoles/remove-travis
hcoles Dec 11, 2020
6e64eb0
remove travis badge
Dec 11, 2020
b19db13
Extend feature system to work with listeners
Dec 18, 2020
8e300e8
Bump junit
dependabot[bot] Dec 4, 2020
21a5baf
Bump junit
dependabot[bot] Dec 4, 2020
fbe9931
Bump junit
dependabot[bot] Dec 4, 2020
3399643
Bump junit
dependabot[bot] Dec 4, 2020
6f6f48a
Bump junit
dependabot[bot] Dec 4, 2020
6e3afcb
Bump junit
dependabot[bot] Dec 4, 2020
6d58df1
Bump junit
dependabot[bot] Dec 4, 2020
7bfc1d0
Bump xstream from 1.4.8 to 1.4.15 in /pitest-entry
dependabot[bot] Dec 21, 2020
6132326
add LambdaParameterName module into checkstyle
AlexElin Dec 25, 2020
e34ca99
Bump xstream from 1.4.8 to 1.4.15 in /pitest
dependabot[bot] Dec 21, 2020
88bd740
make feature names case insensitive
Dec 30, 2020
28c26c5
failing test case for #771
Dec 30, 2020
5decb6e
Failing test for #770 and #746
Dec 31, 2020
8ff5d90
Lazily initialise probe field when required
Dec 31, 2020
baa0ba9
Reduce probe visibility for normal classes
Dec 31, 2020
239b19b
Remove xstream noise
Dec 31, 2020
96d4bf5
install for integration tests
Dec 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI
on:
push:
branches:
- 'master'
pull_request:
branches-ignore:
- 'release'
jobs:
supported-jdk:
name: ${{ matrix.title }}
continue-on-error: false
strategy:
fail-fast: false
matrix:
include:
- title: "JDK 8"
java: 8
- title: "JDK 11"
java: 11
- title: "JDK 15"
java: 15
runs-on: ubuntu-latest
steps:
- name: 'Checkout from Git'
uses: actions/checkout@v2
- name: 'Set up JDK ${{ matrix.java }}'
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: 'Display JDK version'
run: java -version
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: 'Test'
# install rather than verify to ensure correct version used during integration test
run: mvn -B install
30 changes: 30 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy snapshot
on:
push:
branches:
- master
jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish JARs
run: mvn -B deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ target/
dependency-reduced-pom.xml
.flattened-pom.xml
*/bin
.DS_Store

48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.pitest/pitest/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/org.pitest/pitest)
[![Build Status](https://travis-ci.org/hcoles/pitest.png?branch=master)](https://travis-ci.org/hcoles/pitest)
![Build Statis](https://github.com/hcoles/pitest/workflows/CI/badge.svg?branch=master)
[![Build Status](https://dev.azure.com/henrycoles/pitest/_apis/build/status/hcoles.pitest?branchName=master)](https://dev.azure.com/henrycoles/pitest/_build/latest?definitionId=3&branchName=master)

Pitest (aka PIT) is a state of the art mutation testing system for Java and the JVM.
Expand All @@ -8,6 +8,14 @@ Read all about it at http://pitest.org

## Releases

### 1.6.1

* Automate release to maven central
* #774 Test strength statistic (thanks @alex859)
* #798 Enable jvm args to be passed from command line (thanks @yfrolov)
* #797 Add line coverage to console (thanks @qxo)
* #822 Mitigate NPE on accidental dependency (thanks @szpak)

### 1.5.2

* #749 ANT support for the fullMutationMatrix option (thanks @ayaankazerouni)
Expand Down
2 changes: 0 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ trigger:

strategy:
matrix:
linux:
imageName: 'Ubuntu-16.04'
mac:
imageName: 'macos-10.14'
windows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName" />
<module name="LambdaParameterName" />
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
Expand Down
2 changes: 1 addition & 1 deletion pitest-entry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.8</version>
<version>1.4.15</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.pitest.mutationtest;

import org.pitest.coverage.CoverageDatabase;
import org.pitest.mutationtest.config.ReportOptions;
import org.pitest.mutationtest.engine.MutationEngine;
import org.pitest.plugin.FeatureSetting;
import org.pitest.util.ResultOutputStrategy;

import java.util.Optional;

/**
* Data passed to the listener MutationResultListener factories for use when
* constructing listeners.
Expand All @@ -16,16 +20,35 @@ public class ListenerArguments {
private final SourceLocator locator;
private final MutationEngine engine;
private final boolean fullMutationMatrix;
private final ReportOptions data;
private final FeatureSetting setting;

public ListenerArguments(ResultOutputStrategy outputStrategy,
CoverageDatabase coverage,
SourceLocator locator,
MutationEngine engine,
long startTime,
boolean fullMutationMatrix,
ReportOptions data) {
this(outputStrategy, coverage, locator, engine, startTime, fullMutationMatrix, data, null);
}

public ListenerArguments(final ResultOutputStrategy outputStrategy,
final CoverageDatabase coverage, final SourceLocator locator,
final MutationEngine engine, final long startTime, final boolean fullMutationMatrix) {
ListenerArguments(ResultOutputStrategy outputStrategy,
CoverageDatabase coverage,
SourceLocator locator,
MutationEngine engine,
long startTime,
boolean fullMutationMatrix,
ReportOptions data,
FeatureSetting setting) {
this.outputStrategy = outputStrategy;
this.coverage = coverage;
this.locator = locator;
this.startTime = startTime;
this.engine = engine;
this.fullMutationMatrix = fullMutationMatrix;
this.data = data;
this.setting = setting;
}

public ResultOutputStrategy getOutputStrategy() {
Expand All @@ -51,4 +74,24 @@ public MutationEngine getEngine() {
public boolean isFullMutationMatrix() {
return fullMutationMatrix;
}

public ReportOptions data() {
return data;
}

public Optional<FeatureSetting> settings() {
return Optional.ofNullable(setting);
}

public ListenerArguments withSetting(FeatureSetting setting) {
return new ListenerArguments(outputStrategy,
coverage,
locator,
engine,
startTime,
fullMutationMatrix,
data,
setting);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@

package org.pitest.mutationtest;

import org.pitest.plugin.Feature;
import org.pitest.plugin.ProvidesFeature;
import org.pitest.plugin.ToolClasspathPlugin;

import java.util.Properties;

import org.pitest.plugin.ToolClasspathPlugin;
public interface MutationResultListenerFactory extends ToolClasspathPlugin, ProvidesFeature {

public interface MutationResultListenerFactory extends ToolClasspathPlugin {
Feature LEGACY_MODE = Feature.named("_internal_activate_by_output_string")
.withOnByDefault(true);

MutationResultListener getListener(Properties props, ListenerArguments args);

String name();

default Feature provides() {
return LEGACY_MODE;
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.pitest.mutationtest.build;

import java.util.Collection;
import java.util.List;
import java.util.function.Function;

import org.pitest.classinfo.ClassByteArraySource;
import org.pitest.functional.FCollection;
import org.pitest.mutationtest.config.ReportOptions;
import org.pitest.plugin.FeatureSelector;
import org.pitest.plugin.FeatureSetting;

import java.util.Collection;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

public class CompoundInterceptorFactory {

private final FeatureSelector<MutationInterceptorFactory> features;
Expand All @@ -22,8 +22,9 @@ public CompoundInterceptorFactory(List<FeatureSetting> features,
public MutationInterceptor createInterceptor(
ReportOptions data,
ClassByteArraySource source) {
final List<MutationInterceptor> interceptors = FCollection.map(this.features.getActiveFeatures(),
toInterceptor(this.features, data, source));
final List<MutationInterceptor> interceptors = this.features.getActiveFeatures().stream()
.map(toInterceptor(this.features, data, source))
.collect(Collectors.toList());
return new CompoundMutationInterceptor(interceptors);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,35 @@
*/
package org.pitest.mutationtest.config;

import java.util.Properties;
import java.util.function.Function;

import org.pitest.functional.FCollection;
import org.pitest.mutationtest.ListenerArguments;
import org.pitest.mutationtest.MutationResultListener;
import org.pitest.mutationtest.MutationResultListenerFactory;
import org.pitest.plugin.Feature;
import org.pitest.plugin.FeatureSelector;
import org.pitest.plugin.FeatureSetting;

import java.util.Collection;
import java.util.List;
import java.util.Properties;
import java.util.function.Function;
import java.util.stream.Collectors;

public class CompoundListenerFactory implements MutationResultListenerFactory {

private final Iterable<MutationResultListenerFactory> children;
private final FeatureSelector<MutationResultListenerFactory> features;

public CompoundListenerFactory(
final Iterable<MutationResultListenerFactory> children) {
this.children = children;
public CompoundListenerFactory(List<FeatureSetting> features, final Collection<MutationResultListenerFactory> children) {
this.features = new FeatureSelector<>(features, children);
}

@Override
public MutationResultListener getListener(final Properties props,
final ListenerArguments args) {
return new CompoundTestListener(FCollection.map(this.children,
factoryToListener(props, args)));
}
final List<MutationResultListener> listeners = this.features.getActiveFeatures().stream()
.map(toListener(props, args))
.collect(Collectors.toList());

private Function<MutationResultListenerFactory, MutationResultListener> factoryToListener(
final Properties props, final ListenerArguments args) {
return a -> a.getListener(props, args);
return new CompoundTestListener(listeners);
}

@Override
Expand All @@ -53,4 +55,13 @@ public String description() {
throw new UnsupportedOperationException();
}

@Override
public Feature provides() {
throw new UnsupportedOperationException();
}

private Function<MutationResultListenerFactory, MutationResultListener> toListener(Properties props,
ListenerArguments args) {
return a -> a.getListener(props, args.withSetting(features.getSettingForFeature(a.provides().name())));
}
}
Loading