← 输入框|github.com|刷新
Skip to content

utPLSQL CLI throwing multiple no_data_found [-01403] instead of passing test with --%throws(xxxx) #1280

Closed as duplicate

Description

@m-jerwan

I'm writing unit tests with --%throws() and they are passing in the schema, but when running through utPLSQL CLI [Jenkins plugin], I'm getting multiple no_data_found [-01403] errors and tests fail as "Actual: -1403 was expected to equal: -1400". Any ideas on how to tackle this?

I'm testing that the trigger will raise "can't insert null" [-1400] when trying to insert null into one of the columns [through null as param to one of the procedures].

Code:
Spec:

  --%test  
  --%throws(UNIT_TEST_PKG.E_CANT_INSERT_NULL)
  PROCEDURE try_send_null_exp_error_E_CANT_INSERT_NULL;

The body is irrelevant, as I only insert null into one of the columns. There is no code after that.

Spec of UNIT_TEST_PKG [utility to help with common unit test features] is

E_CANT_INSERT_NULL EXCEPTION; PRAGMA EXCEPTION_INIT( E_CANT_INSERT_NULL, -1400);
I also tried with
E_CANT_INSERT_NULL CONSTANT NUMBER := -1400;
but got same result.

Test passes when running the UT.run() in the schema.

When running on Jenkins job on utPLSQL CLI, getting this error:

Actual: -1403 was expected to equal: -1400
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01403: no data found
ORA-01400: cannot insert NULL into ("XXX"."YYY"."EMAIL_OPT_OUT")
ORA-06512: at "XXX.YYY", line 243
ORA-04088: error during execution of trigger 'XXX.YYY_AUD_TRG'
ORA-06512: at "XXX.YYY_AUD_TRG", line 243
ORA-06512: at line 6

So, the right error is raised during the execution of the trigger "ORA-01400: cannot insert NULL into ...", but then multiple no_data_found are triggered and final errorstack error is "ORA-01403: no data found", which causes the test to fail. I think all the no_data_found are coming from utPLSQL CLI, but I don't know how to deal with this.

Activity

  1. lwasylow commented on Jul 18, 2024

    @lwasylow
    Member

    Hi Marcin
    Long time :)
    I'm on holiday till 28th however can you please verify the same test using utplsqlcli on local machine rather than via Jenkins plugin to make sure you running latest version.
    Also I believe there is an parameter to execute with debug log info so we can see what's going on.
    Cheers Lukasz

  2. jgebal commented on Jul 18, 2024

    @jgebal
    Member

    Can you check and confirm that both jenkins and local execution of tests are done with the same database user?
    When running on jenkins is the db user used to connect slso the owner of the test packages and owner of the UNIT_TEST_PKG?

    Full steps to reproduced will help us pinpoint the proboem
    My suspicion is that the user used to run the tests on jenkins is not test owner while it is test owner when running locally.

  3. lwasylow commented on Apr 3, 2025

    @lwasylow
    Member

    Hi @m-jerwan
    Is this still relevant or can be closed?

  4. jgebal commented on May 9, 2026

    @jgebal
    Member

    @m-jerwan
    It is most likely related to a different issue #1223
    The reason why you see the problem in Jenkins is that the test run in jenkins is invoked from a different user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions