Skip to content

Commit

Permalink
Make it possible to build parity version of ppc
Browse files Browse the repository at this point in the history
- Tied to npm build and npm test steps
- Pulling into CI flow
- Added tests for parity checking
- Testing blacklist updated
- Placeholder client plugin created
- Contributes to #66
  • Loading branch information
exsilium committed Jul 16, 2019
1 parent ada3598 commit 4a7f183
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
},
"scripts": {
"start": "./bin/pylon.sh",
"test": "./test/run-tests.sh",
"build": "cd ppc && mkdir -p build && node ppc-package.js projects/default.ppp && cat ./build/ppc_release.js | sed 's/\\(\\/\\*FILEHEAD(\\).*//g' > ../plugins-client/lib.apf/www/apf-packaged/apf_release.js & cd ..",
"test": "npm run-script build && ./test/run-tests.sh",
"build": "mkdir -p ./plugins-client/lib.ppc/www/ppc && cd ppc && mkdir -p build && node ppc-package.js projects/default.ppp && cat ./build/ppc_release.js | sed 's/\\(\\/\\*FILEHEAD(\\).*//g' > ../plugins-client/lib.ppc/www/ppc/ppc.js && cd ..",
"postinstall": "if [ -d 'node_modules/ace' ]; then cd node_modules/ace; else mkdir -p node_modules; ln -s ../../ace node_modules/ace; ln -s ../../treehugger node_modules/treehugger; cd ../ace; fi; make clean pre_build; ./Makefile.dryice.js minimal; cd ../..; make worker; if [ -L 'node_modules/ace' ]; then rm node_modules/ace; rm node_modules/treehugger; rmdir node_modules; fi"
}
}
14 changes: 14 additions & 0 deletions plugins-client/lib.ppc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "pylon.client.ppc",
"version": "0.0.1",
"main": "ppc-lib.js",
"private": true,

"dependencies": {
},

"plugin": {
"provides": ["client.ppc"],
"consumes": ["static"]
}
}
14 changes: 14 additions & 0 deletions plugins-client/lib.ppc/ppc-lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = function setup(options, imports, register) {
var base = __dirname + "/www";
imports.static.addStatics([{
path: base,
mount: "/",
rjs: {
ppc: "/ppc"
}
}]);

register(null, {
"client.ppc": {}
});
};
4 changes: 1 addition & 3 deletions ppc/ppc-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
XPath = require('xpath');
DOMParser = require('xmldom').DOMParser;

require("apf");

var Fs = require("fs");

boot();

function boot() {
require("apf/apf-node");
require("./platform/apf-node");

require("./lib/proc");
require("./lib/files");
Expand Down
38 changes: 38 additions & 0 deletions ppc/ppc-package_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Pylon Platform Code
*
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

/*global after, afterEach, before, beforeEach, describe, it, setup, suite, teardown, test*/

"use strict";
"use mocha";

var Assert = require("assert");
var fs = require('fs');

var basePath = __dirname;

describe("ppc-package", function() {
it("APF should exist", function(next) {
Assert.equal(true, fs.existsSync(__dirname + "/../plugins-client/lib.apf/www/apf-packaged/apf_release.js", function(result) {
return result;
}));
next();
});

it("PPC should exist", function(next) {
Assert.equal(true, fs.existsSync(__dirname + "/../plugins-client/lib.ppc/www/ppc/ppc.js", function(result) {
return result;
}));
next();
});

it("PPC should be the same as APF", function(next) {
var apf = fs.readFileSync(__dirname + "/../plugins-client/lib.apf/www/apf-packaged/apf_release.js");
var ppc = fs.readFileSync(__dirname + "/../plugins-client/lib.ppc/www/ppc/ppc.js");
Assert.equal(true, ppc.equals(apf));
next();
});
});
6 changes: 2 additions & 4 deletions test/blacklist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
./plugins-server/c9.api.ftp/ftp_test.js
./plugins-server/c9.graceful-shutdown/graceful-shutdown_test.js
./plugins-client/ext.console/logger_test.js
./plugins-server/c9.backup.duplicity/duplicity_test.js
./plugins-client/ext.watcher/three_way_merge_test.js
./test/integration/project_archive/archive_and_restore_test.js
./ppc/platform/test/lm_test.js
./ppc/platform/core/lib/util/xml_test.js
2 changes: 1 addition & 1 deletion test/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mocha -V || :

cd `dirname $0`/..

npm install amd-loader
npm install amd-loader --no-save
which mocha 2>/dev/null || npm install -g mocha

# continue on error
Expand Down

0 comments on commit 4a7f183

Please sign in to comment.