Simplify status checks output for "error" and "unstable" steps #125
24 new issues
Total | New | Outstanding | Fixed | Trend |
---|---|---|---|---|
24 | 24 | 0 | 0 | 👎 |
Reference build: Plugins » checks-api-plugin » master #255
Details
Severity distribution of new issues
Error | Warning High | Warning Normal | Warning Low |
---|---|---|---|
0 | 0 | 0 | 24 |
Annotations
Check warning on line 75 in src/test/java/io/jenkins/plugins/checks/steps/WithChecksStepITest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>job.setDefinition(asStage("withChecks('test injection') { publishChecks() }")); buildSuccessfully(job); assertThat(PUBLISHER_FACTORY.getPublishedChecks().size()).isEqualTo(2); ChecksDetails autoChecks = PUBLISHER_FACTORY.getPublishedChecks().get(0); ChecksDetails manualChecks = PUBLISHER_FACTORY.getPublishedChecks().get(1); assertThat(autoChecks.getName()).isPresent().get().isEqualTo("test injection"); assertThat(autoChecks.getStatus()).isEqualTo(ChecksStatus.IN_PROGRESS); assertThat(autoChecks.getConclusion()).isEqualTo(ChecksConclusion.NONE); assertThat(manualChecks.getName()).isPresent().get().isEqualTo("test injection");</code></pre>
Check warning on line 98 in src/test/java/io/jenkins/plugins/checks/steps/WithChecksStepITest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>job.setDefinition(asStage("withChecks('test injection') { publishChecks() }")); buildSuccessfully(job); assertThat(PUBLISHER_FACTORY.getPublishedChecks().size()).isEqualTo(2); ChecksDetails autoChecks = PUBLISHER_FACTORY.getPublishedChecks().get(0); ChecksDetails manualChecks = PUBLISHER_FACTORY.getPublishedChecks().get(1); assertThat(autoChecks.getName()).isPresent().get().isEqualTo("test injection"); assertThat(autoChecks.getStatus()).isEqualTo(ChecksStatus.IN_PROGRESS); assertThat(autoChecks.getConclusion()).isEqualTo(ChecksConclusion.NONE); assertThat(manualChecks.getName()).isPresent().get().isEqualTo("test injection");</code></pre>
Check warning on line 31 in src/test/java/io/jenkins/plugins/checks/api/ChecksOutputTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldBuildCorrectlyWithAllFields() { final List<ChecksAnnotation> annotations = createAnnotations(); final List<ChecksImage> images = createImages(); final ChecksOutput checksOutput = new ChecksOutputBuilder() .withTitle(TITLE) .withSummary(SUMMARY) .withText(TEXT) .withAnnotations(annotations.subList(0, 1)) .addAnnotation(annotations.get(1)) .withImages(images.subList(0, 1)) .addImage(images.get(1)) .build();</code></pre>
Check warning on line 85 in src/test/java/io/jenkins/plugins/checks/api/ChecksOutputTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldBuildCorrectlyWithAllFields() { final List<ChecksAnnotation> annotations = createAnnotations(); final List<ChecksImage> images = createImages(); final ChecksOutput checksOutput = new ChecksOutputBuilder() .withTitle(TITLE) .withSummary(SUMMARY) .withText(TEXT) .withAnnotations(annotations.subList(0, 1)) .addAnnotation(annotations.get(1)) .withImages(images.subList(0, 1)) .addImage(images.get(1)) .build();</code></pre>
Check warning on line 42 in src/test/java/io/jenkins/plugins/checks/api/ChecksAnnotationTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>assertThat(annotation) .hasPath(Optional.of(PATH)) .hasStartLine(Optional.of(20)).hasEndLine(Optional.of(20)) .hasAnnotationLevel(ChecksAnnotationLevel.NOTICE) .hasMessage(Optional.of(MESSAGE)) .hasStartColumn(Optional.of(33)).hasEndColumn(Optional.of(38)) .hasTitle(Optional.of(TITLE)) .hasRawDetails(Optional.of(RAW_DETAILS));</code></pre>
Check warning on line 84 in src/test/java/io/jenkins/plugins/checks/api/ChecksAnnotationTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>assertThat(annotation) .hasPath(Optional.of(PATH)) .hasStartLine(Optional.of(20)).hasEndLine(Optional.of(20)) .hasAnnotationLevel(ChecksAnnotationLevel.NOTICE) .hasMessage(Optional.of(MESSAGE)) .hasStartColumn(Optional.of(33)).hasEndColumn(Optional.of(38)) .hasTitle(Optional.of(TITLE)) .hasRawDetails(Optional.of(RAW_DETAILS));</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>details = checksDetails.get(8); assertThat(details.getStatus()).isEqualTo(ChecksStatus.COMPLETED); assertThat(details.getConclusion()).isEqualTo(ChecksConclusion.FAILURE); assertThat(details.getOutput()).isPresent().get().satisfies(output -> { assertThat(output.getTitle()).isPresent().get().isEqualTo("Fails: a fatal error occurs");</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>details = checksDetails.get(8); assertThat(details.getStatus()).isEqualTo(ChecksStatus.COMPLETED); assertThat(details.getConclusion()).isEqualTo(ChecksConclusion.FAILURE); assertThat(details.getOutput()).isPresent().get().satisfies(output -> { assertThat(output.getTitle()).isPresent().get().isEqualTo("Fails: a fatal error occurs");</code></pre>
Check warning on line 103 in src/test/java/io/jenkins/plugins/checks/api/TruncatedStringTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>assertThat(build(10)).isEqualTo(""); assertThat(buildRawString()).isEqualTo(""); builder.addText("xxxxxxxxxxxxxx\n"); // 15 assertThat(build(10)).isEqualTo("Truncated"); assertThatThrownBy(() -> { build(5); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("Maximum length is less than truncation text."); } @Test public void shouldHandleReversedChunking() {<!-- --></code></pre>
Check warning on line 129 in src/test/java/io/jenkins/plugins/checks/api/TruncatedStringTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>assertThat(build(10)).isEqualTo(""); assertThat(buildRawString()).isEqualTo(""); builder.addText("xxxxxxxxxxxxxx\n"); // 15 assertThat(build(10)).isEqualTo("Truncated"); assertThatThrownBy(() -> { build(5); }).isInstanceOf(IllegalArgumentException.class) .hasMessage("Maximum length is less than truncation text."); } @Test public void shouldHandleReversedChunking() {<!-- --></code></pre>
Check warning on line 60 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>ChecksConclusion.NONE); StepExecution execution = step.start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName("Jenkins") .withStatus(ChecksStatus.IN_PROGRESS) .withConclusion(ChecksConclusion.NONE)</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>ChecksConclusion.NONE); StepExecution execution = step.start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName("Jenkins") .withStatus(ChecksStatus.IN_PROGRESS) .withConclusion(ChecksConclusion.NONE)</code></pre>
Check warning on line 59 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>PublishChecksStep step = createPublishChecksStep("an in progress build", ChecksStatus.IN_PROGRESS, ChecksConclusion.NONE); StepExecution execution = step.start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName("Jenkins") .withStatus(ChecksStatus.IN_PROGRESS)</code></pre>
Check warning on line 81 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>PublishChecksStep step = createPublishChecksStep("an in progress build", ChecksStatus.IN_PROGRESS, ChecksConclusion.NONE); StepExecution execution = step.start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName("Jenkins") .withStatus(ChecksStatus.IN_PROGRESS)</code></pre>
Check warning on line 81 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>ChecksConclusion.NONE); StepExecution execution = step.start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName("Jenkins") .withStatus(ChecksStatus.QUEUED)</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>ChecksConclusion.NONE); StepExecution execution = step.start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName("Jenkins") .withStatus(ChecksStatus.QUEUED)</code></pre>
Check warning on line 33 in src/test/java/io/jenkins/plugins/checks/api/ChecksAnnotationTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldBuildCorrectlyWithAllFields() { final ChecksAnnotation annotation = new ChecksAnnotationBuilder() .withPath(PATH) .withStartLine(20).withEndLine(20) .withAnnotationLevel(ChecksAnnotationLevel.NOTICE) .withMessage(MESSAGE) .withStartColumn(33).withEndColumn(38) .withTitle(TITLE) .withRawDetails(RAW_DETAILS) .build();</code></pre>
Check warning on line 74 in src/test/java/io/jenkins/plugins/checks/api/ChecksAnnotationTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldBuildCorrectlyWithAllFields() { final ChecksAnnotation annotation = new ChecksAnnotationBuilder() .withPath(PATH) .withStartLine(20).withEndLine(20) .withAnnotationLevel(ChecksAnnotationLevel.NOTICE) .withMessage(MESSAGE) .withStartColumn(33).withEndColumn(38) .withTitle(TITLE) .withRawDetails(RAW_DETAILS) .build();</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>private StepContext createStepContext() throws IOException, InterruptedException { StepContext context = mock(StepContext.class); when(context.get(Run.class)).thenReturn(mock(Run.class)); when(context.get(TaskListener.class)).thenReturn(TaskListener.NULL);</code></pre>
Check warning on line 19 in src/test/java/io/jenkins/plugins/checks/steps/WithChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>private StepContext createStepContext() throws IOException, InterruptedException { StepContext context = mock(StepContext.class); when(context.get(Run.class)).thenReturn(mock(Run.class)); when(context.get(TaskListener.class)).thenReturn(TaskListener.NULL);</code></pre>
Check warning on line 35 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>StepExecution execution = new PublishChecksStep().start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName(StringUtils.EMPTY)</code></pre>
Check warning on line 58 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>StepExecution execution = new PublishChecksStep().start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName(StringUtils.EMPTY)</code></pre>
Check warning on line 80 in src/test/java/io/jenkins/plugins/checks/steps/PublishChecksStepTest.java
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>StepExecution execution = new PublishChecksStep().start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName(StringUtils.EMPTY)</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>StepExecution execution = new PublishChecksStep().start(createStepContext()); assertThat(execution).isInstanceOf(PublishChecksStep.PublishChecksStepExecution.class); assertThat(((PublishChecksStep.PublishChecksStepExecution)execution).extractChecksDetails()) .usingRecursiveComparison() .isEqualTo(new ChecksDetails.ChecksDetailsBuilder() .withName(StringUtils.EMPTY)</code></pre>