Details

    • Type: Documentation
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.19.1
    • Fix Version/s: 2.20
    • Component/s: None
    • Labels:
      None
    • Environment:
      Probably any environment

      Description

      It would be good to clarify the %regex ... feature:

      1. While it is said to be regular expression, it really is a regular expression + ".class" kind of thing. This does not work (while it is proper regex):

      .+\.class

      The following works (while it is not proper regex):

      .+.class

      2. Clarify that one is supposed to match slashes between packages and class name, not periods. The following current documentation doesn't clarify that by just using ".*":

      !%regex[pkg.*Slow.*.class]

      3. Clarify what the expectations are in terms of escaping characters

      I just spend literally ten hours figuring out a complex regex, going into TeamCity (which by itself complicated the troubleshooting for me), and the documentation could have saved my butt, here.

        Issue Links

          Activity

          Hide
          tibor17 Tibor Digana added a comment - - edited

          Sander Verhagen
          Dependencies in Surefire are very old and these have the facility to filer files using regex.
          The regex including slashes are platform dependent which would be %regex[my\/package\/???ExcludedTest\.class].
          But platform dependent slashes are not good and therefore we are not mentioning them and the documentation specifies rather simple form: %regex[pkg.*Slow.*.class].
          I personally do not like it because it is a mixture of using dots which is known in fully qualified class names (f.q.n.) and mixture with .class which is not related to f.q.c. but the file name.
          The solution for now would be to have a fix with new Chapter in [1] specifying what package in regex means and you can do it in a new PR.
          In the version 3.0 it would be nice to change this format and use normal regex for f.q.c.
          [1] http://maven.apache.org/components/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html

          Show
          tibor17 Tibor Digana added a comment - - edited Sander Verhagen Dependencies in Surefire are very old and these have the facility to filer files using regex. The regex including slashes are platform dependent which would be %regex [my\/package\/???ExcludedTest\.class] . But platform dependent slashes are not good and therefore we are not mentioning them and the documentation specifies rather simple form: %regex [pkg.*Slow.*.class] . I personally do not like it because it is a mixture of using dots which is known in fully qualified class names (f.q.n.) and mixture with .class which is not related to f.q.c. but the file name. The solution for now would be to have a fix with new Chapter in [1] specifying what package in regex means and you can do it in a new PR. In the version 3.0 it would be nice to change this format and use normal regex for f.q.c. [1] http://maven.apache.org/components/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
          Hide
          sverhagen Sander Verhagen added a comment -

          I was under the impression that by the time the regex comes into play, the path has already been normalized to be slashes, /. It would then not be platform dependent. I say this, because I ran it on Windows with \/ and that seems to work fine.

          Show
          sverhagen Sander Verhagen added a comment - I was under the impression that by the time the regex comes into play, the path has already been normalized to be slashes, / . It would then not be platform dependent. I say this, because I ran it on Windows with \/ and that seems to work fine.
          Hide
          tibor17 Tibor Digana added a comment - - edited

          The code may be fault tolerant and so that / is replaced with \ but that's quite young improvement against the old principle I mentioned with f.q.c. and .class.

          Show
          tibor17 Tibor Digana added a comment - - edited The code may be fault tolerant and so that / is replaced with \ but that's quite young improvement against the old principle I mentioned with f.q.c. and .class .
          Hide
          tibor17 Tibor Digana added a comment -

          Closing clarification issue.
          Feel free to open a new issue.

          Show
          tibor17 Tibor Digana added a comment - Closing clarification issue. Feel free to open a new issue.
          Hide
          sverhagen Sander Verhagen added a comment -

          The issue wasn't meant to clarify to me how it works (I spent plenty of time, and figured out something that works for me), but it was about improving the documentation.

          Show
          sverhagen Sander Verhagen added a comment - The issue wasn't meant to clarify to me how it works (I spent plenty of time, and figured out something that works for me), but it was about improving the documentation.
          Hide
          tibor17 Tibor Digana added a comment -

          Sander Verhagen
          I have reopened the issue.
          Can you please update the documentation?

          Show
          tibor17 Tibor Digana added a comment - Sander Verhagen I have reopened the issue. Can you please update the documentation?
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user sverhagen opened a pull request:

          https://github.com/apache/maven-surefire/pull/138

          SUREFIRE-1309: Clarifying use of regular expressions for inclusion/exclusion

          Added clarification to site examples, as discussed in SUREFIRE-1309(https://issues.apache.org/jira/browse/SUREFIRE-1309).

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/sverhagen/maven-surefire SUREFIRE-1309

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/maven-surefire/pull/138.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #138


          commit 85d7af0bfca1268e62f0902ec70f22370cd3dcf6
          Author: Sander Verhagen <sverhagen@jamasoftware.com>
          Date: 2016-12-27T07:39:56Z

          SUREFIRE-1309: Clarifying use of regular expressions for inclusion/exclusion


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user sverhagen opened a pull request: https://github.com/apache/maven-surefire/pull/138 SUREFIRE-1309 : Clarifying use of regular expressions for inclusion/exclusion Added clarification to site examples, as discussed in SUREFIRE-1309 ( https://issues.apache.org/jira/browse/SUREFIRE-1309 ). You can merge this pull request into a Git repository by running: $ git pull https://github.com/sverhagen/maven-surefire SUREFIRE-1309 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/maven-surefire/pull/138.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #138 commit 85d7af0bfca1268e62f0902ec70f22370cd3dcf6 Author: Sander Verhagen <sverhagen@jamasoftware.com> Date: 2016-12-27T07:39:56Z SUREFIRE-1309 : Clarifying use of regular expressions for inclusion/exclusion
          Hide
          tibor17 Tibor Digana added a comment -

          I have added TODO in order to break backwards compatibility in Version 3.0.0 and thus use fully qualified classes and regex. https://git-wip-us.apache.org/repos/asf?p=maven-surefire.git;a=commitdiff;h=bd11d15edea9ea3c3785dc48d408b3f87193734e

          Show
          tibor17 Tibor Digana added a comment - I have added TODO in order to break backwards compatibility in Version 3.0.0 and thus use fully qualified classes and regex. https://git-wip-us.apache.org/repos/asf?p=maven-surefire.git;a=commitdiff;h=bd11d15edea9ea3c3785dc48d408b3f87193734e
          Show
          tibor17 Tibor Digana added a comment - https://git-wip-us.apache.org/repos/asf?p=maven-surefire.git;a=commitdiff;h=cf6e75c8f1707cfcc12ccd7f1dbc95f2569ac252
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-surefire #1658 (See https://builds.apache.org/job/maven-surefire/1658/)
          SUREFIRE-1309 Added TODO @ 3.0 (tibor17: http://git-wip-us.apache.org/repos/asf/?p=maven-surefire.git&a=commit&h=bd11d15edea9ea3c3785dc48d408b3f87193734e)

          • (edit) surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-surefire #1658 (See https://builds.apache.org/job/maven-surefire/1658/ ) SUREFIRE-1309 Added TODO @ 3.0 (tibor17: http://git-wip-us.apache.org/repos/asf/?p=maven-surefire.git&a=commit&h=bd11d15edea9ea3c3785dc48d408b3f87193734e ) (edit) surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-surefire #1659 (See https://builds.apache.org/job/maven-surefire/1659/)
          SUREFIRE-1309: Clarifying use of regular expressions for (tibor17: http://git-wip-us.apache.org/repos/asf/?p=maven-surefire.git&a=commit&h=cf6e75c8f1707cfcc12ccd7f1dbc95f2569ac252)

          • (edit) maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-surefire #1659 (See https://builds.apache.org/job/maven-surefire/1659/ ) SUREFIRE-1309 : Clarifying use of regular expressions for (tibor17: http://git-wip-us.apache.org/repos/asf/?p=maven-surefire.git&a=commit&h=cf6e75c8f1707cfcc12ccd7f1dbc95f2569ac252 ) (edit) maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/138

          @sverhagen
          Thx for contributing. This PR was merged. Pls close it.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/138 @sverhagen Thx for contributing. This PR was merged. Pls close it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user sverhagen closed the pull request at:

          https://github.com/apache/maven-surefire/pull/138

          Show
          githubbot ASF GitHub Bot added a comment - Github user sverhagen closed the pull request at: https://github.com/apache/maven-surefire/pull/138

            People

            • Assignee:
              tibor17 Tibor Digana
              Reporter:
              sverhagen Sander Verhagen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development