Daniel Quathamer
1 year ago
26 changed files with 2315 additions and 1171 deletions
@ -0,0 +1,133 @@
@@ -0,0 +1,133 @@
|
||||
--Beispielscript kopiert Masken-Testfälle auf der Basis Studierende Datenblatt zu DB-Tests |
||||
--Achtung: uniquenames müssen angepaßt werden |
||||
|
||||
-- truncate table qa_dbtest_assertion |
||||
-- ; |
||||
-- truncate table qa_dbtest2project |
||||
-- ; |
||||
-- truncate table qa_dbtest |
||||
-- ; |
||||
begin work; |
||||
|
||||
select E.tid,E.name,E.uniquename,F.name as feldname,S.field_value, |
||||
(case when F.name='Filter Studierende' then '${' || trim(S.field_value) || '}' |
||||
when F.name in ('Hörerstatus','Köpfe oder Fälle ?') then S.field_value |
||||
when F.name='Status' then 'kz_rueck_beur_ein in (' || trim(S.field_value) || ')' |
||||
when F.name='Bis Semester' then 'sem_rueck_beur_ein<=' || S.field_value |
||||
when F.name='Seit Semester' then 'sem_rueck_beur_ein>=' || S.field_value |
||||
when F.name='Stichtag' then 'stichtag=' || S.field_value |
||||
when F.name='bis Fachsemester' then 'fach_sem_zahl <=' || S.field_value |
||||
when F.name='Geschlecht' then 'geschlecht=' || S.field_value |
||||
when F.name='Felder' then '' |
||||
else 'Unbekanntes Feld' end)::varchar(255) as sqlwhere |
||||
into tmp_tc |
||||
from qa_mask_execution E, qa_mask_field_sel S, felderinfo F |
||||
where E.tid=S.mask_execution_id |
||||
and F.tid=S.felderinfo_id |
||||
--and E.uniquename='160440_Köpfe_20182_amtlich_01.4_04_Bachelor_mit_LA' |
||||
and E.maskeninfo_id=160440 |
||||
and 2=(select count(*) |
||||
from qa_mask_field_sel S2, felderinfo F2 |
||||
where E.tid=S2.mask_execution_id |
||||
and F2.tid=S2.felderinfo_id |
||||
and ( |
||||
(F2.name='Felder'and S2.field_value='sos_stg_aggr.summe') |
||||
or |
||||
(F2.name='Stichtag' and S2.field_value='1') |
||||
) |
||||
) |
||||
order by 1,2; |
||||
|
||||
select distinct E.tid into temp tmp_invalid |
||||
from tmp_tc E where sqlwhere = 'Unbekanntes Feld'; |
||||
delete from tmp_tc where tid in (select V.tid from tmp_invalid V); |
||||
|
||||
select A.result_value_max,E.* |
||||
into tmp_dbtest |
||||
from qa_mask_execution_assert A, tmp_tc E |
||||
where E.tid=A.mask_execution_id |
||||
and result_value_max=result_value_min |
||||
and is_active=1 |
||||
and rownr=1 |
||||
and colnr=1; |
||||
|
||||
|
||||
insert into qa_dbtest(tid, |
||||
uniquename, |
||||
name, |
||||
systeminfo_id, |
||||
resultset_id, |
||||
whereclause, |
||||
description, |
||||
active |
||||
) |
||||
select tid, |
||||
uniquename, |
||||
name, |
||||
7 as systeminfo_id, |
||||
(select R.tid from qa_resultset R where R.uniquename='students_dp_amtlich_summen') as resultset_id, |
||||
array_to_string(array_agg(sqlwhere),' and ') as whereclause, |
||||
'' as description, |
||||
1 as active |
||||
from tmp_dbtest T |
||||
where T.sqlwhere !='' |
||||
group by 1,2,3,4,5; |
||||
|
||||
insert into qa_dbtest2project |
||||
( |
||||
dbtest_id, |
||||
project_id ) |
||||
select distinct T.tid, |
||||
(select P.tid from qa_project P where P.uniquename='Studierende amtlich Summen') |
||||
FROM tmp_dbtest T |
||||
; |
||||
|
||||
insert into qa_dbtest_assertion |
||||
( |
||||
dbtest_id, |
||||
rownr, |
||||
def_col_caption, |
||||
def_col_name, |
||||
def_col_value) |
||||
select distinct T.tid, |
||||
1 as rownr, |
||||
'Summe', |
||||
'summe', |
||||
T.result_value_max |
||||
FROM tmp_dbtest T |
||||
; |
||||
|
||||
select 'Erfolgreich migrierte Tests'; |
||||
|
||||
select distinct T.name |
||||
from tmp_dbtest T |
||||
order by 1; |
||||
|
||||
delete from qa_mask_execution_assert_result |
||||
where mask_execution_assert_id in (select A.tid |
||||
from qa_mask_execution_assert A, tmp_dbtest T |
||||
where A.mask_execution_id=T.tid); |
||||
|
||||
|
||||
delete from qa_mask_execution_assert |
||||
where mask_execution_id in (select T.tid from tmp_dbtest T); |
||||
|
||||
delete from qa_mask_field_sel |
||||
where mask_execution_id in (select T.tid from tmp_dbtest T); |
||||
|
||||
delete from qa_mask_execution |
||||
where tid in (select T.tid |
||||
from tmp_dbtest T); |
||||
|
||||
drop table tmp_dbtest; |
||||
drop table tmp_tc; |
||||
|
||||
select sp_update_sequence('qa_dbtest'); |
||||
commit; |
||||
|
||||
-- truncate table qa_dbtest_assertion |
||||
-- ; |
||||
-- truncate table qa_dbtest2project |
||||
-- ; |
||||
-- truncate table qa_dbtest |
||||
-- ; |
@ -0,0 +1,201 @@
@@ -0,0 +1,201 @@
|
||||
--Autor: D. Quathamer |
||||
--Datum: 2.8.2019 |
||||
--Freemarker Template |
||||
<#include "SQL_lingua_franca"/> |
||||
<#include "SuperX_general"/> |
||||
--Achtung: Diese Script ist auch das select_stmt der Maske 37020 |
||||
|
||||
<#assign resultValueNative="result_value::float" /> |
||||
<#if SQLdialect='Postgres'> |
||||
<#assign resultValueNative="round(decval(replace(result_value,'.',',')),0) " /> |
||||
</#if> |
||||
|
||||
<#assign inEtl=true /> |
||||
<#if Maskennummer?exists && Maskennummer=37020> |
||||
<#assign inEtl=false /> |
||||
</#if> |
||||
|
||||
<#assign mask_execution_id="" /> |
||||
<#if inEtl> |
||||
|
||||
|
||||
|
||||
<@selectintotmp |
||||
select="A.tid as qa_mask_execution_assert_result_tid, |
||||
R.tid, |
||||
R.mask_execution_id, |
||||
R.execution_start, |
||||
R.execution_end, |
||||
R.result_code, |
||||
null::integer as result_status, |
||||
''::char(255) as result_status_str, |
||||
A.result_value, |
||||
E.tid as execution_id, |
||||
E.name as execution_name, |
||||
E.uniquename, |
||||
E.systeminfo_id, |
||||
''::char(255) as systeminfo_id_str, |
||||
E.maskeninfo_id, |
||||
''::char(255) as maskeninfo_id_str, |
||||
A.mask_execution_assert_id, |
||||
null::integer as result_value_min, |
||||
null::integer as result_value_max, |
||||
null::varchar(255) as assert_caption, |
||||
null::varchar(255)[] as fields |
||||
" |
||||
source="qa_mask_execution E, qa_mask_execution_result R inner join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)" |
||||
target="tmp_qa_mask_execution"> |
||||
-- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen |
||||
where |
||||
E.tid=R.mask_execution_id |
||||
and A.result_code is null |
||||
</@selectintotmp> |
||||
<@informixnolog/>; |
||||
|
||||
<#else> |
||||
|
||||
|
||||
<@selectintotmp |
||||
select="A.tid as qa_mask_execution_assert_result_tid, |
||||
R.tid, |
||||
R.mask_execution_id, |
||||
R.execution_start, |
||||
R.execution_end, |
||||
R.result_code, |
||||
null::integer as result_status, |
||||
''::char(255) as result_status_str, |
||||
A.result_value, |
||||
E.tid as execution_id, |
||||
E.name as execution_name, |
||||
E.uniquename, |
||||
E.systeminfo_id, |
||||
''::char(255) as systeminfo_id_str, |
||||
E.maskeninfo_id, |
||||
''::char(255) as maskeninfo_id_str, |
||||
A.mask_execution_assert_id, |
||||
null::integer as result_value_min, |
||||
null::integer as result_value_max, |
||||
null::varchar(255) as assert_caption, |
||||
null::varchar(255)[] as fields, |
||||
('' || E.maskeninfo_id || '&')::text as nextmask, |
||||
('../edit/qa/qa_mask_execution_edit.jsp|tid=' || E.tid)::varchar(255) as nextedit |
||||
" |
||||
source="qa_mask_execution E, qa_mask_execution_result R left outer join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)" |
||||
target="tmp_qa_mask_execution"> |
||||
-- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen |
||||
where |
||||
E.tid=R.mask_execution_id |
||||
/* and E.is_active=<<Nur aktive>> */ |
||||
/* and E.maskeninfo_id=<<Maske>> */ |
||||
/* and E.userinfo_id=<<Benutzer/in>> */ |
||||
/* and E.systeminfo_id=<<Komponente>> */ |
||||
/* 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>>) */ |
||||
/* and R.tid=<<Result-ID>> */ |
||||
</@selectintotmp> |
||||
<@informixnolog/>; |
||||
|
||||
</#if> |
||||
|
||||
<#if SQLdialect='Postgres'> |
||||
update tmp_qa_mask_execution set result_value_min=A.result_value_min, |
||||
result_value_max=A.result_value_max, |
||||
assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) |
||||
from qa_mask_execution_assert A |
||||
where A.tid=tmp_qa_mask_execution.mask_execution_assert_id; |
||||
<#else> |
||||
--Informix Dialekt: |
||||
update tmp_qa_mask_execution set (result_value_min, |
||||
result_value_max, |
||||
assert_caption) |
||||
= ((select |
||||
A.result_value_min, |
||||
A.result_value_max, |
||||
nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) |
||||
from qa_mask_execution_assert A |
||||
where A.tid=tmp_qa_mask_execution.mask_execution_assert_id |
||||
)) |
||||
where tmp_qa_mask_execution.mask_execution_assert_id in (select A.tid |
||||
from qa_mask_execution_assert A) |
||||
; |
||||
</#if> |
||||
|
||||
|
||||
update tmp_qa_mask_execution set result_status=2, |
||||
result_status_str='Fehler' |
||||
where result_code!=0; |
||||
|
||||
update tmp_qa_mask_execution set result_status=0, |
||||
result_status_str='Erfolg' |
||||
where result_code=0 |
||||
and ( |
||||
(${resultValueNative} >= result_value_min or result_value_min is null) |
||||
and |
||||
(${resultValueNative} <= result_value_max or result_value_max is null) |
||||
) |
||||
; |
||||
|
||||
update tmp_qa_mask_execution set result_status=1, |
||||
result_status_str='Warnung' |
||||
where result_status is null; |
||||
|
||||
<#if inEtl> |
||||
|
||||
update qa_mask_execution_assert_result set result_code=T.result_status |
||||
from tmp_qa_mask_execution T |
||||
where T.qa_mask_execution_assert_result_tid=qa_mask_execution_assert_result.tid |
||||
and qa_mask_execution_assert_result.result_code is null; |
||||
|
||||
drop table tmp_qa_mask_execution; |
||||
|
||||
<#else> |
||||
|
||||
/* delete from tmp_qa_mask_execution where result_status not in (<<Ausführungs-Status>>) ; */ |
||||
|
||||
|
||||
update tmp_qa_mask_execution set systeminfo_id_str=(select name from systeminfo S |
||||
where S.tid=tmp_qa_mask_execution.systeminfo_id); |
||||
|
||||
update tmp_qa_mask_execution set maskeninfo_id_str=(select name from maskeninfo M |
||||
where M.tid=tmp_qa_mask_execution.maskeninfo_id); |
||||
|
||||
<#if SQLdialect='Postgres'> |
||||
|
||||
update tmp_qa_mask_execution set fields=(select array_agg(trim(F.name) || '=' || trim(S.field_value)) |
||||
from qa_mask_field_sel S, felderinfo F |
||||
where S.felderinfo_id=F.tid |
||||
and S.is_active=1 |
||||
and S.mask_execution_id=tmp_qa_mask_execution.execution_id |
||||
); |
||||
|
||||
update tmp_qa_mask_execution set nextmask=nextmask || array_to_string(fields,'&','') |
||||
where fields is not null; |
||||
|
||||
</#if> |
||||
|
||||
select systeminfo_id_str, |
||||
execution_name, |
||||
uniquename, |
||||
maskeninfo_id_str, |
||||
nextmask, |
||||
execution_start, |
||||
<#if SQLdialect='Postgres'> |
||||
round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer, |
||||
<#else> |
||||
execution_end-execution_start as dauer, |
||||
</#if> |
||||
assert_caption, |
||||
result_value_min, |
||||
result_value_max, |
||||
result_value, |
||||
result_status_str, |
||||
('37040&Ergebnis=' || tid)::varchar(255) as nexttable |
||||
<#if UserIsAdmin> |
||||
,nextedit |
||||
</#if> |
||||
from tmp_qa_mask_execution |
||||
order by 1,2,3,4,5,6,7; |
||||
|
||||
</#if> |
@ -0,0 +1,92 @@
@@ -0,0 +1,92 @@
|
||||
--OBSOLET: |
||||
|
||||
begin work; |
||||
|
||||
--welche Maskentests sind noch nicht migriert? |
||||
insert into qa_testcase( |
||||
name, |
||||
userinfo_id, |
||||
testcase_type_id, |
||||
is_active, |
||||
systeminfo_id, |
||||
uniquename, |
||||
mask_execution_id, |
||||
dbtest_id, |
||||
testcase_status_id |
||||
) |
||||
select name, |
||||
userinfo_id, |
||||
1 as testcase_type_id, |
||||
is_active, |
||||
systeminfo_id, |
||||
uniquename, |
||||
E.tid as mask_execution_id, |
||||
null::integer as dbtest_id, |
||||
2 as testcase_status_id --Migration |
||||
FROM qa_mask_execution E |
||||
where E.tid not in (select mask_execution_id |
||||
from qa_testcase |
||||
where mask_execution_id is not null) |
||||
; |
||||
|
||||
--Anhängige Tabellen füllen: |
||||
insert into qa_testcase2project( |
||||
testcase_id, |
||||
project_id, |
||||
issue_id) |
||||
select C.tid, |
||||
P.project_id, |
||||
P.issue_id |
||||
FROM qa_mask_execution2project P, qa_testcase C |
||||
where C.mask_execution_id=P.mask_execution_id |
||||
and C.testcase_status_id=2 |
||||
; |
||||
|
||||
--jetzt dbtests: |
||||
insert into qa_testcase( |
||||
name, |
||||
userinfo_id, |
||||
testcase_type_id, |
||||
is_active, |
||||
systeminfo_id, |
||||
uniquename, |
||||
mask_execution_id, |
||||
dbtest_id, |
||||
testcase_status_id |
||||
) |
||||
select name, |
||||
null::integer as userinfo_id, |
||||
2 as testcase_type_id, |
||||
D.active, |
||||
D.systeminfo_id, |
||||
D.uniquename, |
||||
null::integer as mask_execution_id, |
||||
D.tid as dbtest_id, |
||||
2 as testcase_status_id --Migration |
||||
FROM qa_dbtest D |
||||
where D.tid not in (select dbtest_id |
||||
from qa_testcase |
||||
where dbtest_id is not null) |
||||
; |
||||
|
||||
--Anhängige Tabellen füllen: |
||||
insert into qa_testcase2project( |
||||
testcase_id, |
||||
project_id, |
||||
issue_id) |
||||
select C.tid, |
||||
P.project_id, |
||||
P.issue_id |
||||
FROM qa_dbtest2project P, qa_testcase C |
||||
where C.dbtest_id=P.dbtest_id |
||||
and C.testcase_status_id=2 |
||||
; |
||||
|
||||
|
||||
--migriert: |
||||
update qa_testcase set testcase_status_id=1 |
||||
where testcase_status_id=2; |
||||
|
||||
|
||||
commit; |
||||
|
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
--OBSOLET: |
||||
--truncate table qa_testcase_result; |
||||
|
||||
--maskentests: |
||||
insert into qa_testcase_result( |
||||
testcase_id, |
||||
mask_execution_result_id, |
||||
assertion_def_col_caption, |
||||
execution_start, |
||||
execution_end, |
||||
result_value, |
||||
result_code, |
||||
result_log) |
||||
select |
||||
C.tid as testcase_id, |
||||
P.tid as mask_execution_result_id, |
||||
nvl(A.caption,'' || result_value_min || '-'|| result_value_max) as assertion_def_col_caption, |
||||
P.execution_start, |
||||
P.execution_end, |
||||
R.result_value, |
||||
R.result_code, |
||||
P.result_log |
||||
FROM qa_mask_execution_result P, qa_mask_execution_assert_result R, qa_mask_execution_assert A, qa_testcase C |
||||
where R.mask_execution_result_id=P.tid |
||||
and C.mask_execution_id=P.mask_execution_id |
||||
and A.tid=R.mask_execution_assert_id |
||||
and P.tid not in (select R.mask_execution_result_id |
||||
from qa_testcase_result R |
||||
where R.mask_execution_result_id is not null) |
||||
; |
||||
|
||||
--DB-Tests: |
||||
insert into qa_testcase_result( |
||||
testcase_id, |
||||
dbtest_result_id, |
||||
assertion_def_col_caption, |
||||
execution_start, |
||||
execution_end, |
||||
result_value, |
||||
result_code, |
||||
result_log) |
||||
select |
||||
C.tid as testcase_id, |
||||
P.tid as dbtest_result_id, |
||||
A.def_col_caption, |
||||
P.execution_start, |
||||
P.execution_end, |
||||
P.result_value, |
||||
P.result_code, |
||||
P.result_value |
||||
FROM qa_dbtest_result P, qa_dbtest_assertion A, qa_testcase C |
||||
where C.dbtest_id=A.dbtest_id |
||||
and A.tid=P.dbtest_assertion_id |
||||
and P.tid not in ( |
||||
select R.dbtest_result_id from qa_testcase_result R |
||||
where R.dbtest_result_id is not null) |
||||
; |
||||
|
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash |
||||
|
||||
# Verzeichnis in dem Die Dateien abgelegt werden sollen |
||||
FILE_DIR="$QA_PFAD/etl/mask_execution/tmp" |
||||
mkdir -p $FILE_DIR |
||||
|
||||
# Dateiname |
||||
export FILE_NAME="Testfall_Protokoll" |
||||
|
||||
# Masken TID |
||||
export MASKEN_TID=37020 |
||||
|
||||
# Datum für das Feld "Ab Datum" |
||||
export DATUM_EXEC=$(date "+%d.%m.%Y") |
||||
|
||||
# Masken Parameter |
||||
export MASK_PARAM="Ausführungs-Status=1,2&Ab Datum=${DATUM_EXEC}" |
||||
|
||||
|
||||
# ExecuteMask funktioniert nur im WEB-INF Ordner |
||||
cd $WEBAPP/WEB-INF |
||||
|
||||
echo CMD -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.pdf -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=application/pdf" -logger:$SUPERX_DIR/db/conf/logging.properties |
||||
|
||||
# PDF |
||||
java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.pdf -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=application/pdf" -logger:$SUPERX_DIR/db/conf/logging.properties |
||||
|
||||
# XML |
||||
#java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.xml -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -logger:$SUPERX_DIR/db/conf/logging.properties |
||||
|
||||
# CSV |
||||
java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.csv -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=text/csv" -logger:$SUPERX_DIR/db/conf/logging.properties |
||||
|
||||
# Verzeichnis in dem die Dateien abgelegt wurden. Zum zählen und verschicken. |
||||
cd $FILE_DIR |
||||
sed -i 's/\^/ \| /g' $FILE_DIR/$FILE_NAME.csv |
||||
|
||||
#Zuerst Warnungen und Fehler zählen |
||||
export W_ANZ=$(grep -c Warnung $FILE_DIR/$FILE_NAME.csv) |
||||
export F_ANZ=$(grep -c Fehler $FILE_DIR/$FILE_NAME.csv) |
||||
|
||||
|
||||
#Mail Versand |
||||
cat $FILE_DIR/$FILE_NAME.csv | $MAILPROG -s "Testfall-Protokoll | $W_ANZ Warnungen | $F_ANZ Fehler" -a $FILE_DIR/$FILE_NAME.pdf "${LOGMAIL}" |
||||
|
||||
|
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
|
||||
drop table if exists tmp_testfall_import_felder; |
||||
drop table if exists tmp_testfall_import_feldwerte; |
||||
drop table if exists tmp_testfall_import_erg; |
||||
|
||||
|
||||
create table tmp_testfall_import_felder( |
||||
testfall_schluessel varchar(255), |
||||
feldnr integer, |
||||
feldname varchar(255) |
||||
); |
||||
|
||||
|
||||
create table tmp_testfall_import_feldwerte( |
||||
systeminfo_id integer, |
||||
testfall_schluessel varchar(255), |
||||
maskeninfo_id integer, |
||||
feldnr integer, |
||||
feldwert varchar(255) |
||||
); |
||||
|
||||
create table tmp_testfall_import_erg( |
||||
testfall_schluessel varchar(255), |
||||
systeminfo_id integer, |
||||
mask_execution_id INTEGER , |
||||
rownr INTEGER , |
||||
colnr INTEGER , |
||||
result_value_min FLOAT , |
||||
result_value_max FLOAT , |
||||
is_active smallint default 1 not null, |
||||
caption varchar(255) |
||||
); |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
37160^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^ |
||||
37161^Ausführungs-Status^0^0^0^150^80^10^integer^200^0^1^<<SQL>> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy union select 2,'Fehler' from xdummy order by 1^^^ |
||||
37162^Projekt^20^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;^^^ |
||||
37163^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^0^^^^ |
||||
37164^Komponente^10^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^^^ |
||||
37165^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^ |
||||
37166^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<<SQL>> select today()-3 from xdummy^ |
||||
37167^Testfall^100^0^0^150^200^1^integer^200^0^1^<<SQL>> select T.tid,T.name from qa_testcase T where is_active=1 \ |
||||
/* and T.tid in (select P.testcase_id from qa_testcase2project P where P.project_id=<<Projekt>>) */ \ |
||||
/* and T.systeminfo_id=<<Komponente>> */\ |
||||
order by 2^ ^ ^ |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
37160^260^ |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
37160^37160^ |
||||
37160^37161^ |
||||
37160^37162^ |
||||
37160^37163^ |
||||
37160^37164^ |
||||
37160^37165^ |
||||
37160^37166^ |
||||
37160^37167^ |
@ -0,0 +1,126 @@
@@ -0,0 +1,126 @@
|
||||
37160^Testfall-Protokoll^--Autor: D. Quathamer\ |
||||
--Datum: 2.8.2019\ |
||||
--Freemarker Template\ |
||||
<#include "SQL_lingua_franca"/>\ |
||||
<#include "SuperX_general"/>\ |
||||
\ |
||||
\ |
||||
<#assign resultValueNative="result_value::float" />\ |
||||
<#if SQLdialect='Postgres'>\ |
||||
<#assign resultValueNative="round(decval(replace(result_value,'.',',')),0) " />\ |
||||
</#if>\ |
||||
\ |
||||
\ |
||||
<@selectintotmp \ |
||||
select="\ |
||||
T.tid,\ |
||||
T.name,\ |
||||
T.uniquename,\ |
||||
R.assertion_def_col_caption,\ |
||||
R.execution_start,\ |
||||
R.execution_end,\ |
||||
R.result_code,\ |
||||
R.result_value,\ |
||||
null::integer as result_status,\ |
||||
''::char(255) as result_status_str,\ |
||||
R.result_log,\ |
||||
T.systeminfo_id,\ |
||||
''::char(255) as systeminfo_id_str,\ |
||||
''::varchar(255) as ticket_link,\ |
||||
''::varchar(255) as nexttable,\ |
||||
R.mask_execution_result_id,\ |
||||
R.dbtest_result_id\ |
||||
"\ |
||||
source="qa_testcase T inner join qa_testcase_result R on (R.testcase_id=T.tid /* and date(R.execution_start) >= date_val(<<Ab Datum>>) */)"\ |
||||
target="tmp_qa_testcase">\ |
||||
where \ |
||||
1=1\ |
||||
/* and T.is_active=<<Nur aktive>> */\ |
||||
/* and T.tid in (select P.testcase_id from qa_testcase2project P where P.project_id=<<Projekt>>) */\ |
||||
/* and T.userinfo_id=<<Benutzer/in>> */\ |
||||
/* and T.systeminfo_id=<<Komponente>> */\ |
||||
/* and T.name ilike '%<<Testfall-Name (Stichwort)>>%' */\ |
||||
/* and T.tid=<<Testfall>> */\ |
||||
</@selectintotmp>\ |
||||
<@informixnolog/>;\ |
||||
\ |
||||
update tmp_qa_testcase set ticket_link=P.issue_link || TP.issue_id\ |
||||
from qa_testcase2project TP, qa_project P\ |
||||
where TP.testcase_id=tmp_qa_testcase.tid\ |
||||
and P.tid=TP.project_id\ |
||||
;\ |
||||
\ |
||||
update tmp_qa_testcase set nexttable='37020&Result-ID=' || mask_execution_result_id\ |
||||
where mask_execution_result_id is not null;\ |
||||
update tmp_qa_testcase set nexttable='37100&Result-ID=' || dbtest_result_id\ |
||||
where dbtest_result_id is not null;\ |
||||
\ |
||||
\ |
||||
update tmp_qa_testcase set --result_status=1,\ |
||||
result_status_str='Warnung'\ |
||||
where result_code=1;\ |
||||
update tmp_qa_testcase set result_status=2,\ |
||||
result_status_str='Fehler'\ |
||||
where result_code is null;\ |
||||
-- \ |
||||
update tmp_qa_testcase set \ |
||||
result_status_str='Erfolg'\ |
||||
where result_code=0\ |
||||
;\ |
||||
\ |
||||
/* delete from tmp_qa_testcase where result_code not in ( <<Ausführungs-Status>> ); */\ |
||||
\ |
||||
\ |
||||
update tmp_qa_testcase set systeminfo_id_str=(select name from systeminfo S\ |
||||
where S.tid=tmp_qa_testcase.systeminfo_id);\ |
||||
\ |
||||
select systeminfo_id_str,\ |
||||
name,\ |
||||
uniquename,\ |
||||
case when ticket_link !='' then 'Ticket|' || ticket_link else '' end as nextserverlink,\ |
||||
assertion_def_col_caption,\ |
||||
execution_start,\ |
||||
<#if SQLdialect='Postgres'>\ |
||||
round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer,\ |
||||
<#else>\ |
||||
execution_end-execution_start as dauer,\ |
||||
</#if>\ |
||||
result_value,\ |
||||
result_status_str,\ |
||||
nexttable\ |
||||
from tmp_qa_testcase\ |
||||
order by 1,2,3,4,5,6,7;^XIL List\ |
||||
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ |
||||
white_space_color=COLOR_WHITE fixed_columns=2\ |
||||
min_heading_height=35\ |
||||
Column CID=0 heading_text="Komponente" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=20 text_size=100\ |
||||
Column CID=1 heading_text="Testfall" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=50 text_size=200\ |
||||
Column CID=1 heading_text="Testfall\\nSchlüssel" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=10 text_size=200\ |
||||
Column CID=1 heading_text="Ticket" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=10 text_size=200\ |
||||
Column CID=1 heading_text="Erwartung" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=20 text_size=200\ |
||||
Column CID=1 heading_text="Ausführungszeit\\nStart" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=10 text_size=200\ |
||||
Column CID=1 heading_text="Dauer\\n(Sek.)" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=10 text_size=200\ |
||||
Column CID=1 heading_text="Gefundener Wert" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=10 text_size=200\ |
||||
Column CID=1 heading_text="Ausführungsstatus" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=15 text_size=200\ |
||||
Column CID=1 heading_text="Details" center_heading\ |
||||
row_selectable col_selectable heading_platform readonly\ |
||||
width=15 text_size=200\ |
||||
@@@^^^Übersicht über das Laufzeitverhalten von Masken- und Datenbanktestfällen^drop table tmp_qa_testcase;^^1^440^360^0^1^^ |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
260^37160^ |
@ -0,0 +1,78 @@
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash |
||||
|
||||
#Arbeitsverzeichnis fuer crontab |
||||
PFAD=$2 |
||||
if [ "$PFAD" != "" ] |
||||
then |
||||
|
||||
cd $PFAD |
||||
|
||||
fi |
||||
#Umgebung einlesen: |
||||
if [ "$QA_PFAD" = "" ] |
||||
then |
||||
echo "ACHTUNG: Die Umgebungsvariable QA_PFAD ist nicht gesetzt. Bitte prüfen Sie $SUPERX_DIR/db/bin/SQL_ENV" |
||||
|
||||
exit 1 |
||||
|
||||
fi |
||||
if [ "$QA_ERRORMAIL" != "" ] |
||||
then |
||||
ERRORMAIL=$QA_ERRORMAIL |
||||
export ERRORMAIL |
||||
fi |
||||
if [ "$QA_LOGMAIL" != "" ] |
||||
then |
||||
LOGMAIL=$QA_LOGMAIL |
||||
export LOGMAIL |
||||
fi |
||||
if [ "$QA_BACKUP" != "" ] |
||||
then |
||||
MODULE_BACKUP=$QA_BACKUP |
||||
export MODULE_BACKUP |
||||
fi |
||||
#hier geht es los |
||||
|
||||
#bei QA gibt es keine Rohdaten, daher Tagesdatum: |
||||
date +'%d.%m.%Y' > $QA_LOAD_PFAD/superx.datum |
||||
echo "qa-Update startet" >$QA_ERRORDAT |
||||
|
||||
|
||||
|
||||
runAndCheck.x $QA_PFAD/etl/mask_execution "qa_mask_execution.x" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "QA update$MANDANTID Masken" |
||||
runAndCheck.x $QA_PFAD "module_etl.x qa $QA_PFAD $QA_LOAD_PFAD" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "QA update$MANDANTID" |
||||
cat etl/mask_execution/L_QA_update$MANDANTID.log >>$QA_PFAD/L_QA_update$MANDANTID.log |
||||
echo "---------------------------Beginn Prüfroutine-----------------------------------" >>$QA_ERRORDAT |
||||
cat $QA_PFAD/L_QA_update$MANDANTID.log >>$QA_ERRORDAT |
||||
#cat $QA_PFAD/L_qa_Test$MANDANTID.log >>$QA_ERRORDAT |
||||
#pruefmail.x $QA_PFAD/L_qa_Test$MANDANTID.log $ERRORMAIL |
||||
|
||||
|
||||
#Bei Fehlern Datum zurücksetzen: |
||||
fgrep -s "not found" $QA_ERRORDAT |
||||
FLAG1=$? |
||||
fgrep -i -s "error" $QA_ERRORDAT |
||||
FLAG2=$? |
||||
fgrep -i -s "nicht gefunden" $QA_ERRORDAT |
||||
FLAG3=$? |
||||
fgrep -i -s "fehler" $QA_ERRORDAT |
||||
FLAG4=$? |
||||
|
||||
if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 -o $FLAG4 -eq 0 ] |
||||
then |
||||
echo "Fehler beim QA-Update " |
||||
echo "---------------------------------------" |
||||
echo "Fehlerprotokoll in $QA_ERRORDAT" |
||||
echo "Das Datum wird zurückgesetzt. Kopieren Sie die Datei superx.datum ggf. auf den QA-Rechner" |
||||
echo "---------------------------------------" |
||||
cp $QA_LOAD_PFAD/superx.datum.alt $QA_LOAD_PFAD/superx.datum |
||||
else |
||||
echo "QA-Update erfolgreich" |
||||
if [ "$QA_LOGMAIL" != "" -a "$MAILPROG" != "" ] |
||||
then |
||||
echo "Masken-Ausführung Protokoll ausführen und versenden" |
||||
$QA_PFAD/etl/mask_execution/mask_execution_mail.x >>$QA_ERRORDAT 2>&1 |
||||
fi |
||||
|
||||
fi |
||||
|
@ -0,0 +1,90 @@
@@ -0,0 +1,90 @@
|
||||
begin work; |
||||
|
||||
--welche Maskentests sind noch nicht migriert? |
||||
insert into qa_testcase( |
||||
name, |
||||
userinfo_id, |
||||
testcase_type_id, |
||||
is_active, |
||||
systeminfo_id, |
||||
uniquename, |
||||
mask_execution_id, |
||||
dbtest_id, |
||||
testcase_status_id |
||||
) |
||||
select name, |
||||
userinfo_id, |
||||
1 as testcase_type_id, |
||||
is_active, |
||||
systeminfo_id, |
||||
uniquename, |
||||
E.tid as mask_execution_id, |
||||
null::integer as dbtest_id, |
||||
2 as testcase_status_id --Migration |
||||
FROM qa_mask_execution E |
||||
where E.tid not in (select mask_execution_id |
||||
from qa_testcase |
||||
where mask_execution_id is not null) |
||||
; |
||||
|
||||
--Anhängige Tabellen füllen: |
||||
insert into qa_testcase2project( |
||||
testcase_id, |
||||
project_id, |
||||
issue_id) |
||||
select C.tid, |
||||
P.project_id, |
||||
P.issue_id |
||||
FROM qa_mask_execution2project P, qa_testcase C |
||||
where C.mask_execution_id=P.mask_execution_id |
||||
and C.testcase_status_id=2 |
||||
; |
||||
|
||||
--jetzt dbtests: |
||||
insert into qa_testcase( |
||||
name, |
||||
userinfo_id, |
||||
testcase_type_id, |
||||
is_active, |
||||
systeminfo_id, |
||||
uniquename, |
||||
mask_execution_id, |
||||
dbtest_id, |
||||
testcase_status_id |
||||
) |
||||
select name, |
||||
null::integer as userinfo_id, |
||||
2 as testcase_type_id, |
||||
D.active, |
||||
D.systeminfo_id, |
||||
D.uniquename, |
||||
null::integer as mask_execution_id, |
||||
D.tid as dbtest_id, |
||||
2 as testcase_status_id --Migration |
||||
FROM qa_dbtest D |
||||
where D.tid not in (select dbtest_id |
||||
from qa_testcase |
||||
where dbtest_id is not null) |
||||
; |
||||
|
||||
--Anhängige Tabellen füllen: |
||||
insert into qa_testcase2project( |
||||
testcase_id, |
||||
project_id, |
||||
issue_id) |
||||
select C.tid, |
||||
P.project_id, |
||||
P.issue_id |
||||
FROM qa_dbtest2project P, qa_testcase C |
||||
where C.dbtest_id=P.dbtest_id |
||||
and C.testcase_status_id=2 |
||||
; |
||||
|
||||
|
||||
--migriert: |
||||
update qa_testcase set testcase_status_id=1 |
||||
where testcase_status_id=2; |
||||
|
||||
|
||||
commit; |
||||
|
Loading…
Reference in new issue