Skip to content

Commit

Permalink
ci: use custom schema for benchmark plugin
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
  • Loading branch information
magik6k committed Apr 19, 2018
1 parent be62eca commit 095b267
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 27 deletions.
16 changes: 1 addition & 15 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,10 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { timeout(time: 30, unit: 'MI
},
'benchmark': {
setupStep('linux') { run ->
// Figure out our IP + Multiaddr for master to ensure connection
// def nodeIP = run returnStdout: true, script: 'dig +short myip.opendns.com @resolver1.opendns.com'
// benchNodeAddr = run returnStdout: true, script: "ipfs id --format='<addrs>\n' | grep $nodeIP"

run 'make test/bench/bench-results.json'

// benchJsonHash = run(returnStdout: true, script: "ipfs add -Q test/bench/bench-results.json").trim()

benchmark altInputSchema: '', altInputSchemaLocation: '', inputLocation: 'test/bench/bench-results.json', schemaSelection: 'defaultSchema', truncateStrings: false
benchmark altInputSchema: '', altInputSchemaLocation: 'test/bench/bench-plugin-schema.json', inputLocation: 'test/bench/bench-results.json', schemaSelection: 'customSchema', truncateStrings: false
}
/*node(label: 'master') {
withEnv(["IPFS_PATH=/efs/.ipfs"]) {
sh "ipfs swarm connect $benchNodeAddr"
sh "ipfs get -o bench-results.json $benchJsonHash"
}
benchmark altInputSchema: '', altInputSchemaLocation: '', inputLocation: 'bench-results.json', schemaSelection: 'defaultSchema', truncateStrings: false
}*/
}
)
}
Expand Down
89 changes: 89 additions & 0 deletions test/bench/bench-plugin-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"description": "jenkins benchmark plugin schema for go-ipfs",
"type": "array",
"properties": {
"items": {
"type": "object",
"properties": {
"name": {
"type": "name"
},
"description": {
"type": "description"
},
"parameters": {
"type": "array",
"items": {
"type": "parameter",
"properties": {
"name": {
"type": "name"
},
"description": {
"type": "description"
},
"unit": {
"type": "unit"
},
"value": {
"type": "value"
}
}
}
},
"results": {
"type": "array",
"items": {
"type": "result",
"properties": {
"name": {
"type": "name"
},
"description": {
"type": "description"
},
"unit": {
"type": "unit"
},
"boolValue": {
"type": "boolean"
},
"intValue": {
"type": "integer"
},
"dblValue": {
"type": "double"
},
"value": {
"type": "value"
},
"thresholds": {
"type": "array",
"items": {
"type": "threshold",
"properties": {
"method": {
"type": "method"
},
"minimum": {
"type": "minimum"
},
"maximum": {
"type": "maximum"
},
"delta": {
"type": "delta"
},
"percentage": {
"type": "percentage"
}
}
}
}
}
}
}
}
}
}
}
13 changes: 1 addition & 12 deletions test/dependencies/gobench-to-json/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,7 @@ func mainErr() error {
}
}

out := Out{
Groups: []Group{
{
Name: "Go benchmarks",
Description: "Go benchmarks",

Tests: tests,
},
},
}

b, err := json.Marshal(&out)
b, err := json.Marshal(&tests)
if err != nil {
return err
}
Expand Down

0 comments on commit 095b267

Please sign in to comment.