Validation Error in running Hyperledger Caliper V0.4.2 with Fabric 2.1 - hyperledger-fabric

When I have been running the Caliper V0.4.2 for measuring the benchmarks of Fabric 2.1.0 1.4.7, I got the below error
ValidationError: child "version" fails because ["version" must be one of [1.0]]. child "clients" fails because ["clients" is required]. child "channels" fails because ["channels" must be an object]. child "organizations" fails because ["organizations" must be an object]. child "orderers" fails because ["orderers" is required]. child "peers" fails because ["peers" is required]
at Object.exports.process (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/errors.js:202:19)
at internals.Object._validateWithOptions (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/types/any/index.js:763:31)
at module.exports.internals.Any.root.validate (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hapi/joi/lib/index.js:145:23)
at Function._validateTopLevel (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/configValidator.js:208:26)
at Function.validateNetwork (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/configValidator.js:58:25)
at new FabricConnector (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/fabric-connector.js:107:25)
at CaliperEngine.connectorFactory [as adapterFactory] (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-fabric/lib/connectorFactory.js:26:23)
at CaliperEngine.run (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-core/lib/manager/caliper-engine.js:93:36)
at Function.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:43)
at Object.module.exports.handler (/home/gow/fabric-benchmarks/caliper-benchmarks/node_modules/#hyperledger/caliper-cli/lib/launch/launchManagerCommand.js:46:44)
isJoi: true,
name: 'ValidationError',
details:
[ { message: '"version" must be one of [1.0]',
path: [Array],
type: 'any.allowOnly',
context: [Object] },
{ message: '"clients" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"channels" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"organizations" must be an object',
path: [Array],
type: 'object.base',
context: [Object] },
{ message: '"orderers" is required',
path: [Array],
type: 'any.required',
context: [Object] },
{ message: '"peers" is required',
path: [Array],
type: 'any.required',
context: [Object] } ],
_object:
{ name: 'Caliper Benchmarks',
version: '2.1.0',
caliper: { blockchain: 'fabric' },
channels: [ [Object] ],
organizations: [ [Object] ] },
annotate: [Function] }
Command that I run are,
npm init -y
npm install --only=prod #hyperledger/caliper-cli#0.4.0
npx caliper bind --caliper-bind-sut fabric:2.1
./network.sh deployCC -ccn simple -ccp ../../caliper-benchmarks/src/fabric/scenario/simple/node -ccl javascript
npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/fabric/test-network.yaml --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled
Hyperledger network creation, channel creation and Chaincode deployment all were successful.
How to solve this error?

Looks like you are using the main branch of caliper-benchmarks. I would suggest you https://github.com/hyperledger/caliper-benchmarks/blob/main/networks/fabric/README.md
From what you have posted, you should use the latest available version of caliper which is 0.4.2, not 0.4.0. To do so the command you should issue is
npm install --only=prod #hyperledger/caliper-cli
You should bind to the latest 2.2 sdk (don't bind to 2.1 as fabric doesn't support 2.1). Note this is selecting the version of the sdk used to interact with a fabric network, not the version of the fabric network you are using. 2.2 will work with a fabric 2.2 and later 2.x versions
npx caliper bind --caliper-bind-sut fabric:2.2
Finally it looks like you tried to change the version number in the network configuration file. Don't change the version (it must be 2.0.0) as it refers to the version of the network configuration file and not the version of fabric you want to test
As you look to be using test-network, depending on which branch of fabric-samples you are using defines the version of fabric. The main branch tests the latest version of fabric which should have no problems.

Related

Error while I run a p. benchmark with Hyperledger Caliper: No valid responses from any peers, chaincode registration failed: container exited with 0

I want to run a performance benchmark for the contract (which is writen in typescript) from this repository:https://github.com/AleRapchan/hyperledger-supply-chain
So, I am using Hyperledger Caliper based on this tutorial: https://hyperledger.github.io/caliper/v0.5.0/fabric-tutorial/tutorials-fabric-existing/
to run the performance benchmark and I followed these steps:
Steps followed:
I have clonned this repo as I mentioned before: https://github.com/AleRapchan/hyperledger-supply-chain and, at the same level, I created the caliper-workspace folder as the tutorial said.
I created the channel "mychannel" and deployed the chaincode respectively.
./network.sh up createChannel -ca -s couchdb
./network.sh deployCC -ccn supplychain -ccp ../../chaincode -ccl typescript
I have configured the three caliper files as shown below (myAssetBenchmark.yaml, networkConfig.yaml, readAsset.js) into the caliper-workspace folder.
I have installed the caliper dependencies in the caliper-workspace folder.
npm install --only=prod #hyperledger/caliper-cli#0.5.0
npx caliper bind --caliper-bind-sut fabric:2.2
At the same directory, I run the performance benchmark with the following command:
npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/networkConfig.yaml --caliper-benchconfig benchmarks/myAssetBenchmark.yaml --caliper-flow-only-test
but I got the following errors:
Error 1
error: [Transaction]: Error: No valid responses from any peers. Errors:
peer=peer0.org2.example.com:9051, status=500, message=error in simulation: failed to execute transaction b6cc9ab28537a5539aa0876a823a679a952dee1232540e8efbe1ad01e02ebfbb: could not launch chaincode supplychain_1.0:a38d65123f915a15106ad4d0f8893b0880ed2979ddcc84106b9267f5ee31ddd4: chaincode registration failed: container exited with 0
peer=peer0.org1.example.com:7051, status=500, message=error in simulation: failed to execute transaction b6cc9ab28537a5539aa0876a823a679a952dee1232540e8efbe1ad01e02ebfbb: could not launch chaincode supplychain_1.0:a38d65123f915a15106ad4d0f8893b0880ed2979ddcc84106b9267f5ee31ddd4: chaincode registration failed: container exited with 0
Error 2
error [caliper] [connectors/v2/FabricGateway] Failed to perform submit transaction [createProduct] using arguments [1_0,1234567890,50,Fruit Juices,,2022-06-24T18:25:43.511Z,{},Apple Juice,Etobicoke, ON, Canada,2021-06-24T18:25:43.511Z,$9.00,200,ml], with error: Error: No valid responses from any peers. Errors:
peer=peer0.org2.example.com:9051, status=500, message=error in simulation: failed to execute transaction 5837e5ab8b41016290a3d204f4ffde53bad977e917eb1ae53784623959d4e359: could not launch chaincode supplychain_1.0:a38d65123f915a15106ad4d0f8893b0880ed2979ddcc84106b9267f5ee31ddd4: chaincode registration failed: container exited with 0
peer=peer0.org1.example.com:7051, status=500, message=error in simulation: failed to execute transaction 5837e5ab8b41016290a3d204f4ffde53bad977e917eb1ae53784623959d4e359: could not launch chaincode supplychain_1.0:a38d65123f915a15106ad4d0f8893b0880ed2979ddcc84106b9267f5ee31ddd4: chaincode registration failed: container exited with 0
myAssetBenchmark.yaml
test:
name: basic-contract-benchmark
description: test benchmark
workers:
number: 2
rounds:
- label: readAsset
description: Read asset benchmark
txDuration: 30
rateControl:
type: fixed-load
opts:
transactionLoad: 2
workload:
module: workload/readAsset.js
arguments:
assets: 10
contractId: supplychain
networkConfig.yaml
name: Caliper test
version: "2.0.0"
caliper:
blockchain: fabric
channels:
- channelName: mychannel
contracts:
- id: supplychain
organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'User1'
clientPrivateKey:
path: '../hyperledger-supply-chain/network/fabric-network/organizations/peerOrganizations/org1.example.com/users/User1#org1.example.com/msp/keystore/46d82eb2dbaed33f941f9a39394bba7b5167d09d116ba563de1675f22b083d3e_sk'
clientSignedCert:
path: '../hyperledger-supply-chain/network/fabric-network/organizations/peerOrganizations/org1.example.com/users/User1#org1.example.com/msp/signcerts/cert.pem'
connectionProfile:
path: '../hyperledger-supply-chain/network/fabric-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml'
discover: true
readAsset.js
'use strict';
const { WorkloadModuleBase } = require('#hyperledger/caliper-core');
class MyWorkload extends WorkloadModuleBase {
constructor() {
super();
}
async initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext) {
await super.initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext);
for (let i=0; i<this.roundArguments.assets; i++) {
const id = `${this.workerIndex}_${i}`;
console.log(`Worker ${this.workerIndex}: Creating asset ${id}`);
const request = {
contractId: this.roundArguments.contractId,
contractFunction: 'createProduct',
invokerIdentity: 'User1',
contractArguments: [id, '1234567890', 50, 'Fruit Juices', [],
'2022-06-24T18:25:43.511Z', JSON.stringify({}),'Apple Juice', 'Etobicoke, ON, Canada',
'2021-06-24T18:25:43.511Z','$9.00', 200, 'ml'],
readOnly: false
};
await this.sutAdapter.sendRequests(request);
}
}
async submitTransaction() {
const randomId = Math.floor(Math.random()*this.roundArguments.assets);
const myArgs = {
contractId: this.roundArguments.contractId,
contractFunction: 'readProduct',
invokerIdentity: 'User1',
contractArguments: [`${this.workerIndex}_${randomId}`],
readOnly: true
};
await this.sutAdapter.sendRequests(myArgs);
}
async cleanupWorkloadModule() {
for (let i=0; i<this.roundArguments.assets; i++) {
const assetID = `${this.workerIndex}_${i}`;
console.log(`Worker ${this.workerIndex}: Deleting asset ${assetID}`);
const request = {
contractId: this.roundArguments.contractId,
contractFunction: null,
invokerIdentity: 'User1',
contractArguments: [id],
readOnly: false
};
await this.sutAdapter.sendRequests(request);
}
}
}
function createWorkloadModule() {
return new MyWorkload();
}
module.exports.createWorkloadModule = createWorkloadModule;
PD: I am using WSL2 based engine (Docker Desktop and WSL2).

Prtractor Error with Gitlab CI/CD Pipeline

We have a secured network and Protractor test suite runs locally. But when running the Gitlab CI/CD pipeline with headless chrome it returns network errors
This is my conf.js
exports.config = {
framework : "jasmine2",
multiCapabilities : [
{
browserName: "chrome",
chromeOptions: {
args: [
"--incognito",
"--headless",
"--no-sandbox",
"--disable-gpu",
"--window-size=1920,1080",
"--disable-dev-shm-usage",
"--allow-insecure-localhost"
],
},
},
],
specs: [
'./tests/sample.ts',
],
seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar',
seleniumAddress: 'http://localhost:4444/wd/hub',
chromeDriver: './node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_98.0.4758.102',
directConnect: true,
onPrepare: function(){
void browser.manage().timeouts().implicitlyWait(10000);
void browser.waitForAngularEnabled(false);
require("ts-node").register({
project: require("path").join(__dirname, "./tsconfig.json"),
})
},
plugins: [{
package: 'protractor-screenshoter-plugin',
screenshotPath: './outputJS/reports/e2e',
screenshotOnExpect: 'failure+success',
takeScreenshots:'true',
withLogs: 'true',
writeReportFreq: 'asap',
imageToAscii: 'none',
clearFoldersBeforeTest: true
}]
}
Error appears
$ npm run e2e-headless-run
> e2e#1.0.0 e2e-headless-run /var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e
> node node_modules/protractor/bin/protractor ./headless_conf.js
[09:46:36] W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress, seleniumServerJar
[09:46:37] I/launcher - Running 1 instances of WebDriver
[09:46:37] I/direct - Using ChromeDriver directly...
Activated Protractor Screenshoter Plugin, ver. 0.10.3 (c) 2016 - 2022 [object Object] and contributors
Started
Creating reporter at ./outputJS/reports/e2e/
FF
Failures:
1) Google Sample Test loading web page
Message:
Expected '**Network Error**' to contain 'PCO'.
Stack:
Error: Failed expectation
at helper.verifyPageTitle (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/helper/helper.ts:151:36)
at loginPage.verify_page_title (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/pages/loginpage.ts:55:23)
I tried adding webDriverProxy and proxy. But same result appears.

When I use electron-builder to package an NSIS program, I get: Fatal error: Unable to parse version string for FileVersion

Electron-Builder Version: 22.14.5
Node Version: v16.13.1
Electron Version: 16.0.6
Electron Type (current, beta, nightly): current
Not using electron-updater
Target: nsis
Here is the console log.
Compilation succeeded.
• electron-builder version=22.14.5 os=5.10.89-1-MANJARO
• loaded configuration file=/home/aszswaz/document/notebook/code-example/webpack-electron-vue/config/electron-builder-win.js
• Specified application directory equals to project dir — superfluous or wrong configuration appDirectory=./
• writing effective config file=dist/electron-builder/builder-effective-config.yaml
• skipped dependencies rebuild reason=npmRebuild is set to false
• packaging platform=win32 arch=x64 electron=v16.0.6 appOutDir=dist/electron-builder/win-unpacked
• asar usage is disabled — this is strongly not recommended solution=enable asar and use asarUnpack to unpack files that must be externally available
• asar usage is disabled — this is strongly not recommended solution=enable asar and use asarUnpack to unpack files that must be externally available
⨯ cannot execute cause=exit status 1
errorOut=Fatal error: Unable to parse version string for FileVersion
0024:fixme:ver:GetCurrentPackageId (0032FE94 00000000): stub
command=wine /home/aszswaz/.cache/electron-builder/winCodeSign/winCodeSign-2.6.0/rcedit-ia32.exe /home/aszswaz/document/notebook/code-example/webpack-electron-vue/dist/electron-builder/win-unpacked/hanna.exe --set-version-string FileDescription hanna --set-version-string ProductName hanna --set-version-string LegalCopyright aszswaz --set-file-version v1.0.0 --set-product-version 1.0.0.0 --set-version-string InternalName hanna --set-version-string OriginalFilename '' --set-version-string CompanyName aszswaz --set-icon /home/aszswaz/document/notebook/code-example/webpack-electron-vue/public/icon.ico
workingDir=
This is the config file used.
module.exports = {
appId: "cn.aszswaz.demo.webpack-electron-vue",
productName: "hanna",
copyright: "aszswaz",
asar: false,
files: [
"dist/app/*",
"!**/node_modules/vue/*",
"!**/node_modules/vue-router/*"
],
artifactName: "${productName}-${arch}-${version}.${ext}",
directories: {
app: "./",
output: "./dist/electron-builder"
},
win: {
target: "nsis",
icon: "public/icon.ico"
},
nsis: {
oneClick: false,
perMachine: true,
allowToChangeInstallationDirectory: true
},
npmRebuild: false,
buildVersion: "v1.0.0",
electronCompile: false,
electronDownload: {
version: "16.0.6",
platform: "win32",
arch: "x64",
cache: process.cwd() + "/cache"
},
electronVersion: "v16.0.6"
}
What is the reason for this error? How can I fix this error?

Why does web-component-tester time out in flight mode?

