Skip to content

Commit

Permalink
[jenkins] Add support to build.sh for timing out the build. (#5952)
Browse files Browse the repository at this point in the history
* [jenkins] Add support to build.sh for timing out the build.

* Test timeout support

* [jenkins] Tell the world what happened.

* [jenkins] Minor announcement fix + disable test mode.
  • Loading branch information
rolfbjarne committed Apr 26, 2019
1 parent 6c36746 commit 17fe95a
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions jenkins/build.sh
@@ -1,5 +1,10 @@
#!/bin/bash -e

# Script that builds xamarin-macios for CI
#
# --configure-flags=<flags>: Flags to pass to --configure. Optional
# --timeout=<timeout>: Time out the build after <timeout> seconds.

cd "$(dirname "${BASH_SOURCE[0]}")/.."
WORKSPACE=$(pwd)

Expand All @@ -9,8 +14,48 @@ report_error ()
}
trap report_error ERR

if [[ x$1 == x--configure-flags ]]; then
CONFIGURE_FLAGS="$2"
timeout ()
{
# create a subprocess that kills this process after a certain number of seconds
SELF_PID=$$
(
sleep "$1"
echo "Execution timed out after $1 seconds."
printf "❌ [Build timed out](%s/console)\\n" "$BUILD_URL" >> "$WORKSPACE/jenkins/pr-comments.md"
kill -9 $SELF_PID
)&
# kill the subprocess timeout if we exit before we time out
TIMEOUT_PID=$!
trap 'kill -9 $TIMEOUT_PID' EXIT
}

while ! test -z "$1"; do
case "$1" in
--configure-flags=*)
CONFIGURE_FLAGS="${1#*=}"
shift
;;
--configure-flags)
CONFIGURE_FLAGS="$2"
shift 2
;;
--timeout=*)
TIMEOUT="${1#*=}"
shift
;;
--timeout)
TIMEOUT="$2"
shift 2
;;
*)
echo "Unknown argument: $1"
exit 1
;;
esac
done

if test -n "$TIMEOUT"; then
timeout "$TIMEOUT"
fi

ls -la "$WORKSPACE/jenkins"
Expand Down

8 comments on commit 17fe95a

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Device tests passed on TvOS on Azure DevOps(TvOS): Html Report

Test results

No tests selected.

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Test run, Test run' 🔥

Build succeeded
✅ Packages: xamarin.ios-12.11.0.512.pkg xamarin.mac-5.11.0.512.pkg
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Test run failed 🔥

Test results

7 tests failed, 0 tests skipped, 231 tests passed.

Failed tests

  • mono-native-unified/watchOS - simulator/Debug: Crashed
  • [NUnit] Mono SystemXmlTests/watchOS - simulator/Debug: Crashed
  • [NUnit] Mono SystemJsonTests/watchOS - simulator/Debug: Crashed
  • [NUnit] Mono SystemServiceModelWebTests/watchOS - simulator/Debug: Crashed
  • [NUnit] Mono SystemIOCompressionFileSystemTests/watchOS - simulator/Debug: Crashed
  • [NUnit] Mono MonoCSharpTests/watchOS - simulator/Debug: Crashed
  • [xUnit] Mono SystemSecurityXunit/watchOS - simulator/Debug: Crashed

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Device tests completed (Failed) on iOS on Azure DevOps(iOS): Html Report 🔥

Test results

3 tests failed, 0 tests skipped, 389 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - device/Debug (interpreter): Failed
  • monotouch-test/iOS Unified 64-bits - device/Debug (interpreter -mscorlib): Failed
  • monotouch-test/iOS Unified 64-bits - device/Release (interpreter -mscorlib): Failed

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Status for 'xamarin-macios - sample testing (build)': failure.

  • ✅ Debug|iPhone|A-F: Succeeded
  • ❌ Debug|iPhone|G-R: Failed
  • ❌ Debug|iPhone|S-Z: Failed
  • ❌ Debug|iPhoneSimulator: Failed
  • ✅ Release|iPhone|A-F: Succeeded
  • ❌ Release|iPhone|G-R: Failed
  • ❌ Release|iPhone|S-Z: Failed
  • ❌ Release|iPhoneSimulator: Failed
  • ❌ Debug|Mac: Failed
  • ❌ Release|Mac: Failed

@rolfbjarne
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample test failure:

@mandel-macaque
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting state to success where context is xamarin-macios - sample testing (build).

Samples issue already known: mono/mono#13483

@mandel-macaque
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting state to success where context is VSTS: device tests (iOS).

Interpreter issues are knonw: mono/mono#14246

@mandel-macaque
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting state to success where context is continuous-integration/jenkins/branch.

WatchOS crashes are knonw: https://github.com/xamarin/maccore/issues/581

Please sign in to comment.