From 4e8f7e725d56c2aec5a02e18eb24a4289763177b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 8 Jun 2020 11:24:54 +0200 Subject: [PATCH] ci: auto-detect storage provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the PR follows our contribution guideline https://rook.io/docs/rook/master/development-flow.html#commit-structure and then the PR title contains for example "ceph: add a feature", then the CI will run the ceph storage integration tests. Closes: https://github.com/rook/rook/issues/5612 Signed-off-by: Sébastien Han --- INSTALL.md | 2 ++ Jenkinsfile | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index ae677a387..524a3cb93 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -186,6 +186,8 @@ These options should **not** be used if there are any changes to code which is s storage providers. If there is any risk of affecting another storage provider, all tests should be executed in the CI. +> Note that if the pull request title follows Rook's [contribution guidelines](https://rook.io/docs/rook/master/development-flow.html#commit-structure), the CI will automatically run the appropriate test scenario. For example if a pull request title is "ceph: add a feature", then the tests for the Ceph storage provider will run. + ### [test full] In master and release builds, all test suites will run on all supported versions of K8s. diff --git a/Jenkinsfile b/Jenkinsfile index bfcb3e6bc..13f6233ec 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -51,18 +51,21 @@ pipeline { def changed_files = list.filename echo ("changed files are: ${changed_files}") + // Get PR title + def title = evaluateJson(json,'${json.title}') + // extract which specific storage provider to test - if (body.contains("[test cassandra]")) { + if (body.contains("[test cassandra]") || title.contains("cassandra:")) { env.testProvider = "cassandra" - } else if (body.contains("[test ceph]")) { + } else if (body.contains("[test ceph]") || title.contains("ceph:")) { env.testProvider = "ceph" - } else if (body.contains("[test cockroachdb]")) { + } else if (body.contains("[test cockroachdb]") || title.contains("cockroachdb:")) { env.testProvider = "cockroachdb" - } else if (body.contains("[test edgefs]")) { + } else if (body.contains("[test edgefs]") || title.contains("edgefs:")) { env.testProvider = "edgefs" - } else if (body.contains("[test nfs]")) { + } else if (body.contains("[test nfs]") || title.contains("nfs:")) { env.testProvider = "nfs" - } else if (body.contains("[test yugabytedb]")) { + } else if (body.contains("[test yugabytedb]") || title.contains("yugabytedb:")) { env.testProvider = "yugabytedb" } else if (body.contains("[test]")) { env.shouldBuild = "true"