The service wrote a raw HTML line straight to the _webout fileref after the load completed. On Viya, API-submitted jobs (eg via mx_execute) do not always have that fileref connected to a job result, so the output was lost and job-result consumers aborted. Return a proper sasparams table through %webout() instead - the same pattern as the other admin services - and update the test to assert on the webout sasparams message.
54 lines
1.1 KiB
SAS
54 lines
1.1 KiB
SAS
/**
|
|
@file
|
|
@brief testing refreshcatalog service
|
|
|
|
<h4> SAS Macros </h4>
|
|
@li mp_assert.sas
|
|
@li mp_assertdsobs.sas
|
|
@li mx_execute.sas
|
|
|
|
**/
|
|
|
|
|
|
%let _program=&appLoc/services/admin/refreshcatalog;
|
|
|
|
/* test 1 - refresh a specific libref */
|
|
data work.params;
|
|
length name $32 value $1000;
|
|
name='libref';value='DCTEST';output;
|
|
run;
|
|
%mx_execute(&_program,
|
|
viyacontext=&defaultcontext,
|
|
inputparams=work.params,
|
|
outlib=web1,
|
|
mdebug=&sasjs_mdebug
|
|
)
|
|
|
|
%let msgcheck=0;
|
|
data _null_;
|
|
set web1.sasparams;
|
|
putlog (_all_)(=);
|
|
if index(msg,'Catalog Refresh Complete') then call symputx('msgcheck',1);
|
|
run;
|
|
|
|
%mp_assert(
|
|
iftrue=(&msgcheck=1),
|
|
desc=Refresh catalog confirmation message is returned,
|
|
outds=work.test_results
|
|
)
|
|
|
|
/* test 2 - verify the catalog was actually refreshed */
|
|
proc sql noprint;
|
|
create table work.test2 as
|
|
select *
|
|
from &dc_libref..mpe_datacatalog_tabs(where=(&dc_dttmtfmt. lt tx_to))
|
|
where libref="DCTEST";
|
|
%let test2=0;
|
|
select count(*) into: test2 from work.test2;
|
|
|
|
%mp_assert(
|
|
iftrue=(&test2>0),
|
|
desc=DCTEST tables were catalogued by the refresh,
|
|
outds=work.test_results
|
|
)
|