From 130780482e32e51b8654cace0592650c602cbcb2 Mon Sep 17 00:00:00 2001 From: Erjan Gavalji Date: Wed, 13 Apr 2016 17:01:39 +0300 Subject: [PATCH] Fix the tests, failing on an Arm device Increase the timeouts of the failing webview tests Account for fractions in time taken (run result checker) Specify a skin to improve grid calculations Modify the duration report to have a strict test pass detection string --- .travis.yml | 4 ++-- apps/tests/testRunner.ts | 11 ++++++++--- build/travis-scripts/check-testrun-broken.js | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b32a5174..b8834d715 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ env: - PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER - PACKAGE_NAME=tns-core-modules - NODE_VERSION=5.10.1 - - EMULATOR_API_VER=21 + - EMULATOR_API_VER=22 - RUNTIMEVERSION=next - AVD_NAME=Arm$EMULATOR_API_VER addons: @@ -34,7 +34,7 @@ before_script: - npm install - (cd build/platform-declarations && npm install) - echo no | android create avd --force -n $AVD_NAME -t android-$EMULATOR_API_VER -b armeabi-v7a -c 12M - - emulator -avd $AVD_NAME -no-skin -no-audio -no-window & + - emulator -avd $AVD_NAME -skin WXGA720 -no-audio -no-window & - android-wait-for-emulator script: - jdk_switcher use oraclejdk8 diff --git a/apps/tests/testRunner.ts b/apps/tests/testRunner.ts index 9ca99dea0..fa3ca05f7 100644 --- a/apps/tests/testRunner.ts +++ b/apps/tests/testRunner.ts @@ -106,8 +106,10 @@ var testsWithLongDelay = { testLocationOnce: 10000, testLocationOnceMaximumAge: 10000, //web-view-tests - testLoadExistingUrl: 10000, - testLoadInvalidUrl: 10000 + testLoadExistingUrl: 10000 * 5, + testLoadLocalFile: 10000 * 5, + testLoadInvalidUrl: 10000, + testLoadUpperCaseSrc: 10000 * 5 } var startTime; @@ -150,7 +152,10 @@ function printRunTestStats() { testFileContent = testFileContent.concat(testCases); - let finalMessage = `=== ALL TESTS COMPLETE for ${totalTime} ms === \n${(allTests.length - failedTestCount)} OK, ${failedTestCount} failed\n`; +// DO NOT CHANGE THE FIRST ROW! Used as an indicator for test run pass detection. + let finalMessage = `=== ALL TESTS COMPLETE ===\n` + + `${(allTests.length - failedTestCount)} OK, ${failedTestCount} failed\n` + + `DURATION: ${totalTime} ms`; TKUnit.write(finalMessage, messageType.info); for (j = 0; j < failedTestInfo.length; j++) { let failureMessage = failedTestInfo[j]; diff --git a/build/travis-scripts/check-testrun-broken.js b/build/travis-scripts/check-testrun-broken.js index 3704815d1..a19fbe3c4 100755 --- a/build/travis-scripts/check-testrun-broken.js +++ b/build/travis-scripts/check-testrun-broken.js @@ -1,8 +1,8 @@ #!/usr/bin/env node var fsModule = require('fs'); var resultsFile = 'TestRunResult.txt'; -var successMarker = /=== ALL TESTS COMPLETE for \d+ ms ===/; -var passMarker = /=== ALL TESTS COMPLETE for \d+ ms ===\s+[^\n]*OK,\s+0\s+failed/mg; +var successMarker = /=== ALL TESTS COMPLETE ===/; +var passMarker = /=== ALL TESTS COMPLETE ===\s+[^\n]*OK,\s+0\s+failed/mg; var messages = { crash: 'TEST RUN CRASHED!',