I've got a basic web-component-tester project which works fine when I'm online.
If I switch to flight mode, it seems to fail to connect to Selenium, and instead gives a largely useless error message after about 60s delay: "Error: Unable to connect to selenium".
Edit 2: I've narrowed the problem down in the following question, but I'd still like to know how to avoid it with web-component-tester:
Why does NodeJS request() fail on localhost in flight mode, but not 127.0.0.1? (Windows 10)
Edit: After some digging, it's something to do with DNS resolver somewhere beneath selenium-standalone failing while in flight mode, and not a lot to do with web-component-tester.
After inserting some debug logging into selenium-standalone, I tracked down the failure point to the check for whether Selenium is running. When online, this works fine, but when offline I get:
// check-started.js, logging the error inside the request() call:
Error: getaddrinfo ENOENT localhost:60435
at Object.exports._errnoException (util.js:1022:11)
at errnoException (dns.js:33:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
The following seem to describe similar situations, but I don't see how to persuade selenium-standalone nor web-component-tester to specify an IP address family to even try the suggested solutions:
https://github.com/nodejs/node/issues/4825
https://github.com/nodejs/node/issues/10290
node.js http.request and ipv6 vs ipv4
My original text is below.
The full error log and wct.conf.json are below. I can supply package.json and bower.json too if it would help.
I'm on Windows 10.
wct.conf.json:
{
"verbose": true,
"plugins": {
"local": {
"skipSeleniumInstall": true,
"browsers": ["chrome"]
},
"sauce": {
"disabled": true
}
}
}
error log:
> color-curve#0.0.1 test C:\Users\Dave\projects\infinity-components\color-curve
> standard "**/*.html" && wct -l chrome
step: loadPlugins
step: configure
hook: configure
Expanded local browsers: [ 'chrome' ] into capabilities: [ { browserName: 'chrome',
version: '60',
chromeOptions:
{ binary: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
args: [Object] } } ]
configuration: { suites: [ 'test/index.html' ],
verbose: true,
quiet: false,
expanded: false,
testTimeout: 90000,
persistent: false,
extraScripts: [],
clientOptions: { root: '/components/', verbose: true },
compile: 'auto',
activeBrowsers: [ { browserName: 'chrome', version: '60', chromeOptions: [Object] } ],
browserOptions: {},
plugins:
{ local:
{ disabled: false,
skipSeleniumInstall: true,
browsers: [Object],
seleniumArgs: [] },
sauce: { disabled: true } },
registerHooks: [Function: registerHooks],
enforceJsonConf: false,
webserver:
{ hostname: 'localhost',
_generatedIndexContent: '<!doctype html>\n<html>\n <head>\n <meta charset="utf-8">\n <script>WCT = {"root":"/components/","verbose":true};</script>\n <script>window.__generatedByWct = true;</script>\n <script src="../web-component-tester/browser.js"></script>\n\n <script src="../web-component-tester/data/a11ySuite.js"></script>\n</head>\n <body>\n <script>\n WCT.loadSuites(["test/index.html"]);\n </script>\n </body>\n</html>\n' },
root: 'C:\\Users\\Dave\\projects\\infinity-components\\color-curve',
_: [],
origSuites: [ 'test/' ] }
hook: prepare
hook: prepare:selenium
Starting Selenium server for local browsers
INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
INFO - Launching a standalone Selenium Server
INFO::main: Logging initialized #222ms
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
INFO:osjs.Server:main: jetty-9.2.15.v20160210
INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#100fc185{/,null,AVAILABLE}
INFO:osjs.ServerConnector:main: Started ServerConnector#2922e2bb{HTTP/1.1}{0.0.0.0:51126}
INFO:osjs.Server:main: Started #419ms
INFO - Selenium Server is up and running
INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
INFO - Launching a standalone Selenium Server
INFO::main: Logging initialized #222ms
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
INFO - Driver class not found: com.opera.core.systems.OperaDriver
INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
INFO:osjs.Server:main: jetty-9.2.15.v20160210
INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#100fc185{/,null,AVAILABLE}
INFO:osjs.ServerConnector:main: Started ServerConnector#2922e2bb{HTTP/1.1}{0.0.0.0:51126}
INFO:osjs.Server:main: Started #419ms
INFO - Selenium Server is up and running
Error: Unable to connect to selenium

Mocha tests passing on localhost but not when running on TravisCI

I've written a test suite like so:
this.slow(1000)
this.timeout(6000)
var response, client
before(function(done) {
client = new UsergridClient()
client.GET(_collection, function(err, r) {
response = r
done()
})
})
it('should not fail when a callback function is not passed', function() {
// note: this test will NOT fail gracefully inside the Mocha event chain
client.GET(_collection)
})
it('should return a 200 ok', function() {
// ******** LOGGING ********* //
console.log(response)
// ******** LOGGING ********* //
response.statusCode.should.equal(200)
})
it('response.entities should be an array', function() {
response.entities.should.be.an.Array
})
it('response.first should exist and have a valid uuid', function() {
response.first.should.be.an.Object.with.property('uuid').with.a.lengthOf(36)
})
it('response.entity should exist and have a valid uuid', function() {
response.entity.should.be.an.Object.with.property('uuid').with.a.lengthOf(36)
})
it('response.last should exist and have a valid uuid', function() {
response.last.should.be.an.Object.with.property('uuid').with.a.lengthOf(36)
})
When running this test locally, all tests pass. When running on TravisCI though, the response variables are being reported as undefined even inside the tests. This suggests to me that there's some sort of asynchronous mixup, but using the done() callback on the before() should mitigate that, shouldn't it? I even tried adding done callbacks to every subsequent test, but that still isn't working.
The notable error here is:
TypeError: Cannot read property 'property' of undefined
and it looks like that's being thrown from:
response.first.should.be.an.Object.with.property('uuid').with.a.lengthOf(36)
which makes me think Travis' environment doesn't like Object.with or maybe even just .with?
Here's my .travis.yml file:
language: node_js
node_js:
- '5.1.0'
install:
- 'npm install'
- 'npm -g install mocha'
script:
- 'mocha tests'
And here's the run log:
Using worker: worker-linux-docker-7421b08d.prod.travis-ci.org:travis-linux-8
system_info
Build system information
Build language: node_js
Build group: stable
Build dist: precise
Build image provisioning date and time
Thu Feb 5 15:09:33 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
Linux Version
3.13.0-29-generic
Cookbooks Version
a68419e https://github.com/travis-ci/travis-cookbooks/tree/a68419e
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.1
Redis version
redis-server 2.8.19
riak version
2.0.2
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
RabbitMQ Version
3.4.3
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"
git.checkout
0.36s$ git clone... cloning
remote: Counting objects: 315, done.
remote: Compressing objects: 100% (153/153), done.
remote: Total 315 (delta 74), reused 0 (delta 0), pack-reused 161
Receiving objects: 100% (315/315), 48.32 KiB | 0 bytes/s, done.
Resolving deltas: 100% (156/156), done.
Checking connectivity... done.
$ cd path/to/proj
$ git checkout -qf <hash>
This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables.
If you require sudo, add 'sudo: required' to your .travis.yml
See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
3.13s$ nvm install 5.1.0
######################################################################## 100.0%
Checksums empty
Now using node v5.1.0
$ node --version
v5.1.0
$ npm --version
3.3.12
$ nvm --version
0.23.3
install.1
17.95s$ npm install
npm WARN engine underscore.inflection#1.3.0: wanted: {"node":">=0.10.0 <0.12"} (current: {"node":"5.1.0","npm":"3.3.12"})
npm WARN deprecated lodash#0.9.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^3.0.0.
npm WARN deprecated lodash#2.4.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^3.0.0.
app#2.0.0 /home/travis/build/path/to/app
... list of packages
npm WARN EPACKAGEJSON app#2.0.0 No repository field.
install.2
1.71s$ npm -g install mocha
/home/travis/.nvm/versions/node/v5.1.0/bin/mocha -> /home/travis/.nvm/versions/node/v5.1.0/lib/node_modules/mocha/bin/mocha
/home/travis/.nvm/versions/node/v5.1.0/bin/_mocha -> /home/travis/.nvm/versions/node/v5.1.0/lib/node_modules/mocha/bin/_mocha
/home/travis/.nvm/versions/node/v5.1.0/lib
... list of packages
1.50s$ mocha tests
init() / initSharedInstance()
✓ should be an instance of Client
Client
initialization
✓ should fail to initialize without an orgId and appId
✓ should initialize using properties defined in config.json
✓ should initialize when passing orgId and appId as arguments, taking precedence over config
✓ should initialize when passing an object containing orgId and appId, taking precedence over config
GET()
IncomingMessage {
_readableState:
... omitted
readable: false,
domain: null,
headers:
... omitted
client:
... omitted
req:
... omitted
request:
... omitted
toJSON: [Function: responseToJSON],
caseless:
Caseless {
dict:
{ 'access-control-allow-origin': '*',
'content-type': 'application/json',
date: 'Sun, 29 Nov 2015 22:44:54 GMT',
server: 'Apache-Coyote/1.1',
'set-cookie': [Object],
'transfer-encoding': 'chunked',
connection: 'Close' } },
read: [Function],
body:
{ action: 'get',
application: '19748000-24b6-11e3-9877-6d1a3f81ba2f',
params: {},
path: '/tests',
uri: 'https://api.mydomain.com/myorg/sandbox/tests',
entities:
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object] ],
timestamp: 1448837094623,
duration: 65,
organization: 'myorg',
applicationName: 'sandbox',
cursor: 'LTU2ODc0MzQzOkdCcGJDbVpTRWVXVndibnE5RUdORGc',
count: 7 },
entities:
[ ],
first:
{ uuid: 'b3037a1a-4cd6-11e5-8aa2-0b8eb3ce43ee',
type: 'test',
name: '01',
created: 1440692071473,
modified: 1440692071473,
food: 'pizza',
metadata: { path: '/tests/b3037a1a-4cd6-11e5-8aa2-0b8eb3ce43ee' },
value: 1 },
entity:
{ uuid: 'b3037a1a-4cd6-11e5-8aa2-0b8eb3ce43ee',
type: 'test',
name: '01',
created: 1440692071473,
modified: 1440692071473,
food: 'pizza',
metadata: { path: '/tests/b3037a1a-4cd6-11e5-8aa2-0b8eb3ce43ee' },
value: 1 },
last:
{ uuid: '181a5b0a-6652-11e5-95c1-b9eaf4418d0e',
type: 'test',
created: 1443493848240,
modified: 1443493848240,
metadata: { path: '/tests/181a5b0a-6652-11e5-95c1-b9eaf4418d0e' },
title: 'Charlotte\'s Web' } }
✓ should not fail when a callback function is not passed
✓ should return a 200 ok
✓ response.entities should be an array
1) response.first should exist and have a valid uuid
2) response.entity should exist and have a valid uuid
3) response.last should exist and have a valid uuid
POST()
✓ should not fail when a callback function is not passed
✓ should return a 200 ok
4) response.entities should be an array
5) response.entity should exist and have a valid uuid
✓ response.entity.author should equal "Sir Arthur Conan Doyle"
PUT()
✓ should not fail when a callback function is not passed
✓ should return a 200 ok
6) response.entities should be an array
7) response.entity should exist and its uuid should the uuid from the previous POST requets
✓ response.entity.narrator should equal "Peter Doyle"
DELETE()
✓ should not fail when a callback function is not passed
✓ should return a 200 ok
✓ response.error.name should equal "service_resource_not_found"
authenticateApp()
✓ should return a 200 ok
✓ should have a valid token
✓ client.appAuth.token should be set to the token returned from
✓ client.appAuth.expiry should be set to a future date
appAuth / setAppAuth()
✓ should initialize by passing a list of arguments
✓ should initialize by passing an object
✓ should initialize by passing an instance of AppAuth
✓ should initialize by setting to an instance of AppAuth
Query
_type
✓ query._type should equal "cats" when passing "type" as a parameter to Query
✓ query._type should equal "cats" when calling .type() builder method
✓ query._type should equal "cats" when calling .collection() builder method
_limit
✓ query._limit should equal 10
_ql
✓ should support complex builder syntax (chained constructor methods)
✓ not operator should precede conditional statement
✓ string values should be contained in single quotes
✓ boolean values should not be contained in single quotes
✓ float values should not be contained in single quotes
✓ integer values should not be contained in single quotes
✓ uuid values should not be contained in single quotes
36 passing (696ms)
7 failing
1) Client GET() response.first should exist and have a valid uuid:
TypeError: Cannot read property 'property' of undefined
at Context.<anonymous> (tests/lib/client.test.js:69:48)
2) Client GET() response.entity should exist and have a valid uuid:
TypeError: Cannot read property 'property' of undefined
at Context.<anonymous> (tests/lib/client.test.js:73:49)
3) Client GET() response.last should exist and have a valid uuid:
TypeError: Cannot read property 'property' of undefined
at Context.<anonymous> (tests/lib/client.test.js:77:47)
4) Client POST() response.entities should be an array:
TypeError: Cannot read property 'a' of undefined
at Context.<anonymous> (tests/lib/client.test.js:108:50)
5) Client POST() response.entity should exist and have a valid uuid:
TypeError: Cannot read property 'property' of undefined
at Context.<anonymous> (tests/lib/client.test.js:112:49)
6) Client PUT() response.entities should be an array:
TypeError: Cannot read property 'a' of undefined
at Context.<anonymous> (tests/lib/client.test.js:146:50)
7) Client PUT() response.entity should exist and its uuid should the uuid from the previous POST requets:
TypeError: Cannot read property 'property' of undefined
at Context.<anonymous> (tests/lib/client.test.js:150:49)
The command "mocha tests" exited with 7.
Done. Your build exited with 1.
Somehow, I'm not entirely sure how, this syntax was working fine using whatever version of should.js I had installed locally. When deploying to TravisCI, it must have installed a newer version which caused any type-checking assertion to fail.
Where this previously worked (according to this):
response.first.should.be.an.Object.with.property('uuid').with.a.lengthOf(36)
It actually needed to be called with parentheses:
response.first.should.be.an.Object().with.property('uuid').with.a.lengthOf(36)
// ^^
... as indicated in the official docs.

Resources