From 249f025a434c5b200a6a17ffd21e278a4a7f85bf Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Thu, 13 May 2021 16:06:04 -0400 Subject: [PATCH 01/14] Add coverage for integration tests --- starts-core/pom.xml | 17 +++++++++++++++++ starts-plugin/pom.xml | 29 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/starts-core/pom.xml b/starts-core/pom.xml index 25a0e254..0e11bd02 100755 --- a/starts-core/pom.xml +++ b/starts-core/pom.xml @@ -46,5 +46,22 @@ + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + ../starts-plugin/target/jacoco-it.exec + + + edu/illinois/starts/asm/** + + + + + diff --git a/starts-plugin/pom.xml b/starts-plugin/pom.xml index b2111681..d2cf49e0 100644 --- a/starts-plugin/pom.xml +++ b/starts-plugin/pom.xml @@ -94,6 +94,35 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + pre-integration-test-execution + pre-integration-test + + prepare-agent + + + ${project.build.directory}/jacoco-it.exec + invoker.mavenOpts + + + + post-integration-test-execution + post-integration-test + + report + + + ${project.build.directory}/jacoco-it.exec + ${project.reporting.outputDirectory}/jacoco-it + + + + From 156bff4f3dc45a21b2c4665db8a92251b0f2082b Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Thu, 13 May 2021 16:06:26 -0400 Subject: [PATCH 02/14] Add test for clz --- .../pom.xml | 48 +++++++++++++++++++ .../setup.groovy | 9 ++++ .../src/main/java/inter/Base.java | 25 ++++++++++ .../src/main/java/inter/Child.java | 14 ++++++ .../src/main/java/inter/GrandChild.java | 9 ++++ .../src/main/java/inter/Sibling.java | 9 ++++ .../src/test/java/inter/BaseTest.java | 25 ++++++++++ .../src/test/java/inter/ChildTest.java | 25 ++++++++++ .../src/test/java/inter/GrandChildTest.java | 25 ++++++++++ .../src/test/java/inter/SiblingTest.java | 25 ++++++++++ .../verify.groovy | 17 +++++++ 11 files changed, 231 insertions(+) create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/pom.xml create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/setup.groovy create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Base.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Child.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/GrandChild.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Sibling.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/BaseTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/ChildTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/GrandChildTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/SiblingTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/pom.xml b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/pom.xml new file mode 100644 index 00000000..ae2873ee --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/pom.xml @@ -0,0 +1,48 @@ + + + + + 4.0.0 + + + starts.plugin.it + parent-pom + 1.0-SNAPSHOT + ../parent-pom.xml + + + multilevel-no-parents-or-siblings-it + This integration test checks that the tests selected are only those + that reach a changed class or it's subclasses, but neither tests of + unrelated siblings nor superclasses. + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + touch + validate + + starts + + + CLZ + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + + + diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/setup.groovy b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/setup.groovy new file mode 100644 index 00000000..6095a209 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/setup.groovy @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +import edu.illinois.starts.jdeps.SetupUtil; + +setupUtil = new SetupUtil(new File(basedir, ".starts/deps.zlc")) +file = new File(basedir, "src/main/java/inter/Child.java"); +setupUtil.replaceAllInFile(file, "Set", "Set") diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Base.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Base.java new file mode 100644 index 00000000..0affaa29 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Base.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.LinkedHashSet; +import java.util.Set; + +public class Base { + protected LinkedHashSet output; + + public Base() { + super(); + output = new LinkedHashSet(); + } + + public void add(int a) { + output.add(a); + } + + public Set getSet() { + return output; + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Child.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Child.java new file mode 100644 index 00000000..a8222e3a --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Child.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.Set; + +public class Child extends Base { + @Override + public Set getSet() { + return output; + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/GrandChild.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/GrandChild.java new file mode 100644 index 00000000..5918b4c9 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/GrandChild.java @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +public class GrandChild extends Child { + +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Sibling.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Sibling.java new file mode 100644 index 00000000..f0b15808 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/main/java/inter/Sibling.java @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +public class Sibling extends Base { + +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/BaseTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/BaseTest.java new file mode 100644 index 00000000..898492b6 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/BaseTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class BaseTest { + @Test + public void test() { + Base base = new Base(); + base.add(1); + base.add(2); + base.add(3); + Set out = base.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/ChildTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/ChildTest.java new file mode 100644 index 00000000..cd3c4752 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/ChildTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class ChildTest { + @Test + public void test() { + Child son = new Child(); + son.add(1); + son.add(2); + son.add(3); + Set out = son.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/GrandChildTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/GrandChildTest.java new file mode 100644 index 00000000..b52aecbc --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/GrandChildTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class GrandChildTest { + @Test + public void test() { + GrandChild grand = new GrandChild(); + grand.add(1); + grand.add(2); + grand.add(3); + Set out = grand.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/SiblingTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/SiblingTest.java new file mode 100644 index 00000000..aa2c66ae --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/src/test/java/inter/SiblingTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class SiblingTest { + @Test + public void test() { + Sibling cousin = new Sibling(); + cousin.add(1); + cousin.add(2); + cousin.add(3); + Set out = cousin.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy new file mode 100644 index 00000000..10af7de0 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +import edu.illinois.starts.jdeps.VerifyUtil; + +firstRun = new File(basedir, "first-run.txt"); +verifyUtil = new VerifyUtil(new File(basedir, "build.log")); + +if (!firstRun.exists()) { + firstRun.createNewFile(); + verifyUtil.assertCorrectlyAffected("4"); +} else { + verifyUtil.assertCorrectlyAffected("2"); + verifyUtil.deleteFile(firstRun); + verifyUtil.deleteFile(new File(basedir, ".starts/deps.zlc")); +} From 467140cd1ced74c7a40cfb3ce994ec4a94c99bae Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Tue, 18 May 2021 17:55:08 -0400 Subject: [PATCH 03/14] Add integration test --- .../src/it/multilevel-interfaces-it/pom.xml | 21 +++++++++++++++++++ .../it/multilevel-interfaces-it/setup.groovy | 9 ++++++++ .../src/main/java/inter/BaseA.java | 11 ++++++++++ .../src/main/java/inter/BaseB.java | 7 +++++++ .../src/main/java/inter/Child.java | 21 +++++++++++++++++++ .../src/main/java/inter/GrandChild.java | 15 +++++++++++++ .../src/main/java/inter/Sibling.java | 16 ++++++++++++++ .../src/test/java/inter/ChildTest.java | 19 +++++++++++++++++ .../src/test/java/inter/GrandChildTest.java | 20 ++++++++++++++++++ .../src/test/java/inter/SiblingTest.java | 19 +++++++++++++++++ .../it/multilevel-interfaces-it/verify.groovy | 17 +++++++++++++++ 11 files changed, 175 insertions(+) create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/pom.xml create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/setup.groovy create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseA.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseB.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Child.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/GrandChild.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Sibling.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/ChildTest.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/GrandChildTest.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/SiblingTest.java create mode 100644 starts-plugin/src/it/multilevel-interfaces-it/verify.groovy diff --git a/starts-plugin/src/it/multilevel-interfaces-it/pom.xml b/starts-plugin/src/it/multilevel-interfaces-it/pom.xml new file mode 100644 index 00000000..30a37aaa --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/pom.xml @@ -0,0 +1,21 @@ + + + + + 4.0.0 + + + starts.plugin.it + parent-pom + 1.0-SNAPSHOT + ../parent-pom.xml + + + multilevel-interfaces-it + This integration test checks that the tests selected are only those + that reach a changed class or it's subclasses, but neither tests of + unrelated siblings nor superclasses. + diff --git a/starts-plugin/src/it/multilevel-interfaces-it/setup.groovy b/starts-plugin/src/it/multilevel-interfaces-it/setup.groovy new file mode 100644 index 00000000..bf133466 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/setup.groovy @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +import edu.illinois.starts.jdeps.SetupUtil; + +setupUtil = new SetupUtil(new File(basedir, ".starts/deps.zlc")) +file = new File(basedir, "src/main/java/inter/BaseB.java"); +setupUtil.replaceAllInFile(file, "List", "ArrayList") diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseA.java b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseA.java new file mode 100644 index 00000000..dac13920 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseA.java @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.List; + +public interface BaseA { + public List toStringsBaseA(); +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseB.java b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseB.java new file mode 100644 index 00000000..971ff593 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/BaseB.java @@ -0,0 +1,7 @@ +package inter; + +import java.util.List; + +public interface BaseB { + public List toStringsBaseB(); +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Child.java b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Child.java new file mode 100644 index 00000000..1314a50b --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Child.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + + +import java.util.ArrayList; +import java.util.Arrays; + +public class Child implements BaseA, BaseB { + @Override + public ArrayList toStringsBaseA() { + return new ArrayList<>(Arrays.asList("BaseA", "child")); + } + + @Override + public ArrayList toStringsBaseB() { + return new ArrayList<>(Arrays.asList("BaseB", "child")); + } +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/GrandChild.java b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/GrandChild.java new file mode 100644 index 00000000..4fc5bef3 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/GrandChild.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.ArrayList; +import java.util.Arrays; + +public class GrandChild extends Child { + @Override + public ArrayList toStringsBaseA(){ + return new ArrayList<>(Arrays.asList("BaseA", "GrandChild")); + } +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Sibling.java b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Sibling.java new file mode 100644 index 00000000..be8aa186 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/main/java/inter/Sibling.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.ArrayList; +import java.util.Arrays; + +public class Sibling implements BaseA { + + @Override + public ArrayList toStringsBaseA() { + return new ArrayList<>(Arrays.asList("sibling")); + } +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/ChildTest.java b/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/ChildTest.java new file mode 100644 index 00000000..0209724e --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/ChildTest.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import static org.junit.Assert.assertEquals; + +public class ChildTest { + @Test + public void test() { + assertEquals("1", new ArrayList<>(Arrays.asList("BaseA", "child")), new Child().toStringsBaseA()); + assertEquals("2", new ArrayList<>(Arrays.asList("BaseB", "child")), new Child().toStringsBaseB()); + } +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/GrandChildTest.java b/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/GrandChildTest.java new file mode 100644 index 00000000..9e6f7b56 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/GrandChildTest.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class GrandChildTest { + @Test + public void test() { + assertEquals("1", new ArrayList<>(Arrays.asList("BaseA", "GrandChild")), new GrandChild().toStringsBaseA()); + assertEquals("2", new ArrayList<>(Arrays.asList("BaseB", "child")), new GrandChild().toStringsBaseB()); + } +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/SiblingTest.java b/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/SiblingTest.java new file mode 100644 index 00000000..b8b0498b --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/src/test/java/inter/SiblingTest.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class SiblingTest { + @Test + public void test() { + assertEquals("1", new ArrayList<>(Arrays.asList("sibling")), new Sibling().toStringsBaseA()); + } +} diff --git a/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy b/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy new file mode 100644 index 00000000..85926011 --- /dev/null +++ b/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +import edu.illinois.starts.jdeps.VerifyUtil; + +firstRun = new File(basedir, "first-run.txt"); +verifyUtil = new VerifyUtil(new File(basedir, "build.log")); + +if (!firstRun.exists()) { + firstRun.createNewFile(); + verifyUtil.assertCorrectlyAffected("3"); +} else { + verifyUtil.assertCorrectlyAffected("2"); + verifyUtil.deleteFile(firstRun); + verifyUtil.deleteFile(new File(basedir, ".starts/deps.zlc")); +} From 83e0bc59682842a9462a5be98f2354dac2995627 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Sun, 23 May 2021 22:18:23 -0700 Subject: [PATCH 04/14] Refactor pom files for jacoco - `mvn verify` - `mvn jacoco:merge@merge-id -pl starts-core` - `mvn jacoco:report@report-id -pl starts-core` --- starts-core/pom.xml | 49 ++++++++++++++++++++++++++++++++++++------- starts-plugin/pom.xml | 11 ---------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/starts-core/pom.xml b/starts-core/pom.xml index 0e11bd02..65bd8973 100755 --- a/starts-core/pom.xml +++ b/starts-core/pom.xml @@ -52,14 +52,47 @@ org.jacoco jacoco-maven-plugin ${jacoco.version} - - - ../starts-plugin/target/jacoco-it.exec - - - edu/illinois/starts/asm/** - - + + + report-id + + report + + + + ${project.build.directory}/jacoco-merged.exec + + + edu/illinois/starts/asm/** + + + ${project.reporting.outputDirectory}/jacoco-merged + + + + + merge-id + + merge + + + + + + ${project.basedir}/../ + + + starts-core/target/jacoco.exec + starts-plugin/target/jacoco-it.exec + + + + + ${project.build.directory}/jacoco-merged.exec + + + + diff --git a/starts-plugin/pom.xml b/starts-plugin/pom.xml index d2cf49e0..6e8b03ae 100644 --- a/starts-plugin/pom.xml +++ b/starts-plugin/pom.xml @@ -110,17 +110,6 @@ invoker.mavenOpts - - post-integration-test-execution - post-integration-test - - report - - - ${project.build.directory}/jacoco-it.exec - ${project.reporting.outputDirectory}/jacoco-it - - From 2db3d025d108fe39708435bdc197f97a09ea0bd9 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Mon, 24 May 2021 08:58:49 -0700 Subject: [PATCH 05/14] Add action for generate coverage report --- .github/workflows/coverage.yml | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..a835d4f9 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,42 @@ +name: build + +on: + push: + branches: + - '**' # any branch + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v1 + with: + java-version: '8' + + - name: Build with Maven + run: mvn -B verify --file pom.xml + + - name: Merge coverage + run: mvn jacoco:merge@merge-id -pl starts-core + + - name: Report + run: mvn jacoco:report@report-id -pl starts-core + + - name: Generate JaCoCo Badge + id: jacoco + uses: cicirello/jacoco-badge-generator@v2 + with: + jacoco-csv-file: starts-core/target/site/jacoco-merged/jacoco.csv + generate-branches-badge: true + + - name: Log coverage percentage + run: | + echo "coverage = ${{ steps.jacoco.outputs.coverage }}" + echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" From 101f130b8021cac516817b3839fd43777debd51f Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Mon, 24 May 2021 12:37:34 -0400 Subject: [PATCH 06/14] Add action to comment on PR (#8) * Add action to comment on PR * Allow repeats --- .github/workflows/coverage.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a835d4f9..58beec0c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: build +name: Report coverage on: push: @@ -40,3 +40,13 @@ jobs: run: | echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" + + - name: Add comment to PR + uses: mshick/add-pr-comment@v1 + if: ${{ github.event_name == 'pull_request' }} + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + allow-repeats: true + message: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} + + Branch coverage = ${{ steps.jacoco.outputs.branches }}' From 47255a05a99ab768a69e6aa2dff9f0df033f139e Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Mon, 24 May 2021 09:48:27 -0700 Subject: [PATCH 07/14] Add test with useThirdParty on --- .../pom.xml | 43 +++++++++++++++++++ .../setup.groovy | 9 ++++ .../src/main/java/inter/Base.java | 25 +++++++++++ .../src/main/java/inter/Child.java | 14 ++++++ .../src/main/java/inter/GrandChild.java | 9 ++++ .../src/main/java/inter/Sibling.java | 9 ++++ .../src/test/java/inter/BaseTest.java | 25 +++++++++++ .../src/test/java/inter/ChildTest.java | 25 +++++++++++ .../src/test/java/inter/GrandChildTest.java | 25 +++++++++++ .../src/test/java/inter/SiblingTest.java | 25 +++++++++++ .../verify.groovy | 17 ++++++++ 11 files changed, 226 insertions(+) create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/pom.xml create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/setup.groovy create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Base.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Child.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/GrandChild.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Sibling.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/BaseTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/ChildTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/GrandChildTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/SiblingTest.java create mode 100644 starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/pom.xml b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/pom.xml new file mode 100644 index 00000000..2428bc4e --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + + starts.plugin.it + parent-pom + 1.0-SNAPSHOT + ../parent-pom.xml + + + multilevel-no-parents-or-siblings-it + This integration test checks that the tests selected are only those + that reach a changed class or it's subclasses, but neither tests of + unrelated siblings nor superclasses. + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + touch + validate + + starts + + + true + + + + + + + diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/setup.groovy b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/setup.groovy new file mode 100644 index 00000000..6095a209 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/setup.groovy @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +import edu.illinois.starts.jdeps.SetupUtil; + +setupUtil = new SetupUtil(new File(basedir, ".starts/deps.zlc")) +file = new File(basedir, "src/main/java/inter/Child.java"); +setupUtil.replaceAllInFile(file, "Set", "Set") diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Base.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Base.java new file mode 100644 index 00000000..0affaa29 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Base.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.LinkedHashSet; +import java.util.Set; + +public class Base { + protected LinkedHashSet output; + + public Base() { + super(); + output = new LinkedHashSet(); + } + + public void add(int a) { + output.add(a); + } + + public Set getSet() { + return output; + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Child.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Child.java new file mode 100644 index 00000000..a8222e3a --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Child.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import java.util.Set; + +public class Child extends Base { + @Override + public Set getSet() { + return output; + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/GrandChild.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/GrandChild.java new file mode 100644 index 00000000..5918b4c9 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/GrandChild.java @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +public class GrandChild extends Child { + +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Sibling.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Sibling.java new file mode 100644 index 00000000..f0b15808 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/main/java/inter/Sibling.java @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +public class Sibling extends Base { + +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/BaseTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/BaseTest.java new file mode 100644 index 00000000..898492b6 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/BaseTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class BaseTest { + @Test + public void test() { + Base base = new Base(); + base.add(1); + base.add(2); + base.add(3); + Set out = base.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/ChildTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/ChildTest.java new file mode 100644 index 00000000..cd3c4752 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/ChildTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class ChildTest { + @Test + public void test() { + Child son = new Child(); + son.add(1); + son.add(2); + son.add(3); + Set out = son.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/GrandChildTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/GrandChildTest.java new file mode 100644 index 00000000..b52aecbc --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/GrandChildTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class GrandChildTest { + @Test + public void test() { + GrandChild grand = new GrandChild(); + grand.add(1); + grand.add(2); + grand.add(3); + Set out = grand.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/SiblingTest.java b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/SiblingTest.java new file mode 100644 index 00000000..aa2c66ae --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/src/test/java/inter/SiblingTest.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +package inter; + +import org.junit.Test; +import java.util.Set; +import static org.junit.Assert.assertEquals; + +public class SiblingTest { + @Test + public void test() { + Sibling cousin = new Sibling(); + cousin.add(1); + cousin.add(2); + cousin.add(3); + Set out = cousin.getSet(); + int result = 0; + for (Integer i : out) { + result += i; + } + assertEquals("sum", 6, result); + } +} diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy new file mode 100644 index 00000000..10af7de0 --- /dev/null +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2015 - Present. The STARTS Team. All Rights Reserved. + */ + +import edu.illinois.starts.jdeps.VerifyUtil; + +firstRun = new File(basedir, "first-run.txt"); +verifyUtil = new VerifyUtil(new File(basedir, "build.log")); + +if (!firstRun.exists()) { + firstRun.createNewFile(); + verifyUtil.assertCorrectlyAffected("4"); +} else { + verifyUtil.assertCorrectlyAffected("2"); + verifyUtil.deleteFile(firstRun); + verifyUtil.deleteFile(new File(basedir, ".starts/deps.zlc")); +} From 5d96d6fbe536e24f04bba01b5d01967c8de25d15 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Wed, 26 May 2021 15:16:36 -0700 Subject: [PATCH 08/14] Skip PR comment --- .github/workflows/coverage.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 58beec0c..98cd3f5b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,12 +41,12 @@ jobs: echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" - - name: Add comment to PR - uses: mshick/add-pr-comment@v1 - if: ${{ github.event_name == 'pull_request' }} - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: true - message: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} - - Branch coverage = ${{ steps.jacoco.outputs.branches }}' +# - name: Add comment to PR +# uses: mshick/add-pr-comment@v1 +# if: ${{ github.event_name == 'pull_request' }} +# with: +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# allow-repeats: true +# message: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} +# +# Branch coverage = ${{ steps.jacoco.outputs.branches }}' From 1e001bf67f065ddc7f01aa77f536220395fd2c96 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Wed, 26 May 2021 15:39:52 -0700 Subject: [PATCH 09/14] Add asserts for the exact tests affected --- .../src/it/multilevel-interfaces-it/verify.groovy | 6 ++++++ .../verify.groovy | 8 ++++++++ .../verify.groovy | 8 ++++++++ .../test/java/edu/illinois/starts/jdeps/VerifyUtil.java | 8 ++++++++ 4 files changed, 30 insertions(+) diff --git a/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy b/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy index 85926011..5d97917e 100644 --- a/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy +++ b/starts-plugin/src/it/multilevel-interfaces-it/verify.groovy @@ -10,8 +10,14 @@ verifyUtil = new VerifyUtil(new File(basedir, "build.log")); if (!firstRun.exists()) { firstRun.createNewFile(); verifyUtil.assertCorrectlyAffected("3"); + verifyUtil.assertContains("Running inter.ChildTest"); + verifyUtil.assertContains("Running inter.SiblingTest"); + verifyUtil.assertContains("Running inter.GrandChildTest"); } else { verifyUtil.assertCorrectlyAffected("2"); + verifyUtil.assertContains("Running inter.ChildTest"); + verifyUtil.assertNotContains("Running inter.SiblingTest"); + verifyUtil.assertContains("Running inter.GrandChildTest"); verifyUtil.deleteFile(firstRun); verifyUtil.deleteFile(new File(basedir, ".starts/deps.zlc")); } diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy index 10af7de0..6d1a728f 100644 --- a/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-clz-it/verify.groovy @@ -10,8 +10,16 @@ verifyUtil = new VerifyUtil(new File(basedir, "build.log")); if (!firstRun.exists()) { firstRun.createNewFile(); verifyUtil.assertCorrectlyAffected("4"); + verifyUtil.assertContains("Running inter.ChildTest"); + verifyUtil.assertContains("Running inter.SiblingTest"); + verifyUtil.assertContains("Running inter.BaseTest"); + verifyUtil.assertContains("Running inter.GrandChildTest"); } else { verifyUtil.assertCorrectlyAffected("2"); + verifyUtil.assertContains("Running inter.ChildTest"); + verifyUtil.assertNotContains("Running inter.SiblingTest"); + verifyUtil.assertNotContains("Running inter.BaseTest"); + verifyUtil.assertContains("Running inter.GrandChildTest"); verifyUtil.deleteFile(firstRun); verifyUtil.deleteFile(new File(basedir, ".starts/deps.zlc")); } diff --git a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy index 10af7de0..6d1a728f 100644 --- a/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy +++ b/starts-plugin/src/it/multilevel-no-parents-or-siblings-thirdparty-it/verify.groovy @@ -10,8 +10,16 @@ verifyUtil = new VerifyUtil(new File(basedir, "build.log")); if (!firstRun.exists()) { firstRun.createNewFile(); verifyUtil.assertCorrectlyAffected("4"); + verifyUtil.assertContains("Running inter.ChildTest"); + verifyUtil.assertContains("Running inter.SiblingTest"); + verifyUtil.assertContains("Running inter.BaseTest"); + verifyUtil.assertContains("Running inter.GrandChildTest"); } else { verifyUtil.assertCorrectlyAffected("2"); + verifyUtil.assertContains("Running inter.ChildTest"); + verifyUtil.assertNotContains("Running inter.SiblingTest"); + verifyUtil.assertNotContains("Running inter.BaseTest"); + verifyUtil.assertContains("Running inter.GrandChildTest"); verifyUtil.deleteFile(firstRun); verifyUtil.deleteFile(new File(basedir, ".starts/deps.zlc")); } diff --git a/starts-plugin/src/test/java/edu/illinois/starts/jdeps/VerifyUtil.java b/starts-plugin/src/test/java/edu/illinois/starts/jdeps/VerifyUtil.java index 0a5125ae..f162be4e 100644 --- a/starts-plugin/src/test/java/edu/illinois/starts/jdeps/VerifyUtil.java +++ b/starts-plugin/src/test/java/edu/illinois/starts/jdeps/VerifyUtil.java @@ -33,6 +33,14 @@ public void assertCorrectlyAffected(String value) throws IOException { } } + public void assertContains(String value) { + Assert.assertTrue("Log should contains string: " + value, buildLog.contains(value)); + } + + public void assertNotContains(String value) { + Assert.assertFalse("Log shouldn't contains string: " + value, buildLog.contains(value)); + } + public void deleteFile(File file) { if (file.exists()) { file.delete(); From 1f5f33329ce51f6b78c483c761251082f2df0b64 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Wed, 26 May 2021 15:54:50 -0700 Subject: [PATCH 10/14] Update Github action for adding comments --- .github/workflows/coverage.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 98cd3f5b..c4625236 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,12 +41,17 @@ jobs: echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" -# - name: Add comment to PR -# uses: mshick/add-pr-comment@v1 -# if: ${{ github.event_name == 'pull_request' }} -# with: -# repo-token: ${{ secrets.GITHUB_TOKEN }} -# allow-repeats: true -# message: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} -# -# Branch coverage = ${{ steps.jacoco.outputs.branches }}' + - name: Add comment to PR + uses: actions/github-script@v4 + if: ${{ github.event_name == 'pull_request' }} + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} + + Branch coverage = ${{ steps.jacoco.outputs.branches }}' + }) From dcd79a67aa94f66f167571c7eba09f61b61ffb85 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Wed, 26 May 2021 16:10:36 -0700 Subject: [PATCH 11/14] Fix pr comment (#11) --- .github/workflows/coverage.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c4625236..11e50900 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -51,7 +51,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} - - Branch coverage = ${{ steps.jacoco.outputs.branches }}' + body: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }}\n\nBranch coverage = ${{ steps.jacoco.outputs.branches }}' }) From 87523a67f4113d99890da777d74ecfb34fc4cef7 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Wed, 26 May 2021 22:17:23 -0700 Subject: [PATCH 12/14] Skip comments --- .github/workflows/coverage.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 11e50900..d440dc88 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,15 +41,15 @@ jobs: echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" - - name: Add comment to PR - uses: actions/github-script@v4 - if: ${{ github.event_name == 'pull_request' }} - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }}\n\nBranch coverage = ${{ steps.jacoco.outputs.branches }}' - }) +# - name: Add comment to PR +# uses: actions/github-script@v4 +# if: ${{ github.event_name == 'pull_request' }} +# with: +# github-token: ${{secrets.GITHUB_TOKEN}} +# script: | +# github.issues.createComment({ +# issue_number: context.issue.number, +# owner: context.repo.owner, +# repo: context.repo.repo, +# body: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }}\n\nBranch coverage = ${{ steps.jacoco.outputs.branches }}' +# }) From 16208afda2291e7c25bc471c4a4412c1fb9407d4 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Wed, 26 May 2021 23:18:22 -0700 Subject: [PATCH 13/14] Add error to comments --- .github/workflows/coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d440dc88..4eac8726 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,6 +41,7 @@ jobs: echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" +# Getting: RequestError [HttpError]: Resource not accessible by integration # - name: Add comment to PR # uses: actions/github-script@v4 # if: ${{ github.event_name == 'pull_request' }} From 0b2a0214c49373cec448ae2063667061358a94d3 Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Thu, 27 May 2021 10:12:55 -0700 Subject: [PATCH 14/14] Commit to retry --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4eac8726..2b9bb2b1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,7 +41,7 @@ jobs: echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" -# Getting: RequestError [HttpError]: Resource not accessible by integration +# Getting: RequestError [HttpError]: Resource not accessible by integration # - name: Add comment to PR # uses: actions/github-script@v4 # if: ${{ github.event_name == 'pull_request' }}