Browse Source

Testfall-Projekte sollen helfen, Testfälle zu gruppieren. #5

qa_0.6_Release
Daniel Quathamer 2 years ago
parent
commit
79bc702db4
  1. 54
      src-modules/module/qa/conf/qa.xml
  2. 127
      src-modules/module/qa/datentabellen/qa_dbtest_ausfuehren.sql
  3. 1
      src-modules/module/qa/masken/37000_felderinfo.unl
  4. 1
      src-modules/module/qa/masken/37000_masken_felder_bez.unl
  5. 2
      src-modules/module/qa/masken/37000_maskeninfo.unl
  6. 1
      src-modules/module/qa/masken/37020_felderinfo.unl
  7. 1
      src-modules/module/qa/masken/37020_masken_felder_bez.unl
  8. 2
      src-modules/module/qa/masken/37020_maskeninfo.unl
  9. 26
      src-modules/module/qa/masken/37140_maskeninfo.unl

54
src-modules/module/qa/conf/qa.xml

@ -222,7 +222,33 @@ notnull="true"> @@ -222,7 +222,33 @@ notnull="true">
</rs></primaryKeys>
<!-- TODO indices-->
</table>
<table name="qa_mask_execution2project" caption="Masken-Test zu Projekt" thema="Qualitätssicherung" typ="Schlüsseltabelle">
<columns><column name="tid" type ="SERIAL" size ="10" default ="" notnull ="true" description=""/>
<column name="mask_execution_id" type ="INTEGER" size ="255" default ="" notnull ="true" isKey="true" description="DB-Test"/>
<column name="project_id" type ="INTEGER" size ="10" default ="" notnull ="true" description="Projekt"/>
<column name="issue_id" type ="VARCHAR" size ="255" default ="" notnull ="false" description="Ticketnummer"><comment></comment></column>
</columns>
<indexes>
<index name="ix_qa_mask_execution2project_id" type="unique">
<index-column name="mask_execution_id"/>
<index-column name="project_id"/>
</index>
</indexes>
<primaryKeys><rs>
<row>
<fld name='table_cat'></fld>
<fld name='table_schem'></fld>
<fld name='table_name'>qa_mask_execution2project</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>pk_qa_mask_execution2project</fld>
</row>
</rs></primaryKeys>
<foreignKeys></foreignKeys>
<importedKeys></importedKeys>
<privileges><rs>
</rs></privileges>
</table>
<!--Tabellenvergleiche -->
<table name="qa_tablecomp_profile" thema="Qualitätssicherung" typ="Schlüsseltabelle" >
<description>Tabellenvergleich Name des Profils</description>
@ -276,6 +302,8 @@ notnull="true"> @@ -276,6 +302,8 @@ notnull="true">
<!-- TODO indices-->
</table>
<table name="qa_tablecomp_aggregation" thema="Qualitätssicherung" typ="Schlüsseltabelle" >
<description>Tabellenvergleich Abgleiche Summen im Rahmen eines Profils</description>
<columns>
@ -700,6 +728,18 @@ delete="FALSE" displayType="select" visibleFields="name" @@ -700,6 +728,18 @@ delete="FALSE" displayType="select" visibleFields="name"
format="%s">
<relation-column from="tid" to="systeminfo_id" />
</relation>
<!--qa_mask_execution2project-->
<relation from="qa_project" to="qa_mask_execution2project"
delete="FALSE" displayType="select" visibleFields="name"
format="%s">
<relation-column from="tid" to="project_id" />
</relation>
<relation from="qa_mask_execution" to="qa_mask_execution2project"
delete="FALSE" displayType="select" visibleFields="name"
format="%s">
<relation-column from="tid" to="mask_execution_id" />
</relation>
<!-- qa_mask_field_sel -->
<relation from="qa_mask_execution" to="qa_mask_field_sel"
delete="FALSE" displayType="select" visibleFields="name"
@ -834,6 +874,8 @@ format="%s"> @@ -834,6 +874,8 @@ format="%s">
<action>
<nativeaction sql="" scriptfile="$QA_PFAD/schluesseltabellen/qa_mask_execution_update.sql"
database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/qa_dbtest_ausfuehren.sql"
database=""/>
<nativeaction sql="update systeminfo set datum=today() where tid in (260)" scriptfile="" database=""/>
</action>
@ -903,6 +945,16 @@ mode="update_insert_delete_copy"> @@ -903,6 +945,16 @@ mode="update_insert_delete_copy">
<customfield name="output_filename" visibleSize="50" nullFieldValue="" />
-->
<customfield name="systeminfo_id" visibleSize="50" nullFieldValue="" />
<customfield name="Projekt" type="subform" multipart="false" autoUpdate="false"
maxRows="*" table="qa_mask_execution2project" parentField="tid" childField="mask_execution_id"
orderBy="" allowNew="true"
mode="update_insert_delete">
<field-selection complete="false" />
<customfield name="mask_execution_id" type="hidden" overrideValue="tid" />
<customfield name="project_id" nullFieldValue="" visibleSize="5" />
<customfield name="issue_id" nullFieldValue="" visibleSize="5" />
</customfield>
</form>
<form name="qa_tablecomp_profile_list"
table="qa_tablecomp_profile"

