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

Make Checkstyle integration test macOS-compatible #867

Merged
merged 5 commits into from
Feb 10, 2024

Conversation

rickie
Copy link
Member

@rickie rickie commented Oct 30, 2023

No description provided.

@rickie
Copy link
Member Author

rickie commented Oct 30, 2023

/integration-test

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member Author

rickie commented Oct 30, 2023

/integration-test

1 similar comment
@rickie
Copy link
Member Author

rickie commented Oct 30, 2023

/integration-test

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member Author

rickie commented Oct 30, 2023

/integration-test

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member Author

rickie commented Oct 30, 2023

/integration-test

1 similar comment
@rickie
Copy link
Member Author

rickie commented Oct 30, 2023

/integration-test

@rickie rickie force-pushed the rossendrijver/mac_compatibility branch from 5975326 to 0c8c90d Compare October 31, 2023 12:32
@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie rickie force-pushed the rossendrijver/mac_compatibility branch from 0c8c90d to 380fcb4 Compare November 10, 2023 07:22
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie rickie marked this pull request as ready for review November 10, 2023 17:20
@rickie
Copy link
Member Author

rickie commented Nov 10, 2023

Either @benhalasi or @mohamedsamehsalah can you try to run this on your Mac and let us know if it works?

@rickie rickie requested a review from Stephan202 November 10, 2023 17:21
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member Author

rickie commented Nov 10, 2023

Ah, I mean the ./integration-tests/checkstyle-10.12.4.sh from the root folder. 😄

@benhalasi
Copy link
Contributor

I've run it:

> ./integration-tests/checkstyle-10.12.4.sh                                       
usage: paste [-s] [-d delimiters] file ...
xargs: ggrep: terminated with signal 13; aborting

@rickie rickie force-pushed the rossendrijver/mac_compatibility branch from a95e69b to 1ccf32d Compare November 13, 2023 07:26
@rickie
Copy link
Member Author

rickie commented Nov 13, 2023

Thanks @benhalasi , I added something I didn't move over. Could you try again?

@rickie rickie requested a review from benhalasi November 13, 2023 07:26
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@benhalasi
Copy link
Contributor

Yep, it runs now, but it says there are unexpected changes:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (error-prone-compile) on project checkstyle: Fatal error compiling: DeleteEmptyMethod is not a valid checker name -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Inspecting changes...
--- /Users/benhalasi/PicnicSupermarket/error-prone-support/integration-tests/checkstyle-10.12.4-expected-changes.patch  2023-11-11 08:39:51
+++ /var/folders/2b/q73x_kyx6s10rrdnjwtv2zb80000gn/T/tmp.C4fad86ddk/checkstyle-10.12.4-changes.patch    2023-11-13 09:33:21
@@ -51469,17 +51469,17 @@
 -import java.util.stream.Collectors;
  import javax.xml.parsers.ParserConfigurationException;
  import org.junit.jupiter.api.BeforeEach;
- import org.junit.jupiter.api.Test;
-@@ -71,7 +70,7 @@ import org.w3c.dom.NamedNodeMap;
- import org.w3c.dom.Node;
+ import org.junit.jupiter.api.Disabled;
+@@ -73,7 +72,7 @@ import org.w3c.dom.Node;
  import org.w3c.dom.NodeList;
  
+ @Disabled("Reason: https://github.com/junit-team/junit5/issues/3536.")
 -public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
 +final class XdocsJavaDocsTest extends AbstractModuleTestSupport {
    private static final Map<String, Class<?>> FULLY_QUALIFIED_CLASS_NAMES =
        ImmutableMap.<String, Class<?>>builder()
            .put("int", int.class)
-@@ -103,16 +102,15 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
+@@ -105,16 +104,15 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
            .build();
  
    private static final Set<String> NON_BASE_TOKEN_PROPERTIES =
@@ -51505,7 +51505,7 @@
  
    private static final List<List<Node>> CHECK_PROPERTIES = new ArrayList<>();
    private static final Map<String, String> CHECK_PROPERTY_DOC = new HashMap<>();
-@@ -130,7 +128,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
+@@ -132,7 +130,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
    }
  
    @BeforeEach
@@ -51514,7 +51514,7 @@
      final DefaultConfiguration checkConfig =
          new DefaultConfiguration(JavaDocCapture.class.getName());
      checker = createChecker(checkConfig);
-@@ -144,7 +142,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
+@@ -146,7 +144,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport {
     *     method
     */
    @Test
@@ -52239,9 +52239,9 @@
  import java.util.stream.Stream;
  import org.itsallcode.io.Capturable;
  import org.itsallcode.junit.sysextensions.SystemOutGuard;
-@@ -40,10 +41,10 @@ import org.junit.jupiter.api.Test;
- import org.junit.jupiter.api.extension.ExtendWith;
+@@ -42,10 +43,10 @@ import org.junit.jupiter.api.extension.ExtendWith;
  
+ @Disabled("Reason: https://github.com/junit-team/junit5/issues/3536.")
  @ExtendWith(SystemOutGuard.class)
 -public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport {
 +final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport {
@@ -52252,7 +52252,7 @@
            "Checker",
            "TreeWalker",
            "JavadocMetadataScraper",
-@@ -67,7 +68,7 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport {
+@@ -69,7 +70,7 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport {
     *     System.out} for error messages
     */
    @Test
@@ -52261,7 +52261,7 @@
        throws Exception {
      systemOut.captureMuted();
  
-@@ -117,12 +118,12 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport {
+@@ -119,12 +120,12 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport {
                .filter(path -> !path.toString().endsWith(".properties"))
                .map(MetadataGeneratorUtilTest::getMetaFileName)
                .sorted()
There are unexpected changes.

@rickie
Copy link
Member Author

rickie commented Nov 13, 2023

Ah those were the changes that I introduced, they shouldn't be there. Let me fix that.

Thanks for checking @benhalasi 🚀 !

@Stephan202 Stephan202 force-pushed the rossendrijver/mac_compatibility branch from 1ccf32d to 0e9b183 Compare November 18, 2023 23:22
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and added a commit; further review TBD.

Comment on lines 1 to 2
diff --git a/pom.xml b/pom.xml
index ca1f3d5..33ad480 100644
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below: let's omit this meta-data.

@rickie rickie force-pushed the sschroevers/update-integration-test branch from 6b3d076 to 4638392 Compare January 30, 2024 14:05
Base automatically changed from sschroevers/update-integration-test to master January 30, 2024 14:18
@rickie rickie force-pushed the rossendrijver/mac_compatibility branch from 2c1f289 to 8cdc569 Compare January 31, 2024 12:03
@rickie
Copy link
Member Author

rickie commented Jan 31, 2024

Rebased and resolved conflict.

Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member Author

rickie commented Jan 31, 2024

/integration-test

@Stephan202 Stephan202 changed the title Make integration-tests setup MacOS compatible Make integration-tests setup macOS compatible Jan 31, 2024
@rickie
Copy link
Member Author

rickie commented Feb 1, 2024

@benhalasi or @mohamedsamehsalah can one of you take a look and try to run the ./integration-tests/checkstyle.sh? 😄

Copy link

github-actions bot commented Feb 1, 2024

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Contributor

@benhalasi benhalasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

run on MacOS, openjdk 17.0.3 2022-04-19

mvnd -DskipTests -Dverification.skip clean install 
./integration-tests/checkstyle.sh
git status

didn't produce any diff!

@Stephan202 Stephan202 force-pushed the rossendrijver/mac_compatibility branch from fa13fd4 to 0d9ef72 Compare February 3, 2024 20:34
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased the branch and added two commits.

Suggested commit message:

Make Checkstyle integration test macOS-compatible (#867)

NB: Initially I observed the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile (error-prone-compile) on project checkstyle: Fatal error compiling: DeleteEmptyMethod is not a valid checker name -> [Help 1]

This happened because the workshop/target directory of the workshop Git branch still existed. This is a bug in the script we may at some point want to fix. (But it's not related to the changes in this PR.)

| sed -r 's,(.*),-Xep:\1:WARN,' \
| grep -v ErrorProneRuntimeClasspath \
| paste -s -d ' '
| xargs -0 ${grep_command} -hoP '[^.]+$' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| xargs -0 ${grep_command} -hoP '[^.]+$' \
| xargs -0 "${grep_command}" -hoP '[^.]+$' \

Comment on lines 193 to 194
echo "Execute the following command to see the changes:"
echo "$ diff -u ${expected_changes} ${actual_changes}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below: the script already prints this output as part of the if-statement; we should call that out.

But also: actual_changes refers to a file in a temporary directory that is cleaned up when the script exits. I'll propose something.

@Stephan202 Stephan202 changed the title Make integration-tests setup macOS compatible Make Checkstyle integration test macOS-compatible Feb 3, 2024
@Stephan202
Copy link
Member

/integration-test

Copy link

github-actions bot commented Feb 3, 2024

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202
Copy link
Member

/integration-test

This build was skipped. Not sure why 🤔.

@rickie
Copy link
Member Author

rickie commented Feb 9, 2024

/integration-test

@rickie rickie force-pushed the rossendrijver/mac_compatibility branch from 0d9ef72 to c178c0b Compare February 9, 2024 17:15
@rickie
Copy link
Member Author

rickie commented Feb 9, 2024

It ran successfully when I posted a comment 🤔. So I'd say let's merge, right? Rebased.

@rickie
Copy link
Member Author

rickie commented Feb 9, 2024

Copy link

github-actions bot commented Feb 9, 2024

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link

sonarqubecloud bot commented Feb 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Stephan202
Copy link
Member

Sure, then let's merge 👍. (I would also have expected it to show up in the check overview, but alas.)

@Stephan202 Stephan202 merged commit 03ba14b into master Feb 10, 2024
16 checks passed
@Stephan202 Stephan202 deleted the rossendrijver/mac_compatibility branch February 10, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task not related to code (build, formatting, process, ...)
Development

Successfully merging this pull request may close these issues.

3 participants