utPLSQL / utPLSQL-cli

Command line client for invoking utPLSQL
Apache License 2.0
40 stars 15 forks source link

PLS-00306: wrong number or types of arguments in call to 'RUN' #221

Closed danbuenhombre closed 10 months ago

danbuenhombre commented 10 months ago

Probably me being stupid but I can't get tests to run via CLI. I've got version 3.1.9 installed and 3.1.9 installed in the database. No matter what I provide in the -p option, I get the above error.

I've got several tests defined in a suite path starting with "common". Here's an example command. .\utplsql.bat run -f UT_TFS_JUNIT_REPORTER -o report.xml -p "username:common.test_split" username/password@dbdev:1521/MYDB

In the database, I can run this successfully: begin ut.run('username:common.test_split'); end;

Here's the output from CLI. 15:42:28.829 [main] DEBUG org.utplsql.cli.Cli - Args: run, -f, UT_TFS_JUNIT_REPORTER, -o, report.xml, -p, username:common.test_split, username/password@dbdev:1521/MYDB ########### utPLSQL cli ############

utPLSQL-cli 3.1.9.local

utPLSQL-java-api 3.1.9.local

Java-Version: 19.0.2

ORACLE_HOME: null

NLS_LANG: null

Thanks for testing!

####################################

Use connection string jdbc:oracle:oci8:/@dbdev:1521/MYDB Successfully connected to database. UtPLSQL core: v3.1.9.3270 Oracle-Version: 19.0.0.0.0 Running tests now.

TestRunner initialized Running on utPLSQL v3.1.9.3270 Initializing reporters Running tests ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'RUN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'RUN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

    at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:1157)
    at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:1054)
    at oracle.jdbc.driver.T2CCallableStatement.executeForDescribe(T2CCallableStatement.java:764)
    at oracle.jdbc.driver.T2CCallableStatement.executeForRows(T2CCallableStatement.java:1007)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1205)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3666)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3778)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4251)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1081)
    at org.utplsql.api.testRunner.DynamicTestRunnerStatement.execute(DynamicTestRunnerStatement.java:84)
    at org.utplsql.api.TestRunner.run(TestRunner.java:223)
    at org.utplsql.cli.RunTestRunnerTask.call(RunTestRunnerTask.java:45)
    at org.utplsql.cli.RunTestRunnerTask.call(RunTestRunnerTask.java:24)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1589)

Caused by: Error : 6550, Position : 6, Sql = BEGIN ut_runner.run(a_paths => :1 , a_reporters => :2 , a_color_console => (case :3 when 1 then true else false end), a_fail_on_errors => (case :4 when 1 then true else false end), a_client_character_set => :5 , a_random_test_order => (case :6 when 1 then true else false end));END;, OriginalSql = BEGIN ut_runner.run(a_paths => ?, a_reporters => ?, a_color_console => (case ? when 1 then true else false end), a_fail_on_errors => (case ? when 1 then true else false end), a_client_character_set => ?, a_random_test_order => (case ? when 1 then true else false end));END;, Error Msg = ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'RUN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

    at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:1170)
    ... 16 more
danbuenhombre commented 10 months ago

Update. If I log into the database as the owner of the test packages, I get the error. If I log in as a different user it works.

danbuenhombre commented 10 months ago

It turns out someone had tried to install utPLSQL in the schema where the tests were compiled. The UT package wasn't there but many other objects were there. Once these objects were removed, it works.