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

[GitHub] cordova-medic pull request: [INFRA-8588] Medic stability improveme...

GitHub user dblotsky opened a pull request:

    https://github.com/apache/cordova-medic/pull/29

    [INFRA-8588] Medic stability improvements

    Using local npm cache for builds. Working around cordova entrypoint on iOS. Making medic just run 'cordova build' and 'cordova run' for iOS.

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

    $ git pull https://github.com/MSOpenTech/cordova-medic ios-fixes

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

    https://github.com/apache/cordova-medic/pull/29.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 #29
    
----
commit fa95208819206d06b3fb3a25363bb3d36721a4d5
Author: Dmitry Blotsky <db...@microsoft.com>
Date:   2015-02-09T22:51:36Z

    [INFRA-8588] Using local npm cache for builds. Working around cordova entrypoint on iOS. Making medic just run 'cordova build' and 'cordova run'.

----


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#issuecomment-73802589
  
    Comments addressed in latest commit.


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24480651
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    --- End diff --
    
    So, I ran this on iOS, and that file actually never comes into existence. It seems like the CouchDB URI gets passed elsewhere.


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24460393
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    --- End diff --
    
    It is a configuration file that tells the test runner where to post to completed results.  It lives in the www folder.


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24456808
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    --- End diff --
    
    Indeed. Where does `medic.json` exist? I've never seen that file.


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24403393
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    --- End diff --
    
    Yes, medic.json should live in the www folder.


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24476010
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    --- End diff --
    
    And it doesn't exist in any repo and being created before running the tests, like here (https://github.com/apache/cordova-medic/blob/master/src/build/makers/windows.js#L86)


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24392364
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    +
    +        //  modify config.xml
    +        var configFile = path.join(output, 'mobilespec', 'config.xml');
    +        fs.writeFileSync(configFile, fs.readFileSync(configFile, 'utf-8').replace(/<content\s*src=".*"/gi, '<content src="'+entry_point+'"'), 'utf-8');
    +        // make sure the couch db server is whitelisted
    +        fs.writeFileSync(configFile, fs.readFileSync(configFile, 'utf-8').replace(/<access origin="http:..audio.ibeat.org" *.>/gi,'<access origin="http://audio.ibeat.org" /><access origin="'+couchdb_cfg.host+'" />', 'utf-8'));
    +
    +    } catch(e) {
    +        error_writer('ios', sha, 'Exception thrown modifying mobile spec application for iOS.', e.message);
             callback(true);
             return;
    -    } else {
    -        // unlock the chain
    -       log('setting up keychain');
    -        var security = shell.exec('security default-keychain -s \'' + keychain_location + '\' && security unlock-keychain -p \'' + keychain_password + '\' \'' + keychain_location+'\'', {silent:true});
    -        if (security.code > 0) {
    -            log('keychain setup failed');
    -            error_writer('ios', sha, 'Could not unlock keychain.', security.output);
    -            callback(true);
    -        } else {
    -          log('starting iOS prepare');
    -          try {
    -            var projectWww = path.join(output, 'www');
    -            // add the medic configuration (sha,host) to destination folder
    -            var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    -            fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    +    }
    +    // compile
    +    log('Compiling.');
    +    log(output);
     
    -            //  modify config.xml
    -            var configFile = path.join(output, 'mobilespec', 'config.xml');
    -            fs.writeFileSync(configFile, fs.readFileSync(configFile, 'utf-8').replace(/<content\s*src=".*"/gi, '<content src="'+entry_point+'"'), 'utf-8');
    -            // make sure the couch db server is whitelisted
    -            fs.writeFileSync(configFile, fs.readFileSync(configFile, 'utf-8').replace(/<access origin="http:..audio.ibeat.org" *.>/gi,'<access origin="http://audio.ibeat.org" /><access origin="'+couchdb_cfg.host+'" />', 'utf-8'));
    +    var mobileSpecDir = path.join(output, '../', '../');
    --- End diff --
    
    Just nitpick: there is no need to add slashes to paths being joined. `path.join` will handle separators by itself.


---
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-medic pull request: [INFRA-8588] Medic stability improveme...

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

    https://github.com/apache/cordova-medic/pull/29#discussion_r24392359
  
    --- Diff: src/build/makers/ios.js ---
    @@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir, sha, devices, entry_poin
         function log(msg) {
             console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
         }
    -    if (keychain_location.length === 0 || keychain_password.length === 0) {
    -        log('No keychain information. Fill that out in config.json if you want to build for iOS.');
    +    log('starting iOS prepare');
    +    try {
    +        var projectWww = path.join(output, 'www');
    +        // add the medic configuration (sha,host) to destination folder
    +        var medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
    +        fs.writeFileSync(path.join(output, 'www','autotest','pages', 'medic.json'),medic_config,'utf-8');
    --- End diff --
    
    I thought that `plugin-test-framework` searches for medic.json at `www` folder (https://github.com/apache/cordova-medic/blob/master/src/build/makers/windows.js#L84-L86)


---
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