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

com.github.sevntu.checkstyle.internal.ChecksTest fails #726

Closed
mbert opened this issue Mar 6, 2019 · 2 comments
Closed

com.github.sevntu.checkstyle.internal.ChecksTest fails #726

mbert opened this issue Mar 6, 2019 · 2 comments

Comments

@mbert
Copy link
Contributor

mbert commented Mar 6, 2019

The current code from the master branch does not pass all tests.

$ mvn test
(lots of output skipped)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.201 sec <<< FAILURE! - in com.github.sevntu.checkstyle.internal.ChecksTest
verifyTestConfigurationFiles(com.github.sevntu.checkstyle.internal.ChecksTest)  Time elapsed: 0.199 sec  <<< FAILURE!
java.lang.AssertionError: /private/var/tmp/sevntu.checkstyle/eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/annotation/checkstyle-metadata.xml has invalid xml (checkstyle.org): <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE checkstyle-metadata PUBLIC
"-//eclipse-cs//DTD Check Metadata 1.1//EN"
"http://checkstyle.org/eclipse-cs/dtds/checkstyle-metadata_1_1.dtd">
<checkstyle-metadata>
  <rule-group-metadata name="SevNTU checks" priority="500">

    <rule-metadata name="%ForbidAnnotationCheck.name" internal-name="ForbidAnnotationCheck" parent="TreeWalker">
      <alternative-name internal-name="com.github.sevntu.checkstyle.checks.annotation.ForbidAnnotationCheck"/>
      <description>%ForbidAnnotationCheck.desc</description>

      <property-metadata name="annotationNames" datatype="String" default-value="">
        <description>%ForbidAnnotationCheck.annotationNames</description>
      </property-metadata>
      <property-metadata name="annotationTargets" datatype="MultiCheck" default-value="">
        <description>%ForbidAnnotationCheck.annotationTargets</description>
        <enumeration>
          <property-value-option value="CLASS_DEF"/>
          <property-value-option value="INTERFACE_DEF"/>
          <property-value-option value="ENUM_DEF"/>
          <property-value-option value="ANNOTATION_DEF"/>
          <property-value-option value="ANNOTATION_FIELD_DEF"/>
          <property-value-option value="ENUM_CONSTANT_DEF"/>
          <property-value-option value="PARAMETER_DEF"/>
          <property-value-option value="VARIABLE_DEF"/>
          <property-value-option value="METHOD_DEF"/>
          <property-value-option value="CTOR_DEF"/>
        </enumeration>
      </property-metadata>

      <message-key key="annotation.incorrect.target"/>
    </rule-metadata>

    <rule-metadata name="%ForbidAnnotationElementValueCheck.name" internal-name="ForbidAnnotationElementValueCheck" parent="TreeWalker">
      <alternative-name internal-name="com.github.sevntu.checkstyle.checks.annotation.ForbidAnnotationElementValueCheck"/>
      <description>%ForbidAnnotationElementValueCheck.desc</description>

      <property-metadata name="annotationName" datatype="String" default-value="">
        <description>%ForbidAnnotationElementValueCheck.annotationName</description>
      </property-metadata>
      <property-metadata name="elementName" datatype="String" default-value="">
        <description>%ForbidAnnotationElementValueCheck.elementName</description>
      </property-metadata>
      <property-metadata name="forbiddenElementValueRegexp" datatype="String" default-value="">
        <description>%ForbidAnnotationElementValueCheck.forbiddenElementValueRegexp</description>
      </property-metadata>

      <message-key key="annotation.forbid.element.value"/>
    </rule-metadata>

    <rule-metadata name="%RequiredParameterForAnnotationCheck.name" internal-name="RequiredParameterForAnnotationCheck" parent="TreeWalker">
      <alternative-name internal-name="com.github.sevntu.checkstyle.checks.annotation.RequiredParameterForAnnotationCheck"/>
      <description>%RequiredParameterForAnnotationCheck.desc</description>

      <property-metadata name="annotationName" datatype="String" default-value="">
        <description>%RequiredParameterForAnnotationCheck.annotationName</description>
      </property-metadata>
      <property-metadata name="requiredParameters" datatype="String" default-value="">
        <description>%RequiredParameterForAnnotationCheck.requiredParameters</description>
      </property-metadata>

      <message-key key="annotation.missing.required.parameter"/>
    </rule-metadata>

  </rule-group-metadata>
</checkstyle-metadata>

	at org.junit.Assert.fail(Assert.java:88)
	at com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil.getRawXml(XmlUtil.java:59)
	at com.github.sevntu.checkstyle.internal.ChecksTest.validateEclipseCsMetaXmlFile(ChecksTest.java:182)
	at com.github.sevntu.checkstyle.internal.ChecksTest.verifyTestConfigurationFiles(ChecksTest.java:85)

