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] Extract xml schema module by oowekyala · Pull Request #3976 · pmd/pmd

Conversation

@oowekyala

@oowekyala oowekyala commented May 21, 2022 •
edited by adangel
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This is to be able to change the schema (#3302) without needing to update the designer as well. The designer will be able to depend on this module without depending on pmd-test (which itself depends on junit and other things). It also cleans up RuleTst which implemented the parsing adhoc.

There is now a copy of the schema in pmd-test and another in pmd-test-schema. The only functional change to the schema is the introduction of an disabled attribute to replace isRegressionTest (see #3302). isRegressionTest is still supported but produces a deprecation warning.

The PR is currently blocked on #2435. I need a Rule instance to write tests, but there is no language on the classpath. I really really don't want to have to write another dummy language module... update This PR contains #4024, which unblocks it.

Related issues

  • Relates to [test] Improve xml test schema #3302
  • Fixes [test] Move pmd-test to java 8 #3758

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • unblock [test] Remove duplicated Dummy language module #2435
  • Think about what APIs to deprecate in pmd-test
    • At least, TestDescriptor (in pmd-test) should be replaced by RuleTestDescriptor (in the new module). Currently changes are minimal in that module
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
oowekyala added 7 commits May 17, 2022 23:34
@oowekyala
Most of the work to extract module
60139c8
Need a release of nice-xml-messages
Need an update to pmd-test
Need to add the 'ignored' attribute to schema
@oowekyala
Add tests
1801b69
@oowekyala
Cleanups
519ad31
@oowekyala
Update RuleTst
42dcc3c
@oowekyala
Cleanup schema, add ignore attribute
b9342f7
@oowekyala
Cleanup new schema
bf0b451
@oowekyala
Replace old schema with newer one
ebd009e
(This is backward compatible)
@oowekyala oowekyala mentioned this pull request May 21, 2022
[test] Remove duplicated Dummy language module #2435
Closed
oowekyala added 2 commits June 25, 2022 14:45
@oowekyala
Merge branch 'pmd6-plain-text-lang' into pmd6-extract-test-schema-module
b77fe07
@oowekyala
Fix tests using PlainTextLang
76d5a0b
@oowekyala oowekyala mentioned this pull request Jun 25, 2022
[core] Add plain text language #4024
Merged
4 tasks
oowekyala added 5 commits June 25, 2022 14:57
@oowekyala
Merge branch 'pmd6-plain-text-lang' into pmd6-extract-test-schema-module
e66ec71
@oowekyala
Merge remote-tracking branch 'upstream/master' into pmd6-extract-test…
5a87894
…-schema-module
@oowekyala
Merge remote-tracking branch 'upstream/master' into pmd6-extract-test…
0c1bad6
…-schema-module
@oowekyala
Fix ignore behavior
07121bc
@oowekyala
fix remaining problems
9bbee06
oowekyala
oowekyala commented Jul 10, 2022
View reviewed changes
Comment thread pmd-test-schema/src/main/resources/net/sourceforge/pmd/test/schema/rule-tests_1_0_0.xsd Outdated
<attribute name="regressionTest" type="boolean" default="true"/>
<attribute name="useAuxClasspath" type="boolean" default="true"/>

<attribute name="ignored" type="string" default="">

@oowekyala oowekyala Jul 10, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

todo change that to bool, rename to disabled like junit 5

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@oowekyala oowekyala added this to the 6.48.0 milestone Jul 13, 2022
oowekyala added 2 commits July 13, 2022 21:18
@oowekyala
Merge branch 'master' into pmd6-extract-test-schema-module
fe0643d
@oowekyala
Bump dependency nice-xml-messages
8f36f5d
For a patch to the thing causing the
stackOverflow.
@ghost

ghost commented Jul 13, 2022

Copy link
Copy Markdown
1 Message
📖 No regression tested rules have been changed.

Generated by 🚫 Danger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oowekyala
oowekyala marked this pull request as ready for review July 15, 2022 12:00
@adangel
adangel self-requested a review July 18, 2022 19:32
adangel added 3 commits July 21, 2022 19:10
@adangel
Merge branch 'master' into pr-3976
d09f981
@adangel
Fix pom parent ref
6471faa
@adangel
[test] Rename ignored -> disabled
bc1dd85
@adangel adangel mentioned this pull request Jul 21, 2022
[test] Improve xml test schema #3302
Closed
@adangel
[doc] Update release notes (pmd#3758, pmd#3976)
bed3b17
adangel
adangel approved these changes Jul 21, 2022
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good!

I'll do the change "ignored" -> "disabled" and update the release notes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-test-schema/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/RuleTestDescriptor.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-test-schema/src/main/resources/net/sourceforge/pmd/test/schema/rule-tests_1_0_0.xsd Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-test-schema/src/main/resources/net/sourceforge/pmd/test/schema/rule-tests_1_0_0.xsd Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/BaseTestParserImpl.java
parseBoolAttribute(testCode, "useAuxClasspath", true, err, "Attribute 'useAuxClasspath' is deprecated and ignored, assumed true");

boolean ignored = parseBoolAttribute(testCode, "ignored", false, err, null)
| !parseBoolAttribute(testCode, "regressionTest", true, err, "Attribute ''regressionTest'' is deprecated, use ''ignored'' with inverted value");

@adangel adangel Jul 21, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

FYI - for this "regressionTest" flag, there is also a System.property that can disable the disabling...

pmd/pmd-test/src/main/java/net/sourceforge/pmd/testframework/TestDescriptor.java

Lines 121 to 134 in 029b4b2

public static boolean inRegressionTestMode() {
boolean inRegressionMode = true; // default
try {
// get the "pmd.regress" System property
String property = System.getProperty("pmd.regress");
if (property != null) {
inRegressionMode = Boolean.parseBoolean(property);
}
} catch (IllegalArgumentException e) {
throw new RuntimeException("Invalid system property 'pmd.regress'", e);
}
return inRegressionMode;
}

I personally never used this. The system property is used here when deciding whether to run the test or not:

pmd/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTestRunner.java

Line 140 in 029b4b2

return TestDescriptor.inRegressionTestMode() && !child.isRegressionTest();

And the property "pmd.regress" also not documented: https://pmd.github.io/latest/pmd_userdocs_extending_testing.html

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-test/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-test/src/main/java/net/sourceforge/pmd/testframework/TestDescriptor.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-test-schema/src/main/resources/net/sourceforge/pmd/test/schema/rule-tests_1_0_0.xsd Resolved

Uh oh!

There was an error while loading. Please reload this page.

@adangel
adangel merged commit a8efa19 into pmd:master Jul 21, 2022
@oowekyala
oowekyala deleted the pmd6-extract-test-schema-module branch July 21, 2022 20:59
adangel added a commit to oowekyala/pmd that referenced this pull request Jul 22, 2022
@adangel
[java] Remove usages of reinitializeRule and useAuxClasspath in rule …
cb5acd6
…tests

 (pmd#3976 / pmd#3302)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

6.48.0

Development

Successfully merging this pull request may close these issues.

[test] Move pmd-test to java 8

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@oowekyala @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.