Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #281 from asutherland/post-failures-to-s3

Bug 910066 - [email/testing] Have GELAM Travis test-runs post results to  ArbPL instance or other accessible server location. a=test-only
  • Loading branch information...
commit eef23bfd50f7573484002efec3c43404a6161ca0 2 parents 0af073b + ced34b7
@asutherland asutherland authored
View
21 .travis.yml
@@ -1,13 +1,24 @@
language: node_js
node_js:
- - "0.8"
+- '0.8'
before_script:
- - "export DISPLAY=:99.0"
- - "sh -e /etc/init.d/xvfb start"
- - "npm install"
+- export DISPLAY=:99.0
+- sh -e /etc/init.d/xvfb start
+- gem install travis-artifacts
+- npm install
script: bash ./tools/ci/unit/travis.sh
+after_failure:
+- travis-artifacts upload --path test-logs --target-path artifacts/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER
notifications:
email: false
irc:
channels:
- - "irc.mozilla.org#gelam"
+ - irc.mozilla.org#gelam
+env:
+ global:
+ - GELAM_LOG_FAILURES_ONLY=true
+ - GELAM_PRINT_TRAVIS_URLS=http://asuth-gelam-arbpl.s3.amazonaws.com/artifacts/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/
+ - ARTIFACTS_S3_BUCKET=asuth-gelam-arbpl
+ - ARTIFACTS_AWS_REGION=us-east-1
+ - secure: vuOEvAQNtf6NZC3pofnDfxrRUy8xQiD1NAeV8E1owEN26q/iAxNOnn7bQAH1Uw2BqsagtoPfAmudu8y3W3iNxgyRGR/p/Rph6jFhpS2Jjt5jcTEG2ZI+Mf8rroF+CzfY+MMFBmXC1VAmbLuerIOCc9U4yKZzvoLUfyfeSZLdcjc=
+ - secure: nYYcbjOwYIzgIWIy2IW2L0ZYfZxKMbafWrb/CVW4tENL2u1ClrUA8tfCUOqc28Mo2rCJQJdpwKLmKEfyNQ5PpLWzqUtyIbG+Pp9gg9F+I3cjgR9qGqrFv/YHc8ii4oZjijQzOwmMbfqqxgDKnFaP8Ddbd9HqwUMIcW9YhGreHUc=
View
6 Makefile
@@ -111,7 +111,6 @@ define run-tests # $(call run-tests)
-mkdir -p test-profile/device-storage test-profile/fake-sdcard
-mkdir -p test-logs
$(RUNMOZ) $(RUNMOZFLAGS) $(RUNB2G) -app $(CURDIR)/test-runner/application.ini -no-remote -profile $(CURDIR)/test-profile --test-config $(CURDIR)/test/test-files.json --test-variant $(TEST_VARIANT) --test-log-enable "$(TEST_LOG_ENABLE)"
- cat test-logs/*.log > test-logs/all.logs
endef
# run one test
@@ -144,13 +143,16 @@ node_modules: package.json
tests: build test-deps
$(call run-tests)
+concatenated-tests: tests
+ cat test-logs/*.log > test-logs/all.logs
+
one-test: build test-deps
$(call run-one-test)
post-one-test: one-test test-deps
cd $(ARBPLD); ./logalchew $(CURDIR)/test-logs/$(basename $(SOLO_FILE)).logs
-post-tests: tests test-deps
+post-tests: concatenated-tests test-deps
cd $(ARBPLD); ./logalchew $(CURDIR)/test-logs/all.logs
View
45 test-runner/chrome/content/loggest-chrome-runner.js
@@ -488,6 +488,16 @@ const ENVIRON_MAPPINGS = [
name: 'slow',
envVar: 'GELAM_TEST_ACCOUNT_SLOW',
coerce: Boolean
+ },
+ {
+ name: 'logFailuresOnly',
+ envVar: 'GELAM_LOG_FAILURES_ONLY',
+ coerce: Boolean
+ },
+ {
+ name: 'printTravisUrls',
+ envVar: 'GELAM_PRINT_TRAVIS_URLS',
+ coerce: function (x) { return x; }
}
];
var TEST_PARAMS = {
@@ -500,6 +510,9 @@ var TEST_PARAMS = {
defaultArgs: true,
testLogEnable: true,
+
+ logFailuresOnly: false,
+ printTravisUrls: false,
};
var TEST_NAME = null;
@@ -887,8 +900,10 @@ ActiveSyncServerProxy.prototype = {
function summaryFromLoggest(testFileName, variant, logData) {
var summary = {
filename: testFileName,
+ result: null,
tests: []
};
+ var anyFailures = false;
try {
if (logData.fileFailure) {
summary.tests.push({
@@ -897,6 +912,7 @@ function summaryFromLoggest(testFileName, variant, logData) {
// in the case of a file failure, we need the variant hint...
variant: variant
});
+ anyFailures = true;
}
var definerLog = logData.log;
@@ -909,6 +925,9 @@ function summaryFromLoggest(testFileName, variant, logData) {
var testPermLog = testCaseLog.kids[0];
var result = testCaseLog.latched.result;
+ if (result === 'fail') {
+ anyFailures = true;
+ }
// try and generate a concise summary of what failed. In this case, we
// pick the step that failed to report.
@@ -937,6 +956,10 @@ function summaryFromLoggest(testFileName, variant, logData) {
console.harness('Problem generating loggest summary:', ex, '\n', ex.stack);
}
+ if (anyFailures) {
+ summary.result = 'fail';
+ }
+
return summary;
}
@@ -964,6 +987,12 @@ function printTestSummary(summary) {
// (brief) failure details:
if (test.result === 'fail') {
dump(' failing step: ' + test.firstFailedStep + '\n');
+
+ if (TEST_PARAMS.printTravisUrls && summary._filename) {
+ dump(' http://clicky.visophyte.org/tools/arbpl-standalone/?log=' +
+ TEST_PARAMS.printTravisUrls + 'test-logs/' + summary._filename +
+ '\n');
+ }
}
});
}
@@ -1136,10 +1165,17 @@ console.harness('calling writeTestLog and resolving');
logData = JSON.parse(jsonStr);
// this must be done prior to the compartment getting killed
var summary = summaryFromLoggest(testFileName, variant, logData);
- writeTestLog(testFileName, variant, jsonStr).then(function() {
- console.harness('write completed!');
+ if (!TEST_PARAMS.logFailuresOnly || summary.result === 'fail') {
+ writeTestLog(testFileName, variant, jsonStr, summary).then(
+ function() {
+ console.harness('write completed!');
+ deferred.resolve(summary);
+ });
+ }
+ else {
+ console.harness('not a failure, not writing');
deferred.resolve(summary);
- });
+ }
// cleanup may kill things, so don't do this until after the above
// functions have been able to snapshot the log
@@ -1202,11 +1238,12 @@ console.harness('calling writeTestLog and resolving');
return deferred.promise;
}
-function writeTestLog(testFileName, variant, jsonStr) {
+function writeTestLog(testFileName, variant, jsonStr, summary) {
try {
var encoder = new TextEncoder('utf-8');
var logFilename = testFileName + '-' +
variant.replace(/:/g, '_') + '.log';
+ summary._filename = logFilename;
var logPath = do_get_file('test-logs').path +
'/' + logFilename;
console.harness('writing to', logPath);
Please sign in to comment.
Something went wrong with that request. Please try again.