Commit 47c39628 authored by Antonio Terceiro's avatar Antonio Terceiro

More robust way of getting test run duration

parent 3066036b
......@@ -64,11 +64,10 @@ generate_package_run() {
status_file="${status_dir}/${run_id}.json"
log_file="${status_dir}/${run_id}.log"
# parse duration out of log file
local timestamps="$(sed -ns '/^adt-run \[/ { s/^adt-run \[\([0-9: -]*\)\].*$/\1/; p}' "$adtresult/log")"
local last_timestamp="$(echo "$timestamps" | tail -n 1)"
local start_time=$(date -d "$(echo "$timestamps" | head -n 1)" +%s)
local finish_time=$(date -d "$last_timestamp" +%s)
# get run duration
local start_time=$(head -n 1 "$adtresult/timestamps")
local finish_time=$(tail -n 1 "$adtresult/timestamps")
local last_timestamp="$(date --date="@${finish_time}" +%Y-%m-%dT%H:%M:%S)"
duration=$(($finish_time - $start_time))
hours=$(( $duration / 3600 ))
......
......@@ -41,8 +41,13 @@ process_package() {
mkdir -p "$adt_out_dir"
date +%s >> "$adt_out_dir/timestamps" # start timestamp
# ignore output; we'll get the log from the adt-run output-dir
test-package "$pkg" "$adt_out_dir" >/dev/null 2>&1 || true
date +%s >> "$adt_out_dir/timestamps" # finish timestamp
if [ -n "$print_output" ]; then
echo "$adt_out_dir"
fi
......
......@@ -8,6 +8,8 @@ debci (0.7) unstable; urgency=medium
* public/app.js: Adjust the "Pass percentage" Y axis labels so that chart is
actually a percentage chart.
* public/index.html: add link to global Atom feed in the home page.
* debci-test, debci-generate-index: more robust way of calculating test run
duration. Parsing the autopkgtest log is just not good enough.
[ Martin Pitt ]
* Fix report_status() to work for bash scripts.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment