Update integration tests to use latest LTS line (#1543)

This commit is contained in:
Tim Jacomb 2021-01-11 08:07:59 +00:00 committed by GitHub
parent fcc722e774
commit 0d3589e231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 98 deletions

View File

@ -1,46 +0,0 @@
# Configure Warnings Next Generation Plugin
The available parsers of the [Warnings Next Generation Plugin](https://plugins.jenkins.io/warnings-ng)
can be specified using the following sample configuration. Afterwards,
these parsers are shown in the `Groovy Based Warnings Parsers` section of the system configuration.
## Sample configuration (parsers)
Required plugin version: 5.0.0 or newer.
```yaml
unclassified:
warningsParsers:
parsers:
- name: "Example parser"
id: example-id
regexp: "^\\s*(.*):(\\d+):(.*):\\s*(.*)$"
script: |
import edu.hm.hafner.analysis.Severity
builder.setFileName(matcher.group(1))
.setLineStart(Integer.parseInt(matcher.group(2)))
.setSeverity(Severity.WARNING_NORMAL)
.setCategory(matcher.group(3))
.setMessage(matcher.group(4))
return builder.buildOptional();
example: "somefile.txt:2:SeriousWarnings:SomethingWentWrong"
```
This `Example Parser` parser will parse the following warning from the console log:
```text
somefile.txt:2:SeriousWarnings:SomethingWentWrong
```
It will produce a warning with the following properties:
| property | value |
|-------------|--------------------|
| file name | somefile.txt |
| line number | 2 |
| severity | NORMAL |
| category | SeriousWarnings |
| type | - |
| message | SomethingWentWrong |
See [documentation](https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md) of the
Warnings Next Generation Plugin for more details about the parsers.

View File

@ -15,6 +15,7 @@
<maven.deploy.skip>true</maven.deploy.skip> <!-- no need to be deployed during release, this is a test-only module -->
<jackson.version>2.11.3</jackson.version>
<netty.version>4.1.52.Final</netty.version>
<jenkins.version>2.263.1</jenkins.version>
</properties>
<dependencies>
@ -193,6 +194,12 @@
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
<exclusions>
<exclusion>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@ -360,13 +367,6 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>warnings</artifactId>
<version>5.0.2</version>
<scope>test</scope>
</dependency>
<!-- required to satisfy upper bound dependencies -->
<dependency>
@ -708,15 +708,10 @@
<artifactId>commons-compress</artifactId>
<version>1.20</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.28</version>
</dependency>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.222.x</artifactId>
<version>13</version>
<artifactId>bom-2.263.x</artifactId>
<version>20</version>
<scope>import</scope>
<type>pom</type>
</dependency>

View File

@ -1,38 +0,0 @@
package io.jenkins.plugins.casc;
import io.jenkins.plugins.analysis.warnings.groovy.GroovyParser;
import io.jenkins.plugins.analysis.warnings.groovy.ParserConfiguration;
import io.jenkins.plugins.casc.misc.ConfiguredWithReadme;
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithReadmeRule;
import org.junit.Rule;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.junit.Assert.assertNotNull;
/**
* @author v1v (Victor Martinez)
*/
public class WarningsTest {
@Rule
public JenkinsConfiguredWithReadmeRule j = new JenkinsConfiguredWithReadmeRule();
@Test
@ConfiguredWithReadme("warnings/README.md")
public void configure_warnings() throws Exception {
final ParserConfiguration configuration = ParserConfiguration.getInstance();
assertNotNull(configuration);
assertThat(configuration.getParsers(), hasSize(1));
GroovyParser parser = configuration.getParsers().get(0);
assertThat(parser.getId(), is("example-id"));
assertThat(parser.getName(), is("Example parser"));
assertThat(parser.getRegexp(), is("^\\s*(.*):(\\d+):(.*):\\s*(.*)$"));
assertThat(parser.getScript(), containsString("import edu.hm.hafner.analysis.Severity"));
assertThat(parser.getExample(), is("somefile.txt:2:SeriousWarnings:SomethingWentWrong"));
}
}