Skip to content

Cannot navigate to failed test with throws annotation #89

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

Closed
PhilippSalvisberg opened this issue Dec 15, 2019 · 1 comment · Fixed by #90
Closed

Cannot navigate to failed test with throws annotation #89

PhilippSalvisberg opened this issue Dec 15, 2019 · 1 comment · Fixed by #90
Assignees
Labels
Milestone

Comments

@PhilippSalvisberg
Copy link
Member

@tkleiber mentioned this issue at the DOAG conference and sent detailed information via Twitter. I could reproduce it. Here's a simplified version.

1. Create the following package specifications without bodies

CREATE OR REPLACE PACKAGE pkg1 IS
   --%suite
   
   --%throws(-20501)
   --%test
   PROCEDURE p;
END;
/

CREATE OR REPLACE PACKAGE pkg2 IS
   --%suite
   
   --%test
   PROCEDURE p;
END;
/

2. Run them in a SQL Developer worksheet

SET SERVEROUTPUT ON SIZE UNLIMITED
EXECUTE ut.run;

and the result looks good:

pkg1
  p [.11 sec] (FAILED - 1)
 
pkg2
  p [.094 sec] (FAILED - 2)
 
Failures:
 
  1) p
      Actual: -4067 was expected to equal: -20501
      ORA-04067: not executed, package body "SCOTT.PKG1" does not exist
      ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.PKG1"
      ORA-06512: at line 6
       
  2) p
      ORA-04067: not executed, package body "SCOTT.PKG2" does not exist
      ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.PKG2"
      ORA-06512: at line 6
Finished in .211323 seconds
2 tests, 1 failed, 1 errored, 0 disabled, 0 warning(s)

3. Run the same tests with the realtime reporter in SQL Developer

image
This looks good. You can click on the second test and click on every single tab (test, failures, errors, warnings, info). But when you click on the first test the GUI is blocked. You cannot navigate successfully to the first test. The following screenshot shows the inconsistencies.
image

4. Workaround (not really)

Create a package body for the test with the throws annotation, like this:

CREATE OR REPLACE PACKAGE BODY pkg1 IS
   PROCEDURE p IS
   BEGIN
      raise_application_error(-20501, 'some error');
   END;   
END;
/

When the test succeeds then the GUI behaves as expected. When the test fails, then navigation to the failed test is not possible.

@PhilippSalvisberg
Copy link
Member Author

It's a NPE. caller in Expectation is null...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant