Compdating com

Your code outputs exactly the same thing mine does. Also, I found that comparing YYYYMMDD works and I suspect is probably more efficient. I get a list of all jobs that are in FA or TE status, instead of just the ones that failed or terminated on today's date. I have tried many different ways of comparing dates as-is and finally settled on converting the date to seconds then comparing today's seconds to the autorep seconds. /bin/bash # Get all job start/end/status for current failures/terms TODAY=$(date ' %D') TODAYSEC=$(date -d"$ %s) autorep -J SV*_* | egrep -v "gpdata" | grep "GP" | grep grep 'FA\|TE' | while read LINE; do JOBNAME=$(echo $LINE | awk '') LASTSTARTDATE=$(echo $LINE | awk '') LASTSTARTTIME=$(echo $LINE | awk '') LASTENDDATE=$(echo $LINE | awk '') COMPDATE=$(date -d"$" ' %s') LASTENDTIME=$(echo $LINE | awk '') STATUS=$(echo $LINE | awk '') RUN=$(echo $LINE | awk '') if (($COMPDATE -eq $TODAYSEC)); then echo "$JOBNAME,$LASTSTARTDATE,$LASTSTARTTIME,$LASTENDDATE,$LASTENDTIME,$STATUS,$RUN" fi done today=$(date -d %s) autorep -J SV*_* | while IFS= read -r line; do if $line == *GP* && then read jobname laststartdate laststarttime lastenddate lastendtime status run compdate=$(date -d "$lastenddate}" %s) should be compdate=$(date -d "$" %s). Thanks to Glenn for this - I believe this is what I was doing wrong, as debugging showed that my original code was not comparing the seconds as I had expected.The checks function is for writing multiple checks in a simpler format. timeout=30, fail if the step could not complete in 30 seconds - repeat: e.g.repeat=20, repeat in another second if fail until pass, timeout in 20s - duration: e.g.The following code has the same function as the 3 first 3 steps in the code above -t 30 or --timeout 30 in checks() means timeout=30 in check() -r 10 or --repeat 10 in checks() means repeat=10 -d 10 or --duration 10 means duration=10 -x or --xfail or -x True or --xfail True means xfail=True -w or --warning or -w True or --warning True means warning=True -s or --skip or -s True or --skip True means skip=True -e My Exception means exception=My Exception -p pass_str or --passdesc pass_str means passdesc=pass_str -f fail_str or --faildesc fail_str means faildesc=fail_str This feature is to improve test scripts portabiity.

||

Your code outputs exactly the same thing mine does. Also, I found that comparing YYYYMMDD works and I suspect is probably more efficient.

I get a list of all jobs that are in FA or TE status, instead of just the ones that failed or terminated on today's date.

I have tried many different ways of comparing dates as-is and finally settled on converting the date to seconds then comparing today's seconds to the autorep seconds. /bin/bash # Get all job start/end/status for current failures/terms TODAY=$(date ' %D') TODAYSEC=$(date -d"$ %s) autorep -J SV*_* | egrep -v "gpdata" | grep "GP" | grep grep 'FA\|TE' | while read LINE; do JOBNAME=$(echo $LINE | awk '') LASTSTARTDATE=$(echo $LINE | awk '') LASTSTARTTIME=$(echo $LINE | awk '') LASTENDDATE=$(echo $LINE | awk '') COMPDATE=$(date -d"$" ' %s') LASTENDTIME=$(echo $LINE | awk '') STATUS=$(echo $LINE | awk '') RUN=$(echo $LINE | awk '') if (($COMPDATE -eq $TODAYSEC)); then echo "$JOBNAME,$LASTSTARTDATE,$LASTSTARTTIME,$LASTENDDATE,$LASTENDTIME,$STATUS,$RUN" fi done today=$(date -d %s) autorep -J SV*_* | while IFS= read -r line; do if $line !

The script runs, but outputs all jobs in FA and TE status, instead of just the jobs that failed today. = *gpdata* && $line == *GP* && then read jobname laststartdate laststarttime lastenddate lastendtime status run compdate=$(date -d "$lastenddate}" %s) should be compdate=$(date -d "$" %s). Thanks to Glenn for this - I believe this is what I was doing wrong, as debugging showed that my original code was not comparing the seconds as I had expected.

The checks function is for writing multiple checks in a simpler format. timeout=30, fail if the step could not complete in 30 seconds - repeat: e.g.

repeat=20, repeat in another second if fail until pass, timeout in 20s - duration: e.g.

The following code has the same function as the 3 first 3 steps in the code above -t 30 or --timeout 30 in checks() means timeout=30 in check() -r 10 or --repeat 10 in checks() means repeat=10 -d 10 or --duration 10 means duration=10 -x or --xfail or -x True or --xfail True means xfail=True -w or --warning or -w True or --warning True means warning=True -s or --skip or -s True or --skip True means skip=True -e My Exception means exception=My Exception -p pass_str or --passdesc pass_str means passdesc=pass_str -f fail_str or --faildesc fail_str means faildesc=fail_str This feature is to improve test scripts portabiity.

]]

xfail=True, expected failure, report pass when fail, vice versa - warning: e.g. exception=Name Error, expected exception will be raised. passdesc="the string to log if passed" (replace the code_string in the log) - faildesc: e.g.

) si indica un paradigma di erogazione di risorse informatiche, come l'archiviazione, l'elaborazione o la trasmissione di dati, caratterizzato dalla disponibilità on demand attraverso Internet a partire da un insieme di risorse preesistenti e configurabili.

Le risorse non vengono pienamente configurate e messe in opera dal fornitore apposta per l'utente, ma gli sono assegnate, rapidamente e convenientemente, grazie a procedure automatizzate, a partire da un insieme di risorse condivise con altri utenti lasciando all'utente parte dell'onere della configurazione.

However, you are welcome if you want to study meta-programming or functional programming, and your comments are always appreciated lesson 1 - the basic auto-log boolean functions: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson1_lesson 2 - the check function with auto-log string: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson2_lesson 3 - the check functions with options: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson3_lesson 4 - the checks functions - another format for multiple check(s): https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson4_lesson 5 - get return from check and checks function: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson5_lesson 6 - function auto-detection mechanism (pytest/nose users can skip this, use plugin instead): https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson6_func_auto_lesson 7 - return value setting as case pass (0 or None is considerred as pass by default: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson7_lesson 8 - yaml test bed initialization support: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson8_yaml_https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson8_yaml_testbed2lesson 9 - python format test bed initialization support: https://github.com/steven004/Test Steps/blob/master/test_examples/test_lesson9_For pytest or nosetests user, you can use the pytest-autochecklog or nose-autochecklog plugin to use test_steps module.

The pytest-autochecklog or nose-autochecklog plugin has better auto-func-detection mechanism. :action=display&name=pytest-autochecklog or: https://pypi.python.org/pypi? :action=display&name=nose-autochecklog 2015-01-10 ,787 - INFO - ------------------------------------------------------ 2015-01-10 ,788 - INFO - Func test_example in file: /Users/Steven004/test/2015-01-10 ,788 - INFO - Check-1: just pass the check and log it - PASS: 2015-01-10 ,789 - INFO - Check-2: pass if expr else fail - PASS: 2015-01-10 ,789 - INFO - Check-3: 9 == 9 - PASS: 2015-01-10 ,789 - INFO - Check-4: Pass, Shanghai not equal to Beijing - PASS: 2015-01-10 ,792 - ERROR - Check-5: "Shanghai City" =~ "Country" - FAIL: "Shanghai City" =~ "Country"?

Leave a Reply