GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [test] Improve xml test schema · Issue #3302 · pmd/pmd

[test] Improve xml test schema #3302

New issue
Copy link
New issue
Copy link
Closed
#4058
Closed
[test] Improve xml test schema#3302
#4058
Copy link
Assignees
oowekyala
Labels
an:enhancementAn improvement on existing features / rulesin:testingAbout tests of pmd, eg the module pmd-lang-test or pmd-test [test]
Milestone
6.48.0

Description

@oowekyala
oowekyala
opened on May 25, 2021
Issue body actions

Is your feature request related to a problem? Please describe.
Currently there's a few things that are not so great with the test schema

  1. the only way to ignore a test is to set the attribute regressionTest to false, which is... weird
  2. there's no way to execute a single test ("focus" a test). Some IDEs may provide this facility (eclipse), but some don't (intellij), and having an ide-independent way to do this would be nice
  3. the attribute reinitializeRule of test-code is useless. I can't see a reason not to reinitialize the rule.
  4. we could remove the pattern from the source-type element, as we do the validation at runtime anyway. This means we wouldn't have to update the schema when we add/remove languages, which makes pmd easier to extend
  5. validation of consistency between expected-problems, expected-messages and expected-linenumbers is buggy. Sometimes it throws a validation error, sometimes it's silent. For instance
         <expected-problems>0</expected-problems>
         <expected-messages>
             <message>1</message>
         </expected-messages>

throws a validation error, but the following doesn't

      <expected-problems>1</expected-problems>
      <expected-linenumbers>1,2,3</expected-linenumbers>
      <expected-messages>
          <message>1</message>
      </expected-messages>

Describe the solution you'd like Update the schema and its parser to support focus and disabled attributes, deprecate useless things

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Some other things that we should keep in mind and fix later:

  1. the <rule-property> element has ad-hoc syntax, instead of just reusing the syntax for <property> that's from the ruleset schema. This will be awkward when the XSD for rulesets is updated ([core] Implementation plan for property framework changes #1432)
  2. the useAuxClasspath attribute doesn't look useful. Related to [java] Improve rule tests with auxclasspath #2649

Activity

Next
  1. oowekyala
    added
    an:enhancementAn improvement on existing features / rules
    in:testingAbout tests of pmd, eg the module pmd-lang-test or pmd-test [test]
    on May 25, 2021
  2. oowekyala
    self-assigned this
    on Jun 22, 2021
  3. oowekyala
    added this to the 6.37.0 milestone on Jun 22, 2021
  4. adangel
    modified the milestones: 6.37.0, 6.38.0 on Jul 27, 2021
  5. adangel
    modified the milestones: 6.38.0, 6.39.0 on Aug 22, 2021
  6. adangel
    modified the milestones: 6.39.0, 6.40.0 on Sep 21, 2021
  7. adangel
    modified the milestones: 6.40.0, 6.41.0 on Oct 26, 2021
  8. adangel
    modified the milestones: 6.41.0, 6.42.0 on Nov 18, 2021
  9. adangel
    removed this from the 6.42.0 milestone on Jan 13, 2022
  10. 1 remaining item

  11. adangel
    modified the milestones: 6.43.0, 6.44.0 on Feb 22, 2022
  12. adangel
    modified the milestones: 6.44.0, 6.45.0 on Mar 24, 2022
  13. adangel
    modified the milestones: 6.45.0, 6.46.0 on Apr 28, 2022
  14. adangel
    modified the milestones: 6.46.0, 6.47.0 on May 19, 2022
  15. adangel
    modified the milestones: 6.47.0, 6.48.0 on Jun 21, 2022
  16. adangel commented on Jul 21, 2022

    @adangel
    adangel
    on Jul 21, 2022
    Member
    More actions

    The following points are addressed by #3976: 1 (regressionTest), 4 (source-type), 5 (validation of expected-problems, expected-linenumbers, expected-messages)

    TODO is: 2 (focus), 3 (reinitializeRule)

  17. adangel commented on Jul 22, 2022

    @adangel
    adangel
    on Jul 22, 2022
    Member
    More actions

    I noticed that point 3 is also done: reinitalizeRule and auxclasspath are deprecated

  18. oowekyala commented on Jul 22, 2022

    @oowekyala
    oowekyala
    on Jul 22, 2022
    MemberAuthor
    More actions

    @adangel I will follow up with a fix for point 2, and update the release notes with refs to 3 as well.

  19. adangel
    added a commit that references this issue on Jul 22, 2022

    [java] Remove usages of reinitializeRule and useAuxClasspath in rule …

    cb5acd6
  20. adangel
    closed this as completedin #4058on Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @oowekyala
    oowekyala

Labels

an:enhancementAn improvement on existing features / rulesin:testingAbout tests of pmd, eg the module pmd-lang-test or pmd-test [test]

Type

No type

Projects

No projects

    Milestone

    • 6.48.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.