You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dr...@apache.org on 2013/12/17 21:17:28 UTC
[1/2] git commit: windows8 stability improvements and fixes
Updated Branches:
refs/heads/master 164c60a7c -> f2fac4ad5
windows8 stability improvements and fixes
Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/8f2288c2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/8f2288c2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/8f2288c2
Branch: refs/heads/master
Commit: 8f2288c22f08f156ad4c66d2668da5d098d54bd2
Parents: 164c60a
Author: sgrebnov <se...@gmail.com>
Authored: Tue Dec 17 22:38:36 2013 +0400
Committer: sgrebnov <se...@gmail.com>
Committed: Tue Dec 17 22:38:36 2013 +0400
----------------------------------------------------------------------
config.json.sample-windows | 12 +-----
cordova-plugin-medic/www/jasmine-jsreporter.js | 12 ++++--
master.cfg | 5 +--
src/build/makers/windows8.js | 48 ++++++++++-----------
src/build/makers/windows8/deploy.js | 6 ++-
writejson.js | 5 +++
6 files changed, 42 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/8f2288c2/config.json.sample-windows
----------------------------------------------------------------------
diff --git a/config.json.sample-windows b/config.json.sample-windows
index 23f23a3..4ffdef9 100644
--- a/config.json.sample-windows
+++ b/config.json.sample-windows
@@ -6,16 +6,8 @@
"port":8088
},
"app":{
- "static":{
- "path":null
- },
- "dynamic":{
- "commit_hook":"src/build/makers/mobile_spec/commit_hook.js",
- "builder":"src/build/makers/mobile_spec",
- "git":"https://git-wip-us.apache.org/repos/asf/cordova-mobile-spec.git"
- },
- "entry":"autotest/pages/all.html",
- "platforms":"wp8 windows8",
+ "entry":"www/autotest/pages/all.html",
+ "platforms":"windows8,wp8",
"release":"master",
"timeout": 600
},
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/8f2288c2/cordova-plugin-medic/www/jasmine-jsreporter.js
----------------------------------------------------------------------
diff --git a/cordova-plugin-medic/www/jasmine-jsreporter.js b/cordova-plugin-medic/www/jasmine-jsreporter.js
index dd037ed..adee25e 100644
--- a/cordova-plugin-medic/www/jasmine-jsreporter.js
+++ b/cordova-plugin-medic/www/jasmine-jsreporter.js
@@ -142,7 +142,10 @@ limitations under the License.
console.log('[[[ TEST FAILED ]]]');
}
console.log('>>> DONE <<<');
- if (blackberry && blackberry.app && blackberry.app.exit) blackberry.app.exit();
+ try { // throws exception on windows8
+ if (blackberry && blackberry.app && blackberry.app.exit) blackberry.app.exit();
+ } catch (ex) { }
+
} else if (xhr.status == 409) {
console.log('conflict on couch');
// HTTP 409 Conflict
@@ -194,7 +197,9 @@ limitations under the License.
console.log('some crazy shit happened. couch returned some balltastic info. status code: ' + xhr.status);
console.log(xhr.responseText);
console.log('>>> DONE <<<');
- if (blackberry && blackberry.app && blackberry.app.exit) blackberry.app.exit();
+ try { // throws exception on windows8
+ if (blackberry && blackberry.app && blackberry.app.exit) blackberry.app.exit();
+ } catch (ex) { }
}
}
};
@@ -204,5 +209,4 @@ limitations under the License.
// export public
jasmine.JSReporter = JSReporter;
-})();
-
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/8f2288c2/master.cfg
----------------------------------------------------------------------
diff --git a/master.cfg b/master.cfg
index 3a0c4d3..3fbe4be 100644
--- a/master.cfg
+++ b/master.cfg
@@ -74,7 +74,7 @@ from buildbot.changes import pb
c['slaves'] = [
BuildSlave("ios-slave", "pass",max_builds=1),
BuildSlave("android-slave", "pass",max_builds=1),
- BuildSlave("windows-slave", "pass",max_builds=1),
+ BuildSlave("windows-slave", "pass",max_builds=2),
BuildSlave("common-slave","pass",max_builds=3)
]
@@ -290,8 +290,6 @@ if(build_wp8) :
factory_wp8.addStep(ShellCommand(command=[shellCmd,shellRunParam, "git clone -b " + branches['CLI'] + ' ' + repos['CLI'] + " cordova-cli"],workdir='build',haltOnFailure=True, description='Get CLI', descriptionDone='Get CLI'))
factory_wp8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->dev',descriptionDone='Plugins->dev'))
factory_wp8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
- # cordova-wp8 still has 3.0.0 version so rewrite version explicitly
- factory_wp8.addStep(ShellCommand(command=[shellCmd, shellRunParam,"echo 3.1.0 > VERSION"], workdir='build/cordova-wp8',haltOnFailure=True, description='Version overwrite',descriptionDone='Version owerwrite'))
# pach cordova-wp8 template to prevent app to lock the screen. In other case we won't be able to re-install the app next time.
factory_wp8.addStep(ShellCommand(command=["node","medic\src\utils\patch_wp8_template.js"],workdir='build',haltOnFailure=True, description='Patch WP8 template',descriptionDone='Patch WP8 template'))
factory_wp8.addSteps(common_steps_mobilespec_1)
@@ -313,7 +311,6 @@ if(build_windows8) :
factory_windows8.addStep(ShellCommand(command=[shellCmd,shellRunParam, "git clone -b " + branches['CLI'] + ' ' + repos['CLI'] + " cordova-cli"],workdir='build',haltOnFailure=True, description='Get CLI', descriptionDone='Get CLI'))
factory_windows8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->dev',descriptionDone='Plugins->dev'))
factory_windows8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
-
factory_windows8.addSteps(common_steps_mobilespec_1)
factory_windows8.addStep(ShellCommand(command=["node","medic/writejson.js","--branch=master"],workdir='build',haltOnFailure=True, description='Write json',descriptionDone='Write json'))
factory_windows8.addStep(ShellCommand(command=["node","../cordova-cli/bin/cordova","platform","add","windows8"],workdir='build\\mobilespec',haltOnFailure=True, description='Platform Add',descriptionDone='Platform Add'))
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/8f2288c2/src/build/makers/windows8.js
----------------------------------------------------------------------
diff --git a/src/build/makers/windows8.js b/src/build/makers/windows8.js
index f2ed3d4..abd0042 100644
--- a/src/build/makers/windows8.js
+++ b/src/build/makers/windows8.js
@@ -10,7 +10,7 @@ var shell = require('shelljs'),
module.exports = function(output, sha, entry_point, couchdb_host, test_timeout, callback) {
- var packageName = 'org.apache.cordova.mobilespec.windows8';
+ var packageName = 'org.apache.mobilespec';
var packageInfo = {};
function query_for_sha(sha, callback) {
@@ -84,33 +84,22 @@ module.exports = function(output, sha, entry_point, couchdb_host, test_timeout,
// modify start page
var manifest = fs.readFileSync(path.join(output, 'package.appxmanifest')).toString().split('\n');
for (var i in manifest) {
- if (manifest[i].indexOf('index.html') != -1) {
- manifest[i] = manifest[i].replace('index.html', entry_point);
+ if (manifest[i].indexOf('www/index.html') != -1) {
+ log('Modifying start page to ' + entry_point);
+ manifest[i] = manifest[i].replace('www/index.html', entry_point);
break;
}
}
+ // set permanent package name to prevent multiple installations
+ for (var i in manifest) {
+ if (manifest[i].indexOf('<Identity') != -1) {
+ manifest[i] = manifest[i].replace(/Name=".+?"/gi, 'Name="'+packageName+'"');
+ break;
+ }
+ }
+
+ manifest = manifest.join('\n');
- // for some reasons cordova-cli generates incorrect manifest file
- // fix it and also set permanent package name to prevent multiple installations
-// for (var i in manifest) {
-// if (manifest[i].indexOf('<Identity') != -1) {
-// var nameIndex = manifest[i].indexOf('Name="') + 6;
-// var endNameIndex = manifest[i].indexOf('"', nameIndex);
-// var stringAsArray = manifest[i].split('');
-// stringAsArray.splice(nameIndex, endNameIndex - nameIndex, packageName.split(''));
-// manifest[i] = stringAsArray.join('').replace(/,/g, '');
-// var versionIndex = manifest[i].indexOf('Version="') + 9;
-// var endVersionIndex = manifest[i].indexOf('"', versionIndex);
-// stringAsArray = manifest[i].split('');
-// var version = manifest[i].substr(versionIndex, endVersionIndex - versionIndex);
-// while (version.split('.').length < 4) version += '.0';
-// stringAsArray.splice(versionIndex, endVersionIndex - versionIndex, version.split(''));
-// manifest[i] = stringAsArray.join('').replace(/,/g, '');
-// break;
-// }
-// }
-
- manifest = manifest.join('\n').replace(/www[\\\/]img/g, 'images');
fs.writeFileSync(path.join(output, 'package.appxmanifest'), manifest);
// make sure the couch db server is whitelisted
@@ -139,7 +128,9 @@ module.exports = function(output, sha, entry_point, couchdb_host, test_timeout,
function parsePackageInfo() {
var d = q.defer();
var cmd = 'powershell Get-AppxPackage ' + packageName;
+ log(cmd);
shell.exec(cmd, {silent:true, async:true}, function(code, output) {
+ log(output);
if (code > 0) {
d.reject('getting package info failed with code ' + code);
} else {
@@ -163,7 +154,9 @@ module.exports = function(output, sha, entry_point, couchdb_host, test_timeout,
if (fullName) {
log('Application with the same name is already installed, removing...');
var cmd = 'powershell Remove-AppxPackage ' + fullName;
+ log(cmd);
shell.exec(cmd, {async:true, silent:true}, function(code, output) {
+ log(output);
if (code > 0) {
d.reject('package removing failed with code ' + code);
}
@@ -182,7 +175,9 @@ module.exports = function(output, sha, entry_point, couchdb_host, test_timeout,
function getAppId() {
var cmd = 'powershell (get-appxpackagemanifest (get-appxpackage ' + packageName +')).package.applications.application.id';
var d = q.defer();
+ log(cmd);
shell.exec(cmd, {silent:true, async:true}, function(code, output) {
+ log(output);
if (code > 0) {
d.reject('unable to get installed app id');
} else {
@@ -206,10 +201,11 @@ module.exports = function(output, sha, entry_point, couchdb_host, test_timeout,
var cmd = 'explorer ' + runner;
- console.log('Attempt to run the app via command: ' + cmd);
+ log(cmd);
shell.exec(cmd, {silent:true,async:true}, function(code, output) {
// TODO: even if the command succeeded, code is '1'. must be investigated
// temporary added check for not empty output
+ log(output);
if (code > 0 && output != "") {
d.reject('unable to run ' + appId);
} else {
@@ -222,7 +218,7 @@ module.exports = function(output, sha, entry_point, couchdb_host, test_timeout,
return prepareMobileSpec().then(parsePackageInfo).then(removeInstalledPackage).then(function() {
return deploy(output, sha);
- }).then(getAppId).then(runApp).then(function() {
+ }).then(parsePackageInfo).then(getAppId).then(runApp).then(function() {
return waitTestsCompleted(sha, 1000 * test_timeout);
});
}
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/8f2288c2/src/build/makers/windows8/deploy.js
----------------------------------------------------------------------
diff --git a/src/build/makers/windows8/deploy.js b/src/build/makers/windows8/deploy.js
index dc1a244..37bcd0c 100644
--- a/src/build/makers/windows8/deploy.js
+++ b/src/build/makers/windows8/deploy.js
@@ -13,9 +13,10 @@ module.exports = function deploy(path, sha) {
log('compiling the app...');
// 'restricted' is used to prevent powershell script (part of build.bat) which requires user interaction to run
var cmd = 'powershell Set-ExecutionPolicy restricted && cordova\\build.bat';
+ log(cmd);
shell.exec(cmd, {silent:true, async:true}, function(code, output) {
+ log(output);
if (code > 0) {
- log(output);
d.reject('build failed with code ' + code);
} else {
d.resolve();
@@ -39,9 +40,10 @@ module.exports = function deploy(path, sha) {
shell.exec('powershell Set-ExecutionPolicy unrestricted', {silent:false, async:false}, null);
var cmd = 'powershell "& \'' + shell.pwd() + '\\Add-AppDevPackage.ps1\' -Force"'; // full path is required
+ log(cmd);
shell.exec(cmd, {silent:false, async:true}, function(code, output) {
+ log(output);
if (code > 0) {
- log(output);
d.reject('deploy failed with code ' + code);
} else {
d.resolve();
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/8f2288c2/writejson.js
----------------------------------------------------------------------
diff --git a/writejson.js b/writejson.js
index 7eb5922..55b1eeb 100644
--- a/writejson.js
+++ b/writejson.js
@@ -30,6 +30,11 @@ fs.writeFileSync(path.join(MSPEC_DIR,'.cordova','config.json'),
"uri": "'+TEST_DIR_ESCAPED+'/cordova-wp8",\
"version": "'+BRANCH+'",\
"id": "cordova-wp8-'+BRANCH+'"\
+ },\
+ "windows8": {\
+ "uri": "'+TEST_DIR_ESCAPED+'/cordova-windows",\
+ "version": "'+BRANCH+'",\
+ "id": "cordova-windows-'+BRANCH+'"\
}\
}\
}');
[2/2] git commit: adds windows8 related info to home page
Posted by dr...@apache.org.
adds windows8 related info to home page
Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/f2fac4ad
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/f2fac4ad
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/f2fac4ad
Branch: refs/heads/master
Commit: f2fac4ad5efeb5a4186b4e85c8659e756d9e278e
Parents: 8f2288c
Author: sgrebnov <se...@gmail.com>
Authored: Tue Dec 17 23:24:42 2013 +0400
Committer: sgrebnov <se...@gmail.com>
Committed: Tue Dec 17 23:24:42 2013 +0400
----------------------------------------------------------------------
README.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/f2fac4ad/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 66710dc..a49e2fd 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@ Medic using BuildBot
- Android
- On Windows
- Windows Phone 8
+ - Windows 8
#Installation
##Select target OS
@@ -59,7 +60,7 @@ Install on a Mac or Windows depending on target test platform(s)
- On Windows
- buildslave start slave_windows
- `Important. On Windows slave instance must be run under administrator.`
+ **Note:** on Windows slave instance must be run under administrator; git/bin folder must be added to PATH so that rm, cp, mkdir commands are available from the command prompt.
- point your browser at http://localhost:8010/waterfall to see the buildbot state
- point your browser to the couchDB http://localhost:5984/_utils/index.html to look at detailed test results
c
@@ -106,6 +107,9 @@ every command has a link to its output o the main display. When a mobile spec te
- Windows Phone8 tests:
- platform, mobilespec and js from master branch, plugins from dev branch (cordova-js is built and copied in)
+- Windows8 tests:
+ - platform, mobilespec and js from master branch, plugins from dev branch (cordova-js is built and copied in). Tests are executed on Local Machine, no support to run tests on connected device.
+
The tests use COHO and CLI for as much as possible to ensure that the developer tool chain is working.
#Configuration Files