Skip to content

Whole lot of stack trace when tests failing. #38

@jgebal

Description

@jgebal

When I run a suite of tests with failing tests I see one problem.
If the pom.xml does not contain

<ignoreFailure>true</ignoreFailure>

and I want the build to fail on failing tests (default), then Instead of those results:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building utplsql-maven-plugin-demo-project 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- utplsql-maven-plugin:3.1.0:test (default) @ utplsql-maven-plugin-demo-project ---
[INFO] utPLSQL Version = v3.1.3.2140-develop
[INFO] Invoking TestRunner with: C:\Users\jacek\IdeaProjects\utPLSQL-demo-project\target
[info] Writing report UT_DOCUMENTATION_REPORTER to Console
org
  utplsql
    demo
      test_rooms
        Remove rooms by name
          Removes a room without content in it [.094 sec]
          Does not remove room when it has content [.022 sec]
          Raises exception when null room name given [.02 sec]
        Add content to a room
          Fails when room name is not valid [.002 sec]
          Fails when content name is null [.004 sec]
          Adds content to existing room [.017 sec]

Between string function
  Returns substring from start position to end position [.002 sec]
  Returns substring when start position is zero [.001 sec]
  Returns string until end if end position is greater than string length [.001 sec]
  Returns null for null input string value [.001 sec]
  A demo of test raising runtime exception [.001 sec] (FAILED - 1)
  A demo of failing test [.004 sec] (FAILED - 2)
  Demo of a disabled test [0 sec] (DISABLED)

Failures:

  1) bad_params
      ORA-06502: PL/SQL: numeric or value error: character to number conversion error
      ORA-06512: at "UT3_DEMO.TEST_BETWNSTR", line 25
      ORA-06512: at "UT3_DEMO.TEST_BETWNSTR", line 25
      ORA-06512: at line 6
  2) bad_test
      Actual: '1234567' (varchar2) was expected to equal: '1' (varchar2)
      at "UT3_DEMO.TEST_BETWNSTR.BAD_TEST", line 31 ut.expect( betwnstr( '1234567', 0, 500 ) ).to_( equal('1') );


Finished in .187795 seconds
13 tests, 1 failed, 1 errored, 1 disabled, 0 warning(s)

[info] Writing report UT_COVERAGE_HTML_REPORTER to C:\Users\jacek\IdeaProjects\utPLSQL-demo-project\target\coverage.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.926 s
[INFO] Finished at: 2018-10-23T22:11:59+01:00
[INFO] Final Memory: 15M/327M
[INFO] ------------------------------------------------------------------------

i get:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building utplsql-maven-plugin-demo-project 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- utplsql-maven-plugin:3.1.0:test (default) @ utplsql-maven-plugin-demo-project ---
[INFO] utPLSQL Version = v3.1.3.2140-develop
[INFO] Invoking TestRunner with: C:\Users\jacek\IdeaProjects\utPLSQL-demo-project\target
[ERROR]
org.utplsql.api.exception.SomeTestsFailedException: ORA-20213: Some tests failed
ORA-06512: at "UT3_LATEST_RELEASE.UT_RUNNER", line 153
ORA-06512: at line 1

    at org.utplsql.api.TestRunner.run (TestRunner.java:148)
    at org.utplsql.maven.plugin.UtPLSQLMojo.execute (UtPLSQLMojo.java:164)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.sql.SQLException: ORA-20213: Some tests failed
ORA-06512: at "UT3_LATEST_RELEASE.UT_RUNNER", line 153
ORA-06512: at line 1

    at oracle.jdbc.driver.T4CTTIoer11.processError (T4CTTIoer11.java:494)
    at oracle.jdbc.driver.T4CTTIoer11.processError (T4CTTIoer11.java:446)
    at oracle.jdbc.driver.T4C8Oall.processError (T4C8Oall.java:1054)
    at oracle.jdbc.driver.T4CTTIfun.receive (T4CTTIfun.java:623)
    at oracle.jdbc.driver.T4CTTIfun.doRPC (T4CTTIfun.java:252)
    at oracle.jdbc.driver.T4C8Oall.doOALL (T4C8Oall.java:612)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8 (T4CCallableStatement.java:223)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8 (T4CCallableStatement.java:56)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows (T4CCallableStatement.java:907)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (OracleStatement.java:1119)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal (OraclePreparedStatement.java:3780)
    at oracle.jdbc.driver.T4CCallableStatement.executeInternal (T4CCallableStatement.java:1300)
    at oracle.jdbc.driver.OraclePreparedStatement.execute (OraclePreparedStatement.java:3887)
    at oracle.jdbc.driver.OracleCallableStatement.execute (OracleCallableStatement.java:4230)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute (OraclePreparedStatementWrapper.java:1079)
    at org.utplsql.api.testRunner.AbstractTestRunnerStatement.execute (AbstractTestRunnerStatement.java:93)
    at org.utplsql.api.TestRunner.run (TestRunner.java:145)
    at org.utplsql.maven.plugin.UtPLSQLMojo.execute (UtPLSQLMojo.java:164)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: oracle.jdbc.OracleDatabaseException: ORA-20213: Some tests failed
