cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject [1/4] cordova-plugin-test-framework git commit: CB-8070 MedicReporter from plugin-test-framework incompatible with medic couch db structure. It's fixed.
Date Tue, 02 Dec 2014 15:06:27 GMT
Repository: cordova-plugin-test-framework
Updated Branches:
  refs/heads/master babbc4e90 -> a756992d1


CB-8070 MedicReporter from plugin-test-framework incompatible with medic couch db structure.
It's fixed.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/commit/357b8993
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/tree/357b8993
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/diff/357b8993

Branch: refs/heads/master
Commit: 357b89932cf13e0bc035e36cfb65116f98bd6d2a
Parents: babbc4e
Author: maria.bukharina <maria.bukharina@akvelon.com>
Authored: Tue Nov 25 12:46:23 2014 +0300
Committer: maria.bukharina <maria.bukharina@akvelon.com>
Committed: Tue Nov 25 12:46:23 2014 +0300

----------------------------------------------------------------------
 www/assets/jasmine-medic.js |  9 ++++++---
 www/jasmine_helpers.js      | 24 ++++++++++++++----------
 www/medic.js                |  7 ++++---
 3 files changed, 24 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/357b8993/www/assets/jasmine-medic.js
----------------------------------------------------------------------
diff --git a/www/assets/jasmine-medic.js b/www/assets/jasmine-medic.js
index 5673ecb..e14cb35 100644
--- a/www/assets/jasmine-medic.js
+++ b/www/assets/jasmine-medic.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -99,7 +99,8 @@ jasmineRequire.MedicReporter = function(j$) {
       this.postTests({
           mobilespec:buildResults(),
           platform:(platformMap.hasOwnProperty(p) ? platformMap[p] : p),
-          version:p,
+          version: device.version.toLowerCase(),
+          sha: options.sha,
           timestamp:Math.round(Math.floor((new Date()).getTime() / 1000)),
           model:devmodel
           });
@@ -124,7 +125,9 @@ jasmineRequire.MedicReporter = function(j$) {
       console.log('posting tests');
 
       var xhr = new XMLHttpRequest();
-      xhr.open("POST", serverurl+'/result', true);
+      var doc_id = [options.sha, json.version, json.model].map(encodeURIComponent).join('__');
+      var doc_url = serverurl + '/mobilespec_results/' + doc_id;
+      xhr.open("PUT", doc_url, true);
       xhr.setRequestHeader("Content-Type","application/json")
       xhr.send(JSON.stringify(json));
     }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/357b8993/www/jasmine_helpers.js
----------------------------------------------------------------------
diff --git a/www/jasmine_helpers.js b/www/jasmine_helpers.js
index 7d8690c..5c1203d 100644
--- a/www/jasmine_helpers.js
+++ b/www/jasmine_helpers.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -81,13 +81,17 @@ function addJasmineReporters(jasmineInterface, jasmineEnv) {
     jasmineEnv.addReporter(jasmineInterface.htmlReporter);
 
     var medic = require('org.apache.cordova.test-framework.medic');
-    if (medic.enabled) {
-        jasmineRequire.medic(jasmineInterface.jasmine);
-        jasmineInterface.MedicReporter = new jasmineInterface.jasmine.MedicReporter({
-            env: jasmineEnv,
-            log: { logurl: medic.logurl }
-        });
-        jasmineInterface.MedicReporter.initialize();
-        jasmineEnv.addReporter(jasmineInterface.MedicReporter);
-    }
+    medic.load(function () {
+        if (medic.enabled) {
+            jasmineRequire.medic(jasmineInterface.jasmine);
+            jasmineInterface.MedicReporter = new jasmineInterface.jasmine.MedicReporter({
+                env: jasmineEnv,
+                log: { logurl: medic.logurl },
+                sha: medic.sha
+            });
+            jasmineInterface.MedicReporter.initialize();
+            jasmineEnv.addReporter(jasmineInterface.MedicReporter);
+        }
+    });
+    
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/357b8993/www/medic.js
----------------------------------------------------------------------
diff --git a/www/medic.js b/www/medic.js
index 4c3a3c2..eef7750 100644
--- a/www/medic.js
+++ b/www/medic.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -36,12 +36,13 @@ exports.log = function() {
 
 exports.load = function (callback) {
   var xhr = new XMLHttpRequest();
-  xhr.open("GET", "../medic.json", true);
+  xhr.open("GET", "medic.json", true);
   xhr.onload = function() {
     if (xhr.readyState == 4 && xhr.status == 200) {
       var cfg = JSON.parse(xhr.responseText);
-      exports.logurl = cfg.logurl;
+      exports.logurl = cfg.couchdb;
       exports.enabled = true;
+      exports.sha = cfg.sha;
       console.log('Loaded Medic Config: logurl=' + exports.logurl);
     }
     callback();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message