added compose file

This commit is contained in:
jpellizzari
2016-10-26 13:57:03 -07:00
parent f5e638cb59
commit 268fe0e70a
11 changed files with 50 additions and 46 deletions

3
client/.gitignore vendored
View File

@@ -1,4 +1,5 @@
node_modules
build/
coverage/
test/*png
*.png
test/perfjankie/data

View File

@@ -85,7 +85,11 @@
"lint": "eslint app",
"clean": "rm build/app.js",
"noprobe": "../scope stop && ../scope launch --no-probe --app.window 8760h",
"loadreport": "npm run noprobe && sleep 1 && curl -X POST -H \"Content-Type: application/json\" http://$BACKEND_HOST/api/report -d"
"loadreport": "npm run noprobe && sleep 1 && curl -X POST -H \"Content-Type: application/json\" http://$BACKEND_HOST/api/report -d",
"perf:setup" : "docker-compose -f test/perfjankie/docker-compose.yml up -d",
"perf:run" : ". test/run-jankie.sh",
"perf:cleanup" : "docker-compose -f test/perfjankie/docker-compose.yml down",
"perf" : "npm run perf:setup && npm run perf:run"
},
"jest": {
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",

View File

@@ -36,7 +36,6 @@ function deselectNode(browser) {
module.exports = function(cfg) {
var startUrl = 'http://' + cfg.host + '/';
// cfg - The configuration object. args, from the example above.
return function(browser) {
@@ -103,16 +102,12 @@ module.exports = function(cfg) {
debug('scenario done');
});
})
.catch(e => {
console.error(e);
})
.fail(function(err) {
debug('exception. taking screenshot', err);
browser.takeScreenshot(function(err, data) {
if (err) {
debug(err);
} else {
debugger;
var base64Data = data.replace(/^data:image\/png;base64,/,"");
fs.writeFile('90-nodes-select-' + cfg.run + '.png', base64Data, 'base64', function(err) {
if(err) debug(err);

View File

@@ -1,5 +0,0 @@
FROM couchdb:1.6
COPY local.ini /usr/local/etc/couchdb/
EXPOSE 5984

View File

@@ -1,22 +1,27 @@
version : '2'
services:
# nginx:
# container_name: 'nginx'
# image: 'nginx'
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# links:
# - couchdb
# ports:
# - '5984:5984'
probe:
container_name: 'scope-perf-probe'
image: weaveworks/scope
pid: "host"
privileged: true
labels:
- "works.weave.role=system"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:rw"
command:
- "--probe.docker"
- "true"
selenium:
container_name: 'selenium'
image: 'elgalu/selenium'
links:
- probe
ports:
- '4444:24444'
- '5900:25900'
environment:
- TZ="US/Pacific"
- TZ='US/Pacific'
shm_size: 1g
couchdb:
container_name: 'couchdb'

View File

@@ -1,24 +1,25 @@
var perfjankie = require('perfjankie');
var run = process.env.COMMIT || 'commit#590f0078e79e9fb968c8b9f8e5e5ce0a96fa4825'; // A hash for the commit, displayed in the x-axis in the dashboard
var run = process.env.COMMIT || 'commit#Hash'; // A hash for the commit, displayed in the x-axis in the dashboard
var time = process.env.DATE || new Date().getTime() // Used to sort the data when displaying graph. Can be the time when a commit was made
var scenario = process.env.ACTIONS || '90-nodes-select';
var host = process.env.HOST || 'localhost:4040';
var host = process.env.HOST || 'probe:4040';
var actions = require('../actions/' + scenario)({host: host, run: run});
debugger;
var log = (s) => { console.log(s); }
perfjankie({
/* The next set of values identify the test */
suite: 'Scope',
name: scenario, // A friendly name for the URL. This is shown as component name in the dashboard
time: time,
run: run,
repeat: 10, // Run the tests 10 times. Default is 1 time
repeat: 5, // Run the tests 10 times. Default is 1 time
/* Identifies where the data and the dashboard are saved */
couch: {
server: 'http://localhost:5984',
database: 'performance'
// updateSite: !process.env.CI, // If true, updates the couchApp that shows the dashboard. Set to false in when running Continuous integration, run this the first time using command line.
server: 'http://local.docker:5984',
database: 'performance',
updateSite: !process.env.CI, // If true, updates the couchApp that shows the dashboard. Set to false in when running Continuous integration, run this the first time using command line.
// onlyUpdateSite: false // No data to upload, just update the site. Recommended to do from dev box as couchDB instance may require special access to create views.
},
@@ -48,8 +49,24 @@ perfjankie({
actions: actions,
selenium: {
hostname: 'local.docker', // or localhost or hub.browserstack.com
hostname: 'localhost', // or localhost or hub.browserstack.com
port: 4444,
}
},
// log: { // Expects the following methods,
// fatal: log,
// error: grunt.fail.warn.bind(grunt.fail),
// warn: grunt.log.error.bind(grunt.log),
// info: grunt.log.ok.bind(grunt.log),
// debug: grunt.verbose.writeln.bind(grunt.verbose),
// trace: grunt.log.debug.bind(grunt.log)
// }
log: [
'fatal',
'error',
'warn',
'info',
'debug',
'trace'
].reduce(n => (r, i) => { r[i] = log }, {})
});

File diff suppressed because one or more lines are too long

View File

@@ -35,6 +35,5 @@ echo "Testing $COMMIT on $DATE"
# ../../scope stop
# make SUDO= -C ../..
# ../../scope launch
# sleep 5
COMMIT="$COMMIT" DATE=$DATE HOST=$HOST DEBUG=scope* node ./perfjankie/main.js
sleep 5
COMMIT="$COMMIT" DATE=$DATE HOST=$HOST DEBUG=scope* node test/perfjankie/main.js