20%macro group_scope_compare(desc=);
24 select distinct name into :json_globals separated by
' '
25 from dictionary.macros
26 where scope=
'GLOBAL' and prxmatch(
27 '/^MC(\d{1,6}|LIB\d{1,3})_JAD(P\d+LEN|PNUM|VLEN)$/i',strip(name));
29 %mp_assertscope(COMPARE,ignorelist=&json_globals
30 ,desc=&desc,outds=work.test_results)
31%mend group_scope_compare;
33%mddl_getgroups(work.groupmodel)
35%mp_assertscope(SNAPSHOT)
36%mv_getgroups(outds=work.viyagroups)
37%group_scope_compare(desc=mv_getgroups does not leak scope)
38%mp_assertmodel(work.viyagroups,base=work.groupmodel,key=groupuri,
39 desc=Groups have the exact model and unique nonmissing identifiers,
40 outds=work.test_results
43%macro check_group_values();
44 %local base_uri fref lref hasdesc hasitems hasid mismatches;
45 %let base_uri=%mf_getplatform(VIYARESTAPI);
46 %let fref=%mf_getuniquefileref();
47 %let lref=%mf_getuniquelibref();
48 proc http method=
'GET' out=&fref oauth_bearer=sas_services
49 url=
"&base_uri/identities/groups?limit=10000";
50 headers
"Accept"=
"application/json";
52 %mp_assert(iftrue=(&SYS_PROCHTTP_STATUS_CODE=200),
53 desc=Independent groups request succeeds,
54 outds=work.test_results
56 libname &lref JSON fileref=&fref;
57 %let hasitems=%sysfunc(exist(&lref..items));
60 %if &hasitems %then %do;
61 %let hasid=%mf_existvar(&lref..items,
id);
62 %let hasdesc=%mf_existvar(&lref..items,description);
64 data work.expectedgroups;
65 if 0 then set work.groupmodel;
70 %if &hasdesc %then %do;
71 groupdesc=description;
73 keep groupuri groupname groupdesc;
79 proc sort data=work.expectedgroups;
80 by groupuri groupname groupdesc;
82 proc sort data=work.viyagroups out=work.actualgroups;
83 by groupuri groupname groupdesc;
86 %if %mf_nobs(work.expectedgroups)=0 and
87 %mf_nobs(work.actualgroups)=0 %then %do;
91 proc compare base=work.expectedgroups compare=work.actualgroups noprint;
93 %let mismatches=&sysinfo;
95 %mp_assert(iftrue=(&mismatches=0),
96 desc=All group IDs names and descriptions match the API,
97 outds=work.test_results
101%mend check_group_values;