osmo-ttcn3-hacks[master]: add update_expected_results_from_jenkins.sh
Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/7754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: add update_expected_results_from_jenkins.sh
Harald Welte has submitted this change and it was merged. Change subject: add update_expected_results_from_jenkins.sh .. add update_expected_results_from_jenkins.sh Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 --- A update_expected_results_from_jenkins.sh 1 file changed, 53 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/update_expected_results_from_jenkins.sh b/update_expected_results_from_jenkins.sh new file mode 100755 index 000..7677cff --- /dev/null +++ b/update_expected_results_from_jenkins.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# Download the latest junit xml results from the jenkins.osmocom.org workspaces. +# Usage: +# - have a clean git clone of osmo-ttcn3-hacks +# - have internet access to jenkins.osmocom.org +# - ./update_expected_results_from_jenkins.sh +# - git diff, make sure that you understand and approve of each and every change +# - git commit -a -m "update expected results" + +not_found="" + +if [ -n "$(git status | grep 'modified:')" ]; then + echo "Your git clone contains modifications! This is not recommended." + echo "Hit enter to continue anyway." + read enter_to_continue +fi + +for target in */expected-results.xml; do + project="$(basename "$(dirname "$target")")" + + # shims for naming exceptions + ws_path="ttcn3-${project}-test/ws/logs/${project}-tester" + if [ "x$project" = "xggsn_tests" ]; then +project="ggsn" + elif [ "x$project" = "xsysinfo" ]; then +ws_path="ttcn3-nitb-sysinfo/ws/logs/ttcn3-nitb-sysinfo" + fi + + # find out the junit-NN.xml name + dir_url="https://jenkins.osmocom.org/jenkins/job/$ws_path/"; + junit_file="$(wget -q -O - "$dir_url" | grep 'junit-xml-[0-9]*\.log' | tail -n 1 | sed 's/.*\(junit-xml-[0-9]*\.log\).*/\1/')" + + # update + target_new="$target.new" + if ! wget -O "$target_new" "${dir_url}$junit_file"; then +not_found="$not_found $project" +rm -f "$target_new" + else +mv "$target_new" "$target" + fi +done + +./mask_expected_results.sh + +echo " + + MAKE SURE THE RESULTING CHANGES ARE SANE BEFORE COMMITTING! + +" +if [ -n "$not_found" ]; then + echo "Could not update: $not_found" +fi -- To view, visit https://gerrit.osmocom.org/7754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr
[PATCH] osmo-ttcn3-hacks[master]: add update_expected_results_from_jenkins.sh
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7754 to look at the new patch set (#3). add update_expected_results_from_jenkins.sh Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 --- A update_expected_results_from_jenkins.sh 1 file changed, 53 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/7754/3 diff --git a/update_expected_results_from_jenkins.sh b/update_expected_results_from_jenkins.sh new file mode 100755 index 000..7677cff --- /dev/null +++ b/update_expected_results_from_jenkins.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# Download the latest junit xml results from the jenkins.osmocom.org workspaces. +# Usage: +# - have a clean git clone of osmo-ttcn3-hacks +# - have internet access to jenkins.osmocom.org +# - ./update_expected_results_from_jenkins.sh +# - git diff, make sure that you understand and approve of each and every change +# - git commit -a -m "update expected results" + +not_found="" + +if [ -n "$(git status | grep 'modified:')" ]; then + echo "Your git clone contains modifications! This is not recommended." + echo "Hit enter to continue anyway." + read enter_to_continue +fi + +for target in */expected-results.xml; do + project="$(basename "$(dirname "$target")")" + + # shims for naming exceptions + ws_path="ttcn3-${project}-test/ws/logs/${project}-tester" + if [ "x$project" = "xggsn_tests" ]; then +project="ggsn" + elif [ "x$project" = "xsysinfo" ]; then +ws_path="ttcn3-nitb-sysinfo/ws/logs/ttcn3-nitb-sysinfo" + fi + + # find out the junit-NN.xml name + dir_url="https://jenkins.osmocom.org/jenkins/job/$ws_path/"; + junit_file="$(wget -q -O - "$dir_url" | grep 'junit-xml-[0-9]*\.log' | tail -n 1 | sed 's/.*\(junit-xml-[0-9]*\.log\).*/\1/')" + + # update + target_new="$target.new" + if ! wget -O "$target_new" "${dir_url}$junit_file"; then +not_found="$not_found $project" +rm -f "$target_new" + else +mv "$target_new" "$target" + fi +done + +./mask_expected_results.sh + +echo " + + MAKE SURE THE RESULTING CHANGES ARE SANE BEFORE COMMITTING! + +" +if [ -n "$not_found" ]; then + echo "Could not update: $not_found" +fi -- To view, visit https://gerrit.osmocom.org/7754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr
osmo-ttcn3-hacks[master]: add update_expected_results_from_jenkins.sh
Patch Set 2: > I think this script deserves some usage documentation / comments? It's fire and forget, but agreed. -- To view, visit https://gerrit.osmocom.org/7754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: add update_expected_results_from_jenkins.sh
Patch Set 1: I think this script deserves some usage documentation / comments? -- To view, visit https://gerrit.osmocom.org/7754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-ttcn3-hacks[master]: add update_expected_results_from_jenkins.sh
Review at https://gerrit.osmocom.org/7754 add update_expected_results_from_jenkins.sh Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 --- A update_expected_results_from_jenkins.sh 1 file changed, 39 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/7754/1 diff --git a/update_expected_results_from_jenkins.sh b/update_expected_results_from_jenkins.sh new file mode 100755 index 000..ba0b912 --- /dev/null +++ b/update_expected_results_from_jenkins.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +not_found="" + +for target in */expected-results.xml; do + project="$(basename "$(dirname "$target")")" + + # shims for naming exceptions + ws_path="ttcn3-${project}-test/ws/logs/${project}-tester" + if [ "x$project" = "xggsn_tests" ]; then +project="ggsn" + elif [ "x$project" = "xsysinfo" ]; then +ws_path="ttcn3-nitb-sysinfo/ws/logs/ttcn3-nitb-sysinfo" + fi + + # find out the junit-NN.xml name + dir_url="https://jenkins.osmocom.org/jenkins/job/$ws_path/"; + junit_file="$(wget -q -O - "$dir_url" | grep 'junit-xml-[0-9]*\.log' | tail -n 1 | sed 's/.*\(junit-xml-[0-9]*\.log\).*/\1/')" + + # update + target_new="$target.new" + if ! wget -O "$target_new" "${dir_url}$junit_file"; then +not_found="$not_found $project" +rm -f "$target_new" + else +mv "$target_new" "$target" + fi +done + +./mask_expected_results.sh + +echo " + + MAKE SURE THE RESULTING CHANGES ARE SANE BEFORE COMMITTING! + +" +if [ -n "$not_found" ]; then + echo "Could not update: $not_found" +fi -- To view, visit https://gerrit.osmocom.org/7754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3ad8554fc59112c11325425ccd70ca1dbd8c123 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr