Skip to content

Commit

Permalink
Get system tests running again, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Stone committed Jan 6, 2017
1 parent 229d00e commit d9227ee
Show file tree
Hide file tree
Showing 25 changed files with 230 additions and 162 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ matrix:
include:
- env: SYSTEST=embedded
- env: SYSTEST=web
- env: SYSTEST=hlf SYSTEST_HLF=hlf
sudo: required
services:
- docker
- env: SYSTEST=hlf SYSTEST_HLF=ibm
sudo: required
services:
- docker
dist: trusty
before_install: |
set -ev
Expand All @@ -26,6 +34,9 @@ deploy:
skip_cleanup: true
on:
all_branches: true
cache:
directories:
- $HOME/.npm
notifications:
slack:
secure: NX1j3tH5CQ4hsmMzpu6iJ48TWr+IgxJpUwVqOy1NOcm+W8v9G/DfB8B+NZdkmb38Lijh/7eMqbII7wwGtMdrJKV4/WDT5r7crSgI6ITLMcu7azAaULqhaBT+9yaptee/02SDo8sOLWuG1+t2YaWTaP4lGp5VcB836CKZfyk3SRFbKJQZPioN+ivkuiiAA2JMQMeOzV5fpVFEBSBG4qwqUxyTWIL6fWtEjvtmEOwfcCEhmJv7Q2jnO0L3OGHAkXh6XauwYLElhwU/xxNT27N/gca9hB4DlMZjsag74YjkG2U0lZ71eFXq/TLfhLyUcyDs2LMLmaTU0cGILz9sP4HXZWGSxXfAZz259t41yX8sngdpUraU4j0v0grHuq83pA+OAP+X+FYhzoWJ5NFOv5URj17h+U7p5k3Np1TqeTtoQwVFbXnwcuVGlzdGoN9BzqHDiw5SW/n7dXPMp8LAXj8HHy+L5j26OtVq7UL6XjHxMUuHS31bp5QdBqmS/u+PkWI1IsfcQKhK3ip5iYc7OSEuzeswQRySpS2Qw4OHaSzAfTfbF877w7WHjYN3uu3MejfJLqI/pSyRZTDzafc2tydfJMPuh7BXP7DtJlXKfLQdD9uCdzFIrpyZ/xgeuvN949cIZE8Ip0Dy/69/pgZslH5OpHSrRFnz4jOZQTh47ibqJaU=
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# Concerto
Concerto is the Blockchain Solution Framework: a library of assets/functions for quickly creating blockchain-based applications.

You must install [Lerna](https://lernajs.io) to build this multi-package repository.

$ npm install -g lerna

Once Lerna is installed, and this repository is cloned, then you must bootstrap the
repository so that all of the dependencies are installed and all of the packages are
linked together:

$ lerna bootstrap

You can then work with the packages under [packages/@ibm](packages/@ibm) on a per-package
basis as any normal node.js package.

Alternatively, you can execute npm commands across all of the packages at once using
Lerna:

$ lerna run test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"devDependencies": {
"lerna": "2.0.0-beta.32",
"moment": "^2.17.1"
"moment": "^2.17.1",
"sleep-promise": "^2.0.0"
},
"name": "@ibm/concerto",
"description": "You must install [Lerna](https://lernajs.io) to build this multi-package repository.",
Expand Down
1 change: 1 addition & 0 deletions packages/concerto-admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ module.exports.AdminConnection = require('./lib/adminconnection');
* @ignore
*/
module.exports.BusinessNetworkDefinition = require('@ibm/concerto-common').BusinessNetworkDefinition;
module.exports.Logger = require('@ibm/concerto-common').Logger;
6 changes: 6 additions & 0 deletions packages/concerto-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@
*/

module.exports.BusinessNetworkConnection = require('./lib/businessnetworkconnection');

/**
* Expose key concerto-common classes to simplify client application dependencies
* @ignore
*/
module.exports.Logger = require('@ibm/concerto-common').Logger;
4 changes: 4 additions & 0 deletions packages/concerto-common/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ class Identifiable {
+ string getFullyQualifiedType()
+ string getNamespace()
+ String toString()
+ boolean isRelationship()
+ boolean isResource()
}
class Relationship extends Identifiable {
+ String toString()
+ boolean isRelationship()
}
class Resource extends Identifiable {
+ void setPropertyValue(string,string)
+ void addArrayValue(string,string)
+ String toString()
+ boolean isResource()
}
class ValidatedResource extends Resource {
+ void setPropertyValue(string,string) throws Error
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-common/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#

Version 0.3.0 {527e1a68596d676f560cfdcd1aa1fca6} 2017-01-05
Version 0.3.0 {5e00fefd2800fa40026062a9c0a0b695} 2017-01-05
- Move to monorepo

Version 0.2.0 {527e1a68596d676f560cfdcd1aa1fca6} 2016-12-15
Expand Down
19 changes: 19 additions & 0 deletions packages/concerto-common/lib/model/identifiable.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,25 @@ class Identifiable {
static isSystemProperty(name) {
return IDENTIFIABLE_SYSTEM_PROPERTIES.indexOf(name) >= 0;
}

/**
* Determine if this identifiable is a relationship.
* @return {boolean} True if this identifiable is a relationship,
* false if not.
*/
isRelationship() {
return false;
}

/**
* Determine if this identifiable is a resource.
* @return {boolean} True if this identifiable is a resource,
* false if not.
*/
isResource() {
return false;
}

}

module.exports = Identifiable;
10 changes: 10 additions & 0 deletions packages/concerto-common/lib/model/relationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ class Relationship extends Identifiable {
toString() {
return 'Relationship {id=' + this.getFullyQualifiedIdentifier() +'}';
}

/**
* Determine if this identifiable is a relationship.
* @return {boolean} True if this identifiable is a relationship,
* false if not.
*/
isRelationship() {
return true;
}

}

module.exports = Relationship;
10 changes: 10 additions & 0 deletions packages/concerto-common/lib/model/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ class Resource extends Identifiable {
toString() {
return 'Resource {id=' + this.getFullyQualifiedIdentifier() +'}';
}

/**
* Determine if this identifiable is a resource.
* @return {boolean} True if this identifiable is a resource,
* false if not.
*/
isResource() {
return true;
}

}

module.exports = Resource;
14 changes: 14 additions & 0 deletions packages/concerto-common/test/model/identifiable.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,18 @@ describe ('Identifiable', function () {
}).should.throw(/Use Serializer.toJSON to convert resource instances to JSON objects./);
});
});