127
src-modules/module/qa/datentabellen/qa_dbtest_ausfuehren.sql

@ -0,0 +1,127 @@ @@ -0,0 +1,127 @@
--Freemarker Template
--Achtung: Diese Script ist auch das select_stmt der Maske 37140
<#include "SQL_lingua_franca"/>
<#include "SuperX_general"/>
<sqlvars>
<sqlvar name="qa_dbtests" type='hashsequence'>
select
R.fieldclause,
R.fromclause,
R.groupbyclause,
R.orderbyclause,
T.tid,
T.uniquename,
T.name,
T.whereclause
FROM qa_dbtest T, qa_resultset R
where
T.resultset_id=R.tid
and T.active=1
;
</sqlvar>
<sqlvar name="qa_dbtest_assertions" type='hashsequence'>
select
A.dbtest_id,
A.tid,
A.rownr ,
A.def_col_caption,
A.def_col_name,
A.def_col_value
FROM qa_dbtest_assertion A
where A.dbtest_id in (select T.tid
from qa_dbtest T where T.active=1)
;
</sqlvar>
</sqlvars>
<#assign inEtl=true />
<#if Maskennummer?exists && Maskennummer=37140>
<#assign inEtl=false />
</#if>
<#assign dbtest_id="" />
<#if inEtl>
<#else>
/* <#assign dbtest_id="<<DB-Test>>" />*/
</#if>
create temp table tmp_qa_dbtest_result_id
(qa_dbtest_result_id integer);
<#foreach dbtest in qa_dbtests>
<#if dbtest_id == "" || dbtest_id==dbtest.tid?string>
select now() as beginn
into temp tmp_anfang;
select ${dbtest.fieldclause}
into temp tmp_rs
from ${dbtest.fromclause}
<#if dbtest.whereclause !=''>
where ${dbtest.whereclause}
</#if>
<#if dbtest.groupbyclause !=''>
group by ${dbtest.groupbyclause}
</#if>
<#if dbtest.orderbyclause !=''>
order by ${dbtest.orderbyclause}
</#if>
;
<#foreach dbtest_assertion in qa_dbtest_assertions>
<#if dbtest_assertion.dbtest_id==dbtest.tid>
insert into qa_dbtest_result(
dbtest_assertion_id,
execution_start ,
execution_end ,
result_code ,
result_value )
select
${dbtest_assertion.tid},
A.beginn,
now(),
case when T.${dbtest_assertion.def_col_name}='${dbtest_assertion.def_col_value}' then 0
else 1 end as result_code,
T.${dbtest_assertion.def_col_name} as result_value
from tmp_anfang A left outer join tmp_rs T
on (1=${dbtest_assertion.rownr})
;
insert into tmp_qa_dbtest_result_id(qa_dbtest_result_id)
<#if SQLdialect='Postgres'>
select currval('qa_dbtest_result_tid_seq') from xdummy
<#else>
select max(tid) from qa_dbtest_result
</#if>
;
</#if>
</#foreach>
drop table tmp_rs;
drop table tmp_anfang;
</#if>
</#foreach>
<#if !inEtl>
select T.tid as dbtest_id,
T.name,
R.execution_start,
R.execution_end,
case when R.result_code=0 then 'Erfolg' else 'Warnung' end as result_str,
R.result_value,
'37100&DB-Test=' || T.tid as nexttable
FROM qa_dbtest T, qa_dbtest_result R,qa_dbtest_assertion A
where A.tid=R.dbtest_assertion_id
and T.tid=A.dbtest_id
and T.tid=<<DB-Test>>
and R.tid in (select qa_dbtest_result_id from tmp_qa_dbtest_result_id)
order by 4 desc;
</#if>

1
src-modules/module/qa/masken/37000_felderinfo.unl

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
37000^Benutzer/in^50^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
37001^Testfall-Schlüssel^10^0^0^150^150^1^sql^50^0^0^^^^
37002^Projekt^10^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^
37003^Name^20^0^0^150^150^1^sql^50^0^0^^^^
37004^Komponente^1^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^^^