ORA-06512: at "UT3_LATEST_RELEASE.UT_RUNNER", line 153
ORA-06512: at line 1

    at oracle.jdbc.driver.T4CTTIoer11.processError (T4CTTIoer11.java:498)
    at oracle.jdbc.driver.T4CTTIoer11.processError (T4CTTIoer11.java:446)
    at oracle.jdbc.driver.T4C8Oall.processError (T4C8Oall.java:1054)
    at oracle.jdbc.driver.T4CTTIfun.receive (T4CTTIfun.java:623)
    at oracle.jdbc.driver.T4CTTIfun.doRPC (T4CTTIfun.java:252)
    at oracle.jdbc.driver.T4C8Oall.doOALL (T4C8Oall.java:612)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8 (T4CCallableStatement.java:223)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8 (T4CCallableStatement.java:56)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows (T4CCallableStatement.java:907)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (OracleStatement.java:1119)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal (OraclePreparedStatement.java:3780)
    at oracle.jdbc.driver.T4CCallableStatement.executeInternal (T4CCallableStatement.java:1300)
    at oracle.jdbc.driver.OraclePreparedStatement.execute (OraclePreparedStatement.java:3887)
    at oracle.jdbc.driver.OracleCallableStatement.execute (OracleCallableStatement.java:4230)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute (OraclePreparedStatementWrapper.java:1079)
    at org.utplsql.api.testRunner.AbstractTestRunnerStatement.execute (AbstractTestRunnerStatement.java:93)
    at org.utplsql.api.TestRunner.run (TestRunner.java:145)
    at org.utplsql.maven.plugin.UtPLSQLMojo.execute (UtPLSQLMojo.java:164)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[info] Writing report UT_DOCUMENTATION_REPORTER to Console
org
  utplsql
    demo
      test_rooms
        Remove rooms by name
          Removes a room without content in it [.093 sec]
          Does not remove room when it has content [.022 sec]
          Raises exception when null room name given [.021 sec]
        Add content to a room
          Fails when room name is not valid [.002 sec]
          Fails when content name is null [.003 sec]
          Adds content to existing room [.015 sec]

Between string function
  Returns substring from start position to end position [.001 sec]
  Returns substring when start position is zero [.001 sec]
  Returns string until end if end position is greater than string length [.001 sec]
  Returns null for null input string value [.001 sec]
  A demo of test raising runtime exception [.001 sec] (FAILED - 1)
  A demo of failing test [.004 sec] (FAILED - 2)
  Demo of a disabled test [0 sec] (DISABLED)

Failures:

  1) bad_params
      ORA-06502: PL/SQL: numeric or value error: character to number conversion error
      ORA-06512: at "UT3_DEMO.TEST_BETWNSTR", line 25
      ORA-06512: at "UT3_DEMO.TEST_BETWNSTR", line 25
      ORA-06512: at line 6
  2) bad_test
      Actual: '1234567' (varchar2) was expected to equal: '1' (varchar2)
      at "UT3_DEMO.TEST_BETWNSTR.BAD_TEST", line 31 ut.expect( betwnstr( '1234567', 0, 500 ) ).to_( equal('1') );


Finished in .179828 seconds
13 tests, 1 failed, 1 errored, 1 disabled, 0 warning(s)

[info] Writing report UT_COVERAGE_HTML_REPORTER to C:\Users\jacek\IdeaProjects\utPLSQL-demo-project\target\coverage.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.981 s
[INFO] Finished at: 2018-10-23T22:14:50+01:00
[INFO] Final Memory: 15M/317M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.utplsql:utplsql-maven-plugin:3.1.0:test (default) on project utplsql-maven-plugin-demo-project: ORA-20213: Some tests failed
[ERROR] ORA-06512: at "UT3_LATEST_RELEASE.UT_RUNNER", line 153
[ERROR] ORA-06512: at line 1
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Seems like the exception thrown by java-API is not handled in plugin and causes a stacktrace to be shown.
I'd rather have the message Some tests have failed and BUILD FAILED shown only.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions