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

More than 10 failing, parallel with enclosing blocks #10

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
33 changes: 17 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
pipeline {
agent any

stages {
stage('Build') {
steps {
// Run Maven on a Unix agent.
sh "mvn -Dmaven.test.failure.ignore=true clean verify"
}

post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
junit checksName: 'Testss', testResults: '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/*.jar'
def axes = [
platforms: ['linux', 'windows'],
jdks: [17, 21],
]
def builds = [:]
axes.values().combinations {
def (platform, jdk) = it
builds["${platform}-jdk${jdk}"] = {
node {
stage("${platform.capitalize()} - JDK ${jdk} - Test") {
checkout scm
sh 'sleep 20'
withChecks(name: 'Tests', includeStage: true) {
sh 'mvn -Dmaven.test.failure.ignore=true clean verify'
junit '**/target/surefire-reports/TEST-*.xml'
}
}
}
}
}

parallel builds
90 changes: 90 additions & 0 deletions src/test/java/com/github/App2Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.github;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

/**
* Unit test for simple App.
*/
public class App2Test {
/**
* Rigorous Test :-)
*/
@Test
public void attachment() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(true, is(true));
}

@Test
@Ignore
public void attachment2() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment3() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment4() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(true, is(true));
}

@Test
public void attachment5() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(true, is(true));
}

@Test
@Ignore
public void attachment6() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(true, is(true));
}
}
90 changes: 90 additions & 0 deletions src/test/java/com/github/App3Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.github;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

/**
* Unit test for simple App.
*/
public class App3Test {
/**
* Rigorous Test :-)
*/
@Test
public void attachment() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
@Ignore
public void attachment2() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment3() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment4() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment5() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
@Ignore
public void attachment6() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}
}
90 changes: 90 additions & 0 deletions src/test/java/com/github/App4Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.github;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

/**
* Unit test for simple App.
*/
public class App4Test {
/**
* Rigorous Test :-)
*/
@Test
public void attachment() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
@Ignore
public void attachment2() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment3() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment4() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
public void attachment5() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}

@Test
@Ignore
public void attachment6() throws IOException {
Path file = Paths.get("hello.txt");
List<String> linesInMemory = Collections.singletonList("HEY HEY");
Files.write(file, linesInMemory, StandardCharsets.UTF_8);

System.out.println("[[ATTACHMENT|" + file.toAbsolutePath() + "]]");

assertThat(false, is(true));
}
}
Loading