1
src-modules/module/qa/masken/37000_masken_felder_bez.unl

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
37000^37000^
37000^37001^
37000^37002^
37000^37003^
37000^37004^

2
src-modules/module/qa/masken/37000_maskeninfo.unl

@ -52,6 +52,8 @@ where M.tid=E.maskeninfo_id\ @@ -52,6 +52,8 @@ where M.tid=E.maskeninfo_id\
/* and E.uniquename ilike '%<<Testfall-Schlüssel>>%' */\
/* and E.systeminfo_id=<<Komponente>> */\
/* and E.maskeninfo_id=<<Maske>> */\
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */\
\
;\
\
update tmp_ergebnis set stylesheet_str=(select S.filename\

1
src-modules/module/qa/masken/37020_felderinfo.unl

@ -6,3 +6,4 @@ @@ -6,3 +6,4 @@
37025^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^^<<SQL>>select 1,'Ja' from xdummy^
37026^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<<SQL>> select today()-3 from xdummy^
37027^Testfall-Schlüssel^55^0^0^150^150^1^sql^50^0^0^^^^
37028^Projekt^15^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^

1
src-modules/module/qa/masken/37020_masken_felder_bez.unl

@ -6,3 +6,4 @@ @@ -6,3 +6,4 @@
37020^37025^
37020^37026^
37020^37027^
37020^37028^

2
src-modules/module/qa/masken/37020_maskeninfo.unl

@ -47,6 +47,8 @@ target="tmp_qa_mask_execution">\ @@ -47,6 +47,8 @@ target="tmp_qa_mask_execution">\
/* and E.name ilike '%<<Testfall-Name (Stichwort)>>%' */\
/* and E.uniquename ilike '%<<Testfall-Schlüssel>>%' */\
/* and date(R.execution_start) >= date_val(<<Ab Datum>>) */\
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */\
\
</@selectintotmp>\
<@informixnolog/>;\
\

26
src-modules/module/qa/masken/37140_maskeninfo.unl

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
37140^Datenbank-Test ausführen^--Freemarker Template\
--Achtung: Diese Script ist auch das select_stmt der Maske 37140\
<#include "SQL_lingua_franca"/>\
<#include "SuperX_general"/>\
<sqlvars>\
@ -16,7 +17,7 @@ T.whereclause\ @@ -16,7 +17,7 @@ T.whereclause\
FROM qa_dbtest T, qa_resultset R\
where \
T.resultset_id=R.tid\
and T.tid=<<DB-Test>>\
and T.active=1\
;\
\
</sqlvar>\
@ -29,18 +30,31 @@ A.def_col_caption,\ @@ -29,18 +30,31 @@ A.def_col_caption,\
A.def_col_name,\
A.def_col_value\
FROM qa_dbtest_assertion A\
where A.dbtest_id=<<DB-Test>>\
where A.dbtest_id in (select T.tid\
from qa_dbtest T where T.active=1)\
;\
\
</sqlvar>\
</sqlvars>\
\
<#assign inEtl=true />\
<#if Maskennummer?exists && Maskennummer=37140>\
<#assign inEtl=false />\
</#if>\
\
<#assign dbtest_id="" />\
<#if inEtl>\
\
<#else>\
\
/* <#assign dbtest_id="<<DB-Test>>" />*/\
</#if>\
create temp table tmp_qa_dbtest_result_id\
(qa_dbtest_result_id integer);\
\
\
<#foreach dbtest in qa_dbtests>\
\
<#if dbtest_id == "" || dbtest_id==dbtest.tid?string>\
\
select now() as beginn\
into temp tmp_anfang;\
@ -92,10 +106,11 @@ select max(tid) from qa_dbtest_result\ @@ -92,10 +106,11 @@ select max(tid) from qa_dbtest_result\
</#foreach>\
drop table tmp_rs;\
drop table tmp_anfang;\
</#if> \
</#foreach>\
\
\
\
<#if !inEtl>\
select T.tid as dbtest_id,\
T.name,\
R.execution_start,\
@ -108,7 +123,8 @@ where A.tid=R.dbtest_assertion_id\ @@ -108,7 +123,8 @@ where A.tid=R.dbtest_assertion_id\
and T.tid=A.dbtest_id\
and T.tid=<<DB-Test>>\
and R.tid in (select qa_dbtest_result_id from tmp_qa_dbtest_result_id)\
order by 4 desc;^XIL List\
order by 4 desc;\
</#if>^XIL List\
drop_and_delete movable_columns sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=2\
min_heading_height=35\

Loading…
Cancel
Save