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

Add tests to camel-kafka-connector-generator-maven-plugin #1019

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

tadayosi
Copy link
Member

Fix #166

Initial attempt at introducing maven it to ckc maven plugin. Running the tests is time consuming, so it's intentionally not integrated with the integration-test build cycle by default. You can run them by:

mvn clean verify -Pmaven-it

at this moment.

@oscerd
Copy link
Contributor

oscerd commented Feb 17, 2021

Can you please fix this? Error: /home/runner/work/camel-kafka-connector/camel-kafka-connector/tooling/camel-kafka-connector-generator-maven-plugin/src/test/resources-its/org/apache/camel/kafkaconnector/maven/GenerateCamelKafkaConnectorsMojoIT/test_generate/pom.xml:1: Line does not match expected header line of '^<?xml.>'. [RegexpHeader]
Error: /home/runner/work/camel-kafka-connector/camel-kafka-connector/tooling/camel-kafka-connector-generator-maven-plugin/src/test/resources/template-connector-package.xml:1: Line does not match expected header line of '^<?xml.
>'. [RegexpHeader]
Error: /home/runner/work/camel-kafka-connector/camel-kafka-connector/tooling/camel-kafka-connector-generator-maven-plugin/src/test/java/org/apache/camel/kafkaconnector/maven/GenerateCamelKafkaConnectorsMojoIT.java:45:17: Name 'test_generate' must match pattern '^[a-z][a-zA-Z0-9]*$'. [MethodName]

@oscerd
Copy link
Contributor

oscerd commented Feb 17, 2021

I think we can also think about creating a gh action testing this stuff during the night or maybe more.

@tadayosi
Copy link
Member Author

@oscerd Thanks for your catch-up. I can fix the pom.xml part, but for the method name test_generate it's the recommendation by the maven-it-extension plugin because it relies on convention over configuration for resolving the test resource folder GenerateCamelKafkaConnectorsMojoIT/test_generate from the class name & method name combo and tries to avoid problems with case-insensitive filesystems. Maybe should I just add some annotation to the method to explicitly ignore the stylecheck?

@tadayosi
Copy link
Member Author

@oscerd And great idea for creating a gh action to run the tests nightly. I'll follow up with it after the pull req.

@oscerd
Copy link
Contributor

oscerd commented Feb 17, 2021

I believe you should add an exclusion at maven checkstyle plugin configuration level

Here:

                    <executions>
                        <execution>
                            <id>default-cli</id>
                            <phase>validate</phase>
                            <configuration>
                                <includeResources>false</includeResources>
                                <configLocation>camel-checkstyle.xml</configLocation>
                                <consoleOutput>true</consoleOutput>
                                <failsOnError>${checkstyle.failOnViolation}</failsOnError>
                                <linkXRef>false</linkXRef>
                                <suppressionsLocation>camel-checkstyle-suppressions.xml</suppressionsLocation>
                                <encoding>UTF-8</encoding>
                                <sourceDirectories>
                                    <sourceDirectory>${basedir}/src</sourceDirectory>
                                </sourceDirectories>
                                <headerLocation>header-java.txt</headerLocation>
                                <includes>**/*.java,**/*.groovy,**/*.scala,**/*.xml,**/*.xsd</includes>
                                **<excludes>
                                    **/archetype-resources/**/*.java,**/archetype-resources/**/*.groovy,**/archetype-resources/**/*.scala,**/archetype-resources/**/*.xml,**/org/json/simple/**/*.java,**/camel-checkstyle.xml
                                </excludes>**
                            </configuration>
                            <goals>
                                <goal>checkstyle</goal>
                            </goals>
                        </execution>
                    </executions>

@tadayosi
Copy link
Member Author

Thanks. Style issues fixed.

@oscerd oscerd merged commit c1ecf7e into apache:master Feb 17, 2021
@oscerd
Copy link
Contributor

oscerd commented Feb 17, 2021

Thanks

tadayosi added a commit to tadayosi/camel-kafka-connector that referenced this pull request Feb 19, 2021
tadayosi added a commit to tadayosi/camel-kafka-connector that referenced this pull request Feb 19, 2021
tadayosi added a commit that referenced this pull request Feb 19, 2021
oscerd pushed a commit that referenced this pull request Feb 19, 2021
oscerd pushed a commit that referenced this pull request Feb 19, 2021
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

Successfully merging this pull request may close these issues.

Add tests to camel-kafka-connector-generator-maven-plugin
2 participants