Compare commits
No commits in common. "f43b3e18d2dde0204f68371405dc6f1fad3f3b77" and "9625db4b62df82afb6fa41505774c2fed42e150e" have entirely different histories.
f43b3e18d2
...
9625db4b62
7 changed files with 23 additions and 67 deletions
20
.github/workflows/bld.yml
vendored
20
.github/workflows/bld.yml
vendored
|
@ -1,16 +1,14 @@
|
|||
name: bld-ci
|
||||
|
||||
on: [ push, pull_request, workflow_dispatch ]
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build-bld-project:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 17, 21, 24 ]
|
||||
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
java-version: [17, 21, 24]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
@ -24,16 +22,8 @@ jobs:
|
|||
distribution: "zulu"
|
||||
java-version: ${{ matrix.java-version }}
|
||||
|
||||
- name: Download dependencies [examples]
|
||||
working-directory: examples
|
||||
run: ./bld download
|
||||
|
||||
- name: Run tests with JaCoCo [examples]
|
||||
working-directory: examples
|
||||
run: ./bld compile jacoco
|
||||
|
||||
- name: Download dependencies
|
||||
run: ./bld download
|
||||
|
||||
- name: Run tests
|
||||
run: ./bld compile test
|
||||
run: ./bld compile test
|
||||
|
|
6
examples/.idea/bld.xml
generated
6
examples/.idea/bld.xml
generated
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BldConfiguration">
|
||||
<events />
|
||||
</component>
|
||||
</project>
|
|
@ -1,8 +1,8 @@
|
|||
bld.downloadExtensionJavadoc=false
|
||||
bld.downloadExtensionSources=true
|
||||
bld.downloadLocation=
|
||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10-SNAPSHOT
|
||||
bld.extension-testng=com.uwyn.rife2:bld-testng:1.0.3-SNAPSHOT
|
||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.9
|
||||
bld.extension-testng=com.uwyn.rife2:bld-testng:1.0.2
|
||||
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||
bld.sourceDirectories=
|
||||
bld.version=2.2.1
|
||||
|
|
|
@ -6,6 +6,7 @@ import rife.bld.extension.JacocoReportOperation;
|
|||
import rife.bld.extension.TestNgOperation;
|
||||
import rife.bld.operations.TestOperation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.Level;
|
||||
|
@ -16,7 +17,7 @@ import static rife.bld.dependencies.Scope.test;
|
|||
|
||||
/**
|
||||
* Example build.
|
||||
*
|
||||
*
|
||||
* <pre>{@code
|
||||
* ./bld compile test
|
||||
* ./bld compile jacoco
|
||||
|
|
|
@ -33,7 +33,7 @@ public class TestNgOperationBuild extends Project {
|
|||
public TestNgOperationBuild() {
|
||||
pkg = "rife.bld.extension";
|
||||
name = "bld-testng";
|
||||
version = version(1, 0, 3, "SNAPSHOT");
|
||||
version = version(1, 0, 2);
|
||||
|
||||
javaRelease = 17;
|
||||
|
||||
|
@ -100,13 +100,10 @@ public class TestNgOperationBuild extends Project {
|
|||
|
||||
@Override
|
||||
public void test() throws Exception {
|
||||
var os = System.getProperty("os.name");
|
||||
if (os != null && os.toLowerCase().contains("linux")) {
|
||||
new ExecOperation()
|
||||
.fromProject(this)
|
||||
.command("scripts/cliargs.sh")
|
||||
.execute();
|
||||
}
|
||||
new ExecOperation()
|
||||
.fromProject(this)
|
||||
.command("scripts/cliargs.sh")
|
||||
.execute();
|
||||
super.test();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,19 +75,6 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
|||
return this;
|
||||
}
|
||||
|
||||
private String buildClassPath(String... path) {
|
||||
var classpath = new StringBuilder();
|
||||
for (var p : path) {
|
||||
if (!p.isBlank()) {
|
||||
if (!classpath.isEmpty()) {
|
||||
classpath.append(File.pathSeparator);
|
||||
}
|
||||
classpath.append(p);
|
||||
}
|
||||
}
|
||||
return classpath.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets the default maximum number of threads to use for data providers when running tests in parallel.
|
||||
* It will only take effect if the parallel mode has been selected (for example,with the
|
||||
|
@ -215,13 +202,11 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
|||
|
||||
args.add("-cp");
|
||||
if (testClasspath_.isEmpty()) {
|
||||
args.add(buildClassPath(joinClasspathJar(project_.testClasspathJars()),
|
||||
joinClasspathJar(project_.compileClasspathJars()),
|
||||
joinClasspathJar(project_.providedClasspathJars()),
|
||||
project_.buildMainDirectory().getAbsolutePath(),
|
||||
project_.buildTestDirectory().getAbsolutePath()));
|
||||
args.add(String.format("%s:%s:%s:%s", new File(project_.libTestDirectory(), "*"),
|
||||
new File(project_.libCompileDirectory(), "*"), project_.buildMainDirectory(),
|
||||
project_.buildTestDirectory()));
|
||||
} else {
|
||||
args.add(String.join(File.pathSeparator, testClasspath_));
|
||||
args.add(String.join(":", testClasspath_));
|
||||
}
|
||||
|
||||
args.add("org.testng.TestNG");
|
||||
|
@ -239,7 +224,7 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
|||
} catch (IOException ioe) {
|
||||
if (LOGGER.isLoggable(Level.SEVERE) && !silent()) {
|
||||
LOGGER.severe("An IO error occurred while accessing the default testng.xml file: "
|
||||
+ ioe.getMessage());
|
||||
+ ioe.getMessage());
|
||||
}
|
||||
throw new RuntimeException(ioe);
|
||||
}
|
||||
|
@ -387,14 +372,6 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
|||
return this;
|
||||
}
|
||||
|
||||
private String joinClasspathJar(List<File> jars) {
|
||||
if (!jars.isEmpty()) {
|
||||
return String.join(File.pathSeparator, jars.stream().map(File::getAbsolutePath).toList());
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of {@code .class} files or list of class names implementing {@code ITestListener} or
|
||||
* {@code ISuiteListener}
|
||||
|
@ -1079,10 +1056,10 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
|||
var temp = tempFile();
|
||||
try (var bufWriter = Files.newBufferedWriter(Paths.get(temp.getPath()))) {
|
||||
bufWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
|
||||
"<!DOCTYPE suite SYSTEM \"https://testng.org/testng-1.0.dtd\">" +
|
||||
"<suite name=\"bld Default Suite\" verbose=\"2\">" +
|
||||
"<test name=\"All Packages\">" +
|
||||
"<packages>");
|
||||
"<!DOCTYPE suite SYSTEM \"https://testng.org/testng-1.0.dtd\">" +
|
||||
"<suite name=\"bld Default Suite\" verbose=\"2\">" +
|
||||
"<test name=\"All Packages\">" +
|
||||
"<packages>");
|
||||
for (var p : packages_) {
|
||||
bufWriter.write(String.format("<package name=\"%s\"/>", p));
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@ package rife.bld.extension;
|
|||
|
||||
import org.assertj.core.api.AutoCloseableSoftAssertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
import rife.bld.Project;
|
||||
import rife.bld.blueprints.BaseProjectBlueprint;
|
||||
import rife.bld.operations.exceptions.ExitStatusException;
|
||||
|
@ -53,7 +51,6 @@ class TestNgOperationTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@EnabledOnOs(OS.LINUX)
|
||||
void testCheckAllParameters() throws IOException {
|
||||
var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue