utPLSQL / utPLSQL-maven-plugin

Maven plugin for running Unit Tests with utPLSQL v3
Apache License 2.0
13 stars 10 forks source link

Add flag to skip the tests #55

Closed getshravan closed 2 years ago

getshravan commented 4 years ago

Based on the maven build parameter (mvn clean install -DskipUTPLSQLTest=true), I want to skip the utplsql-maven-plugin execution, I tried the below configuration and it is not working. Any inputs would be of great help. Thanks

        <plugin>
                <groupId>org.utplsql</groupId>
                <artifactId>utplsql-maven-plugin</artifactId>
                <version>3.1.4</version>
                <dependencies>
                    <dependency>
                        <groupId>com.oracle.jdbc</groupId>
                        <artifactId>ojdbc8</artifactId>
                        <version>12.2.0.1</version>
                        <scope>compile</scope>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <skip>${skipUTPLSQLTest}</skip>
                            <paths>
                                <path>test-schema</path>
                            </paths>
                            <sources>
                                <source>
                                    <!-- Path to project source files. -->
                                    <directory>../installation/src/main/resources/database</directory>
                                    <!-- File patterns to include. -->
                                    <includes>
                                        <include>manage-header.sql</include>
                                        <include>manage-body.sql</include>
                                    </includes>
                                </source>
                            </sources>

                            <tests>
                                <test>
                                    <!-- Path to project test files. -->
                                    <directory>../installation/src/test/resources/database</directory>
                                    <!-- File patterns to include. -->
                                    <includes>
                                        <include>**/*sql</include>
                                    </includes>
                                </test>
                            </tests>
                            <reporters>
                                <reporter>
                                    <name>UT_COVERAGE_HTML_REPORTER</name>
                                    <fileOutput>utplsql-junit-reports/ut_coverage_html_reporter.html</fileOutput>
                                </reporter>
                                <reporter>
                                    <name>UT_JUNIT_REPORTER</name>
                                    <fileOutput>utplsql-junit-reports/ut_junit_reporter.xml</fileOutput>
                                </reporter>
                            </reporters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
simasch commented 2 years ago

IMHO The tests shouldn't even run when passing -DskipTests