-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Activate Spotless via Maven property rather than file (#742)
- Loading branch information
Showing
31 changed files
with
439 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>@project.version@</version> | ||
<relativePath/> | ||
</parent> | ||
<groupId>org.jenkins-ci.plugins.its</groupId> | ||
<artifactId>benchmark-it</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<properties> | ||
<jenkins.version>2.361.4</jenkins.version> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>@project.version@</version> | ||
<relativePath /> | ||
</parent> | ||
<groupId>org.jenkins-ci.plugins.its</groupId> | ||
<artifactId>benchmark-it</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<properties> | ||
<jenkins.version>2.361.4</jenkins.version> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</project> |
62 changes: 30 additions & 32 deletions
62
src/it/benchmark/src/test/java/benchmark/BenchmarkRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
package benchmark; | ||
|
||
import jenkins.benchmark.jmh.BenchmarkFinder; | ||
import org.junit.Test; | ||
import org.openjdk.jmh.results.format.ResultFormatType; | ||
import org.openjdk.jmh.runner.Runner; | ||
import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; | ||
import org.openjdk.jmh.runner.options.OptionsBuilder; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
public class BenchmarkRunner { | ||
@Test | ||
public void runThis() throws Exception { | ||
// number of iterations is kept to a minimum just to verify that the benchmarks work without spending extra | ||
// time during builds. | ||
ChainedOptionsBuilder optionsBuilder = | ||
new OptionsBuilder() | ||
.forks(1) | ||
.warmupIterations(1) | ||
.warmupBatchSize(1) | ||
.measurementIterations(1) | ||
.measurementBatchSize(1) | ||
.shouldFailOnError(true) | ||
.result("jmh-report.json") | ||
.timeUnit(TimeUnit.MICROSECONDS) | ||
.resultFormat(ResultFormatType.JSON); | ||
BenchmarkFinder finder = new BenchmarkFinder(getClass()); | ||
finder.findBenchmarks(optionsBuilder); | ||
new Runner(optionsBuilder.build()).run(); | ||
} | ||
} | ||
package benchmark; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
import jenkins.benchmark.jmh.BenchmarkFinder; | ||
import org.junit.Test; | ||
import org.openjdk.jmh.results.format.ResultFormatType; | ||
import org.openjdk.jmh.runner.Runner; | ||
import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; | ||
import org.openjdk.jmh.runner.options.OptionsBuilder; | ||
|
||
public class BenchmarkRunner { | ||
@Test | ||
public void runThis() throws Exception { | ||
// number of iterations is kept to a minimum just to verify that the benchmarks work without spending extra | ||
// time during builds. | ||
ChainedOptionsBuilder optionsBuilder = new OptionsBuilder() | ||
.forks(1) | ||
.warmupIterations(1) | ||
.warmupBatchSize(1) | ||
.measurementIterations(1) | ||
.measurementBatchSize(1) | ||
.shouldFailOnError(true) | ||
.result("jmh-report.json") | ||
.timeUnit(TimeUnit.MICROSECONDS) | ||
.resultFormat(ResultFormatType.JSON); | ||
BenchmarkFinder finder = new BenchmarkFinder(getClass()); | ||
finder.findBenchmarks(optionsBuilder); | ||
new Runner(optionsBuilder.build()).run(); | ||
} | ||
} |
34 changes: 16 additions & 18 deletions
34
src/it/benchmark/src/test/java/benchmark/SampleBenchmark.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package benchmark; | ||
|
||
import jenkins.benchmark.jmh.JmhBenchmark; | ||
import jenkins.benchmark.jmh.JmhBenchmarkState; | ||
import org.openjdk.jmh.annotations.Benchmark; | ||
|
||
import java.io.IOException; | ||
|
||
@JmhBenchmark | ||
public class SampleBenchmark { | ||
public static class MyState extends JmhBenchmarkState { | ||
} | ||
|
||
@Benchmark | ||
public void benchmark(MyState state) throws IOException { | ||
state.getJenkins().setSystemMessage("Hello world"); | ||
} | ||
} | ||
package benchmark; | ||
|
||
import java.io.IOException; | ||
import jenkins.benchmark.jmh.JmhBenchmark; | ||
import jenkins.benchmark.jmh.JmhBenchmarkState; | ||
import org.openjdk.jmh.annotations.Benchmark; | ||
|
||
@JmhBenchmark | ||
public class SampleBenchmark { | ||
public static class MyState extends JmhBenchmarkState {} | ||
|
||
@Benchmark | ||
public void benchmark(MyState state) throws IOException { | ||
state.getJenkins().setSystemMessage("Hello world"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins.its</groupId> | ||
<artifactId>beta-fail</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<groupId>org.jenkins-ci.plugins.its.beta-fail</groupId> | ||
<artifactId>downstream</artifactId> | ||
<packaging>hpi</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jenkins-ci.plugins.its.beta-fail</groupId> | ||
<artifactId>upstream</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins.its</groupId> | ||
<artifactId>beta-fail</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<groupId>org.jenkins-ci.plugins.its.beta-fail</groupId> | ||
<artifactId>downstream</artifactId> | ||
<packaging>hpi</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jenkins-ci.plugins.its.beta-fail</groupId> | ||
<artifactId>upstream</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
src/it/beta-fail/downstream/src/main/java/downstream/Caller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package downstream; | ||
|
||
import upstream.Api; | ||
|
||
public class Caller { | ||
static { | ||
Api.experimental(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>@project.version@</version> | ||
<relativePath/> | ||
</parent> | ||
<groupId>org.jenkins-ci.plugins.its</groupId> | ||
<artifactId>beta-fail</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
<properties> | ||
<jenkins.version>2.361.4</jenkins.version> | ||
<maven-hpi-plugin.disabledTestInjection>true</maven-hpi-plugin.disabledTestInjection> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<modules> | ||
<module>upstream</module> | ||
<module>downstream</module> | ||
</modules> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>@project.version@</version> | ||
<relativePath /> | ||
</parent> | ||
<groupId>org.jenkins-ci.plugins.its</groupId> | ||
<artifactId>beta-fail</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
<modules> | ||
<module>upstream</module> | ||
<module>downstream</module> | ||
</modules> | ||
<properties> | ||
<jenkins.version>2.361.4</jenkins.version> | ||
<spotless.check.skip>false</spotless.check.skip> | ||
<maven-hpi-plugin.disabledTestInjection>true</maven-hpi-plugin.disabledTestInjection> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
assert new File(basedir, 'build.log').text.replaceAll(/\e\[[\d;]*[^\d;]/, '').contains('[ERROR] downstream/Caller:5 upstream/Api.experimental()V is still in beta') | ||
assert new File(basedir, 'build.log').text.replaceAll(/\e\[[\d;]*[^\d;]/, '').contains('[ERROR] downstream/Caller:7 upstream/Api.experimental()V is still in beta') | ||
|
||
return true |
Oops, something went wrong.