describe('#isRelationship', () => {
it('should be false', () => {
const id = new Identifiable(modelManager, 'org.acme', 'Type', '123' );
id.isRelationship().should.be.false;
});
});

describe('#isResource', () => {
it('should be false', () => {
const id = new Identifiable(modelManager, 'org.acme', 'Type', '123' );
id.isResource().should.be.false;
});
});
});
14 changes: 14 additions & 0 deletions packages/concerto-common/test/model/relationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,18 @@ describe('Relationship', function () {
}).should.throw(/Use Serializer.toJSON to convert resource instances to JSON objects./);
});
});

describe('#isRelationship', () => {
it('should be true', () => {
const relationship = new Relationship(modelManager, 'org.acme.l1', 'Person', '123' );
relationship.isRelationship().should.be.true;
});
});

describe('#isResource', () => {
it('should be false', () => {
const relationship = new Relationship(modelManager, 'org.acme.l1', 'Person', '123' );
relationship.isResource().should.be.false;
});
});
});
14 changes: 14 additions & 0 deletions packages/concerto-common/test/model/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,18 @@ describe('Resource', function () {
}).should.throw(/Use Serializer.toJSON to convert resource instances to JSON objects./);
});
});

describe('#isRelationship', () => {
it('should be false', () => {
const resource = new Resource(modelManager, 'org.acme.l1', 'Person', '123' );
resource.isRelationship().should.be.false;
});
});

describe('#isResource', () => {
it('should be true', () => {
const resource = new Resource(modelManager, 'org.acme.l1', 'Person', '123' );
resource.isResource().should.be.true;
});
});
});
2 changes: 1 addition & 1 deletion packages/concerto-connector-hlf/lib/hfcutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class HFCUtil {
return new Promise((resolve, reject) => {
let sourceDirectoryPath = path.resolve(runtimeModulePath);
let targetDirectoryPath = path.resolve(tempDirectoryPath, 'src', chaincodePath);
fs.copy(sourceDirectoryPath, targetDirectoryPath, { filter: (path) => { return !/(Concerto-Runtime-Hyperledger-Fabric|ibm-concerto-runtime-hlf).*node_modules/.test(path); }}, (err) => {
fs.copy(sourceDirectoryPath, targetDirectoryPath, { filter: (path) => { return !/(Concerto-Runtime-Hyperledger-Fabric|concerto-runtime-hlf).*node_modules/.test(path); }}, (err) => {
if (err) {
LOG.error('deployChainCode', 'copy', err);
return reject(err);
Expand Down
31 changes: 0 additions & 31 deletions packages/concerto-systests/.travis.yml

This file was deleted.

20 changes: 0 additions & 20 deletions packages/concerto-systests/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions packages/concerto-systests/hlf-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,3 @@ services:
command: sh -c 'sleep 5; peer node start'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
concerto:
build:
args:
- NPM_TOKEN
context: "."
links:
- vp0
- membersrvc
8 changes: 0 additions & 8 deletions packages/concerto-systests/ibm-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,3 @@ services:
command: sh -c 'sleep 5; peer node start'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
concerto:
build:
args:
- NPM_TOKEN
context: "."
links:
- vp0
- membersrvc
2 changes: 2 additions & 0 deletions packages/concerto-systests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
"chai-as-promised": "^6.0.0",
"chai-subset": "^1.3.0",
"eslint": "^3.10.2",
"homedir": "^0.6.0",
"karma": "^1.3.0",
"karma-browserify": "^5.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-mocha": "^1.3.0",
"karma-spec-reporter": "0.0.26",
"license-check": "^1.1.5",
"mkdirp": "^0.5.1",
"mocha": "^3.1.2",
"watchify": "^3.7.0"
},
Expand Down
Loading

0 comments on commit d9227ee

Please sign in to comment.