You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by sgrebnov <gi...@git.apache.org> on 2015/02/02 13:54:35 UTC

[GitHub] cordova-plugin-test-framework pull request: CB-8385 Ensure plugin-...

GitHub user sgrebnov opened a pull request:

    https://github.com/apache/cordova-plugin-test-framework/pull/10

    CB-8385 Ensure plugin-test-framework trigger tests only once

    https://issues.apache.org/jira/browse/CB-8385
    
    Simplified medic config loading logic by making it synch => prevent calling callback function several times

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-plugin-test-framework CB-8385

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-test-framework/pull/10.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #10
    
----
commit bb277ac5d5ac675ecc2ff91f6414a17ae0f45442
Author: sgrebnov <v-...@microsoft.com>
Date:   2015-01-30T14:18:06Z

    CB-8385 Ensure plugin-test-framework trigger tests only once

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-test-framework pull request: CB-8385 Ensure plugin-...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-test-framework/pull/10


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-test-framework pull request: CB-8385 Ensure plugin-...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-test-framework/pull/10#discussion_r24069058
  
    --- Diff: www/medic.js ---
    @@ -35,30 +35,27 @@ exports.log = function() {
     };
     
     exports.load = function (callback) {
    -  var xhr = new XMLHttpRequest();
    -  xhr.open("GET", "../medic.json", true);
    -  xhr.onload = function() {
    -    if (xhr.readyState == 4 && (xhr.status == 0 || xhr.status == 200)) {
    -      var cfg = JSON.parse(xhr.responseText);
    -      exports.logurl = cfg.couchdb || cfg.logurl;
    -      exports.enabled = true;
    -      exports.sha = cfg.sha;
    -      console.log('Loaded Medic Config: logurl=' + exports.logurl);
    -    }
    -    callback();
    -  }
    -  xhr.onerror = function() {
    -   callback();
    -  }
    +  var jsonMedic = null;
     
       try {
    +    // attempt to synchronously load medic config
    +    var xhr = new XMLHttpRequest();
    +    xhr.open("GET", "../medic.json", false);
         xhr.send(null);
    -  }
    -  catch(ex) {
    -    // some platforms throw on a file not found
    +    jsonMedic = xhr.responseText;
    +  } catch (ex) { }
    +
    +  // config is available
    +  if (jsonMedic) {
    +    exports.logurl = JSON.parse(jsonMedic).logurl;
    --- End diff --
    
    Ops, I'll fix this shortly. Thx @nikhilkh 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-test-framework pull request: CB-8385 Ensure plugin-...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-plugin-test-framework/pull/10#issuecomment-72810379
  
    LGTM. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-test-framework pull request: CB-8385 Ensure plugin-...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-test-framework/pull/10#discussion_r24058292
  
    --- Diff: www/medic.js ---
    @@ -35,30 +35,27 @@ exports.log = function() {
     };
     
     exports.load = function (callback) {
    -  var xhr = new XMLHttpRequest();
    -  xhr.open("GET", "../medic.json", true);
    -  xhr.onload = function() {
    -    if (xhr.readyState == 4 && (xhr.status == 0 || xhr.status == 200)) {
    -      var cfg = JSON.parse(xhr.responseText);
    -      exports.logurl = cfg.couchdb || cfg.logurl;
    -      exports.enabled = true;
    -      exports.sha = cfg.sha;
    -      console.log('Loaded Medic Config: logurl=' + exports.logurl);
    -    }
    -    callback();
    -  }
    -  xhr.onerror = function() {
    -   callback();
    -  }
    +  var jsonMedic = null;
     
       try {
    +    // attempt to synchronously load medic config
    +    var xhr = new XMLHttpRequest();
    +    xhr.open("GET", "../medic.json", false);
         xhr.send(null);
    -  }
    -  catch(ex) {
    -    // some platforms throw on a file not found
    +    jsonMedic = xhr.responseText;
    +  } catch (ex) { }
    +
    +  // config is available
    +  if (jsonMedic) {
    +    exports.logurl = JSON.parse(jsonMedic).logurl;
    --- End diff --
    
    There is an issue here - earlier code was doing this: exports.logurl = cfg.couchdb || cfg.logurl
    while you are only using logurl. In fact, this breaks our medic server


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-test-framework pull request: CB-8385 Ensure plugin-...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-test-framework/pull/10#issuecomment-72810268
  
    @nikhilkh, addressed CR notes


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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