Running com.github.sevntu.checkstyle.internal.CheckstyleRegressionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in com.github.sevntu.checkstyle.internal.CheckstyleRegressionTest
Running com.github.sevntu.checkstyle.internal.CommitValidationTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.166 sec - in com.github.sevntu.checkstyle.internal.CommitValidationTest

Results :

Failed tests:
  ChecksTest.verifyTestConfigurationFiles:85->validateEclipseCsMetaXmlFile:182 /private/var/tmp/sevntu.checkstyle/eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/annotation/checkstyle-metadata.xml has invalid xml (checkstyle.org): <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE checkstyle-metadata PUBLIC
"-//eclipse-cs//DTD Check Metadata 1.1//EN"
"http://checkstyle.org/eclipse-cs/dtds/checkstyle-metadata_1_1.dtd">
<checkstyle-metadata>
  <rule-group-metadata name="SevNTU checks" priority="500">

    <rule-metadata name="%ForbidAnnotationCheck.name" internal-name="ForbidAnnotationCheck" parent="TreeWalker">
      <alternative-name internal-name="com.github.sevntu.checkstyle.checks.annotation.ForbidAnnotationCheck"/>
      <description>%ForbidAnnotationCheck.desc</description>

      <property-metadata name="annotationNames" datatype="String" default-value="">
        <description>%ForbidAnnotationCheck.annotationNames</description>
      </property-metadata>
      <property-metadata name="annotationTargets" datatype="MultiCheck" default-value="">
        <description>%ForbidAnnotationCheck.annotationTargets</description>
        <enumeration>
          <property-value-option value="CLASS_DEF"/>
          <property-value-option value="INTERFACE_DEF"/>
          <property-value-option value="ENUM_DEF"/>
          <property-value-option value="ANNOTATION_DEF"/>
          <property-value-option value="ANNOTATION_FIELD_DEF"/>
          <property-value-option value="ENUM_CONSTANT_DEF"/>
          <property-value-option value="PARAMETER_DEF"/>
          <property-value-option value="VARIABLE_DEF"/>
          <property-value-option value="METHOD_DEF"/>
          <property-value-option value="CTOR_DEF"/>
        </enumeration>
      </property-metadata>

      <message-key key="annotation.incorrect.target"/>
    </rule-metadata>

    <rule-metadata name="%ForbidAnnotationElementValueCheck.name" internal-name="ForbidAnnotationElementValueCheck" parent="TreeWalker">
      <alternative-name internal-name="com.github.sevntu.checkstyle.checks.annotation.ForbidAnnotationElementValueCheck"/>
      <description>%ForbidAnnotationElementValueCheck.desc</description>

      <property-metadata name="annotationName" datatype="String" default-value="">
        <description>%ForbidAnnotationElementValueCheck.annotationName</description>
      </property-metadata>
      <property-metadata name="elementName" datatype="String" default-value="">
        <description>%ForbidAnnotationElementValueCheck.elementName</description>
      </property-metadata>
      <property-metadata name="forbiddenElementValueRegexp" datatype="String" default-value="">
        <description>%ForbidAnnotationElementValueCheck.forbiddenElementValueRegexp</description>
      </property-metadata>

      <message-key key="annotation.forbid.element.value"/>
    </rule-metadata>

    <rule-metadata name="%RequiredParameterForAnnotationCheck.name" internal-name="RequiredParameterForAnnotationCheck" parent="TreeWalker">
      <alternative-name internal-name="com.github.sevntu.checkstyle.checks.annotation.RequiredParameterForAnnotationCheck"/>
      <description>%RequiredParameterForAnnotationCheck.desc</description>

      <property-metadata name="annotationName" datatype="String" default-value="">
        <description>%RequiredParameterForAnnotationCheck.annotationName</description>
      </property-metadata>
      <property-metadata name="requiredParameters" datatype="String" default-value="">
        <description>%RequiredParameterForAnnotationCheck.requiredParameters</description>
      </property-metadata>

      <message-key key="annotation.missing.required.parameter"/>
    </rule-metadata>

  </rule-group-metadata>
</checkstyle-metadata>


Tests run: 379, Failures: 1, Errors: 0, Skipped: 0

@rnveach
Copy link
Contributor

rnveach commented Mar 6, 2019

@mbert I get a build success when I do mvn clean verify test on master's commit 0a5c948 .
Badges on main page say master is also passing. https://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/builds/500977392

Whatever the failure is, it is either only on your machine or only in your PR.

@mbert
Copy link
Contributor Author

mbert commented Mar 7, 2019

Thank you for this feedback. It has turned out that the network I am in right now has (gasp) a DNS problem: the host 'checkstyle.org' could not be resolved (which unfortunately cannot be seen in the failed error, but was revealed by xmllint --verify). Having fixed that revealed a formerly unnoticed problem in my PR which I have now fixed, too. Closing this.

@mbert mbert closed this as completed Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants