From 095b267902eacef7bb54e2ef7d673bbf199f2c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 18 Apr 2018 22:31:02 +0200 Subject: [PATCH] ci: use custom schema for benchmark plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- ci/Jenkinsfile | 16 +--- test/bench/bench-plugin-schema.json | 89 +++++++++++++++++++++++ test/dependencies/gobench-to-json/main.go | 13 +--- 3 files changed, 91 insertions(+), 27 deletions(-) create mode 100644 test/bench/bench-plugin-schema.json diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index f1cbb382ed8..5b29858a8a7 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -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='\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 - }*/ } ) } diff --git a/test/bench/bench-plugin-schema.json b/test/bench/bench-plugin-schema.json new file mode 100644 index 00000000000..2223553a39d --- /dev/null +++ b/test/bench/bench-plugin-schema.json @@ -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" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/test/dependencies/gobench-to-json/main.go b/test/dependencies/gobench-to-json/main.go index e3b759fd5ce..6f42423df08 100644 --- a/test/dependencies/gobench-to-json/main.go +++ b/test/dependencies/gobench-to-json/main.go @@ -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 }