From 6a5d41b0ecde95c1c91d2a5a60de401ea00d36bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 30 May 2018 10:47:31 +0200 Subject: [PATCH 1/7] ci: Run js-ipfs-api tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- ci/Jenkinsfile | 87 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 59ae86a8b2f..bb4ad711193 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -28,6 +28,15 @@ def build_platforms = [ ['freebsd', 'amd64'] ] +// js-ipfs-api tests +def js_api_commit = '7e78ee232bea8e5ea92bcfcff949b4ed671c2d50' // 22.0.1 +def js_api_platforms = ['linux', 'macos'] +def js_api_node_versions = ['8.11.1', '9.2.0'] + +def yarn_version = '1.5.1' +def yarn_path = './node_modules/.bin/yarn' + + /* PIPELINE UTILS */ def setupStep(nodeLabel, f) { @@ -69,6 +78,7 @@ def gobuild_step = { list -> run "go build -i -ldflags=\"-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=${env.SUBNAME}-${env.BUILD_NUMBER}\" -o cmd/ipfs/ipfs github.com/ipfs/go-ipfs/cmd/ipfs" run "cp cmd/ipfs/ipfs cmd/ipfs/dist; cd cmd/ipfs/dist; tar -czvf ../go-ipfs_${env.GOOS}-${env.GOARCH}-${env.SUBNAME}-${env.BUILD_NUMBER}.tar.gz ." archiveArtifacts artifacts: "cmd/ipfs/go-ipfs_${env.GOOS}-${env.GOARCH}-${env.SUBNAME}-${env.BUILD_NUMBER}.tar.gz", fingerprint: true + stash name: "ipfs-${env.GOOS}-${env.GOARCH}", includes: "cmd/ipfs/ipfs" } } } @@ -100,8 +110,23 @@ def sharness_step = { run, osname, makeargs, ignore -> /* PIPELINE */ +def reportedStage(name, fn) { + githubNotify description: "Running ${name}", status: 'PENDING', context: "continuous-integration/jenkins/${name}" + + try { + stage(name.capitalize()) { + fn() + } + githubNotify description: "${name.capitalize()} passed", status: 'SUCCESS', context: "continuous-integration/jenkins/${name}" + } catch (err) { + githubNotify description: '${name.capitalize()} failed', status: 'FAILURE', context: "continuous-integration/jenkins/${name}" + throw err + } + +} + ansiColor('xterm') { withEnv(['TERM=xterm-color']) { - stage('Checks') { + reportedStage('checks') { parallel( 'go fmt': { setupStep('linux') { run -> @@ -132,7 +157,8 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { ) } - stage('Tests') { + + reportedStage('tests') { parallel( 'go build (other platforms)': { gobuild_step(build_platforms) @@ -201,4 +227,61 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { //}, ) } + + reportedStage('apis') { + def jsApiStep = { os, nodeVer -> + return { -> + setupStep(os) { + switch (os) { + case "linux": + unstash("ipfs-linux-amd64") + break + case "macos": + unstash("ipfs-darwin-amd64") + break + } + + withEnv(['IPFS_GO_EXEC=../cmd/ipfs/ipfs', 'CI=true']) { + dir('.js-ipfs-api') { + checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: "${js_api_commit}"]], userRemoteConfigs: [[url: 'https://github.com/ipfs/js-ipfs-api']]] + + //todo: deduplicate with https://github.com/ipfs/jenkins-libs/blob/master/vars/javascript.groovy somehow + + fileExists 'package.json' + nodejs(nodeVer) { + sh 'rm -rf node_modules/' + sh 'npm install yarn@' + yarn_version + sh yarn_path + ' --mutex network --no-lockfile' + def runTest = { -> + try { + sh yarn_path + ' test' + } finally { + junit allowEmptyResults: true, testResults: 'junit-report-*.xml' + } + } + + if (os == "linux") { + wrap([$class: 'Xvfb', parallelBuild: true, autoDisplayName: true]) { + runTest() + } + } else { + runTest() + } + } + } + } + } + } + } + + def steps = [:] + js_api_platforms.each {os -> + js_api_node_versions.each { nodeVer -> + steps["js-api-${os}-${nodeVer}"] = jsApiStep(os, nodeVer) + } + } + + parallel steps + } + }} From e31f9919577dc1a5b285b5826d0b2a532fa91a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 31 May 2018 01:32:10 +0200 Subject: [PATCH 2/7] ci: Run interop tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- ci/Jenkinsfile | 113 ++++++++++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 48 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index bb4ad711193..12981c9da09 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -28,10 +28,12 @@ def build_platforms = [ ['freebsd', 'amd64'] ] -// js-ipfs-api tests -def js_api_commit = '7e78ee232bea8e5ea92bcfcff949b4ed671c2d50' // 22.0.1 +/* js-* tests */ +def js_api_commit = '80452eb62903bf405a9085cd14a233da8a5e31a4' // 22.3.0 +def interop_commit = '6593ccdca5d7b4c747787f71f7ac4b5f6f1ab10b' + def js_api_platforms = ['linux', 'macos'] -def js_api_node_versions = ['8.11.1', '9.2.0'] +def js_api_node_versions = ['8.11.3', '10.4.1'] def yarn_version = '1.5.1' def yarn_path = './node_modules/.bin/yarn' @@ -108,6 +110,55 @@ def sharness_step = { run, osname, makeargs, ignore -> } } +/* JS BASED TESTS */ + +def jsTestStep = { os, nodeVer, repo, commit -> + return { -> + setupStep(os) { + switch (os) { + case "linux": + unstash("ipfs-linux-amd64") + break + case "macos": + unstash("ipfs-darwin-amd64") + break + } + + withEnv(['IPFS_GO_EXEC=../cmd/ipfs/ipfs', 'CI=true']) { + dir('.js-test') { + checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: commit]], userRemoteConfigs: [[url: repo]]] + + //todo: deduplicate with https://github.com/ipfs/jenkins-libs/blob/master/vars/javascript.groovy somehow + + fileExists 'package.json' + nodejs(nodeVer) { + sh 'rm -rf node_modules/' + sh 'npm install yarn@' + yarn_version + sh yarn_path + ' --mutex network --no-lockfile' + def runTest = { -> + try { + sh yarn_path + ' test' + } catch(_) { + } finally { + junit allowEmptyResults: true, testResults: 'junit-report-*.xml' + cleanWs() + } + } + + if (os == "linux") { + wrap([$class: 'Xvfb', parallelBuild: true, autoDisplayName: true]) { + runTest() + } + } else { + runTest() + } + } + } + } + } + } +} + /* PIPELINE */ def reportedStage(name, fn) { @@ -119,7 +170,7 @@ def reportedStage(name, fn) { } githubNotify description: "${name.capitalize()} passed", status: 'SUCCESS', context: "continuous-integration/jenkins/${name}" } catch (err) { - githubNotify description: '${name.capitalize()} failed', status: 'FAILURE', context: "continuous-integration/jenkins/${name}" + githubNotify description: "${name.capitalize()} failed", status: 'FAILURE', context: "continuous-integration/jenkins/${name}" throw err } @@ -228,56 +279,22 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { ) } - reportedStage('apis') { - def jsApiStep = { os, nodeVer -> - return { -> - setupStep(os) { - switch (os) { - case "linux": - unstash("ipfs-linux-amd64") - break - case "macos": - unstash("ipfs-darwin-amd64") - break - } - - withEnv(['IPFS_GO_EXEC=../cmd/ipfs/ipfs', 'CI=true']) { - dir('.js-ipfs-api') { - checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: "${js_api_commit}"]], userRemoteConfigs: [[url: 'https://github.com/ipfs/js-ipfs-api']]] - - //todo: deduplicate with https://github.com/ipfs/jenkins-libs/blob/master/vars/javascript.groovy somehow - - fileExists 'package.json' - nodejs(nodeVer) { - sh 'rm -rf node_modules/' - sh 'npm install yarn@' + yarn_version - sh yarn_path + ' --mutex network --no-lockfile' - def runTest = { -> - try { - sh yarn_path + ' test' - } finally { - junit allowEmptyResults: true, testResults: 'junit-report-*.xml' - } - } - - if (os == "linux") { - wrap([$class: 'Xvfb', parallelBuild: true, autoDisplayName: true]) { - runTest() - } - } else { - runTest() - } - } - } - } - } + reportedStage('interop') { + def steps = [:] + js_api_platforms.each {os -> + js_api_node_versions.each { nodeVer -> + steps["interop-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/interop', interop_commit) } } + parallel steps + } + + reportedStage('apis') { def steps = [:] js_api_platforms.each {os -> js_api_node_versions.each { nodeVer -> - steps["js-api-${os}-${nodeVer}"] = jsApiStep(os, nodeVer) + steps["js-api-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/js-ipfs-api', js_api_commit) } } From e4b9d24ddc71720c22d658184efb6e0b4d516a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 7 Aug 2018 14:06:43 +0200 Subject: [PATCH 3/7] ci: Disable interop for now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- ci/Jenkinsfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 12981c9da09..056d8e109ce 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -279,16 +279,16 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { ) } - reportedStage('interop') { - def steps = [:] - js_api_platforms.each {os -> - js_api_node_versions.each { nodeVer -> - steps["interop-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/interop', interop_commit) - } - } - - parallel steps - } + //reportedStage('interop') { + // def steps = [:] + // js_api_platforms.each {os -> + // js_api_node_versions.each { nodeVer -> + // steps["interop-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/interop', interop_commit) + // } + // } + // + // parallel steps + //} reportedStage('apis') { def steps = [:] From 138b11aba5b065efbdee401aab459d539403a29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 9 Aug 2018 10:09:09 +0200 Subject: [PATCH 4/7] ci: call cleanWs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 056d8e109ce..595f7e6abb9 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -29,7 +29,7 @@ def build_platforms = [ ] /* js-* tests */ -def js_api_commit = '80452eb62903bf405a9085cd14a233da8a5e31a4' // 22.3.0 +def js_api_commit = 'e61155ae8edaee902cb3a1dcd8ba3d3afb093d1c' // 24.0.1 def interop_commit = '6593ccdca5d7b4c747787f71f7ac4b5f6f1ab10b' def js_api_platforms = ['linux', 'macos'] From c3a703d5f621ca295ffabe1ba5322bb9ab5416f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 29 Oct 2018 22:30:13 +0100 Subject: [PATCH 5/7] ci: update interop/js-api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- ci/Jenkinsfile | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 595f7e6abb9..f194910b9e9 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -29,8 +29,8 @@ def build_platforms = [ ] /* js-* tests */ -def js_api_commit = 'e61155ae8edaee902cb3a1dcd8ba3d3afb093d1c' // 24.0.1 -def interop_commit = '6593ccdca5d7b4c747787f71f7ac4b5f6f1ab10b' +def js_api_commit = '7543c06a1105f6de4fe7c549790d58ac4cf75326' // 25.0.0 - log pr +def interop_commit = 'e63c532e58af7b6d9924f4ebdbdc26cc317c15e5' def js_api_platforms = ['linux', 'macos'] def js_api_node_versions = ['8.11.3', '10.4.1'] @@ -128,8 +128,6 @@ def jsTestStep = { os, nodeVer, repo, commit -> dir('.js-test') { checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: commit]], userRemoteConfigs: [[url: repo]]] - //todo: deduplicate with https://github.com/ipfs/jenkins-libs/blob/master/vars/javascript.groovy somehow - fileExists 'package.json' nodejs(nodeVer) { sh 'rm -rf node_modules/' @@ -279,21 +277,11 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { ) } - //reportedStage('interop') { - // def steps = [:] - // js_api_platforms.each {os -> - // js_api_node_versions.each { nodeVer -> - // steps["interop-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/interop', interop_commit) - // } - // } - // - // parallel steps - //} - - reportedStage('apis') { + reportedStage('interop/apis') { def steps = [:] js_api_platforms.each {os -> js_api_node_versions.each { nodeVer -> + steps["interop-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/interop', interop_commit) steps["js-api-${os}-${nodeVer}"] = jsTestStep(os, nodeVer, 'https://github.com/ipfs/js-ipfs-api', js_api_commit) } } From 9ec1c77b99d45a21d304a8d2b3212ec769d4af30 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 8 Feb 2019 16:07:18 -0800 Subject: [PATCH 6/7] interop: update interop tests License: MIT Signed-off-by: Steven Allen --- ci/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index f194910b9e9..da676991077 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -29,8 +29,8 @@ def build_platforms = [ ] /* js-* tests */ -def js_api_commit = '7543c06a1105f6de4fe7c549790d58ac4cf75326' // 25.0.0 - log pr -def interop_commit = 'e63c532e58af7b6d9924f4ebdbdc26cc317c15e5' +def js_api_commit = 'v29.1.0' +def interop_commit = 'master' def js_api_platforms = ['linux', 'macos'] def js_api_node_versions = ['8.11.3', '10.4.1'] From 545fce771de6ec7c884202716353e8d41ebb1eea Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 8 Feb 2019 16:07:30 -0800 Subject: [PATCH 7/7] remove old node support License: MIT Signed-off-by: Steven Allen --- ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index da676991077..73d220798e8 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -33,7 +33,7 @@ def js_api_commit = 'v29.1.0' def interop_commit = 'master' def js_api_platforms = ['linux', 'macos'] -def js_api_node_versions = ['8.11.3', '10.4.1'] +def js_api_node_versions = ['10.4.1'] def yarn_version = '1.5.1' def yarn_path = './node_modules/.bin/yarn'