Toad World® Forums

Automatically load of test packages


#1

Hi,

I want to integrate Code Tester into our test environment to run unit tests automatically. You can use Code Tester export->import to load the test definitions. In another thread I read that it is not possible to generate the test package from an API. Therefore I use a tool as TOAD to make a file from the test package, to import the test package into the test environment. However I encounter the problem that Code Tester thinks that the test package and the test definition are not synchronized. Is there a way to tell Code Tester that the test package is OK, so I can run the tests automatically?

Regards,
Sjoerd


#2

Sjoerd,

I am looking into making generation a backend option. In the meantime, let me understand you:

  1. You import the test definition.
  2. Then you compile the test package into the database.
  3. When you try to run the test, Code Tester stops you?

Can you be more specific about errors or messages you are receiving, and when?

Also, Sjoerd, have you had a chance to download the latest beta and check out the automatic XML testing? I would love to hear what you think of it!

Thanks, SF


#3

Hi Steven,

Yes, that’s right. Code Tester marks the Test Definition as ‘Out of Date’. The Program Code and Test Program Code are Current. If I run the test by calling the API I get no test results.

I hope I can find the time to have a look at version 1.6 soon.

Regards,
Sjoerd


#4

Sjoerd, I am having trouble reproducing your problem.

Here is what I did: I went into Toad and opened up the following edit windows:

  1. Definition of betwnstr function
  2. Test package spec and body

I ran 1, then 2. In the Test Dashboard, the test definition for BETWNSTR is now marked “out of date”.

I then ran this block of code to run my test:

DECLARE
l_result qu_config.maxvarchar2;
l_result_row qu_result_xp.last_run_results_api_cur%ROWTYPE;
my_results qu_result_xp.last_run_results_api_rc;
BEGIN
qu_test.run_test_for2 (owner_in => USER
, NAME_IN => ‘BETWNSTR’
, result_out => l_result
, results_out => my_results
, unit_test_guid_list_in => NULL
, test_case_guid_list_in => NULL
, delimiter_in => NULL
);
DBMS_OUTPUT.put_line ('Overall result of test: ’ || l_result);

LOOP
FETCH my_results
INTO l_result_row;

  EXIT WHEN my_results%NOTFOUND;
  DBMS_OUTPUT.put_line (   RPAD (' ', l_result_row.h_level * 2)
                        || ' '
                        || l_result_row.NAME
                        || '-Status: '
                        || l_result_row.result_status
                        || '-Description: '
                        || l_result_row.description
                       );

END LOOP;
END;

And it ran the test. I can see the results. So in my installation (1.5), the fact that the test def is marked as out of date does NOT stop the test from running. I think that maybe something else is going on.

Do any thoughts come to mind or could you explain in more (sorry, boring!) detail exactly what steps you take?

Thanks, SF


#5

Hi Steven,

You are correct I did the same with a simple test definition, and it is no problem to run the test by the API although it is marked out of date. Probably there is something wrong with the test definition. I will have a look at it.

Thanks,
Sjoerd