[Asterisk-code-review] CI: Move test group config files to Jenkins (...asterisk[master])

George Joseph asteriskteam at digium.com
Mon Apr 15 08:06:37 CDT 2019


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11280 )

Change subject: CI: Move test group config files to Jenkins
......................................................................

CI: Move test group config files to Jenkins

One of the downaides of having things like test configuration
in the git repo is that it can't be changed at runtime.  You have
to create a review for the changes and merge it mefore it will
take effect.

This review moves the data currently held in
tests/CI/periodic-dailyTestGroups.json and
tests/CI/gateTestGroups.json into a Jenkins Config File attached
to the job definitions.  This allows us to alter it from the
Jenkins UI at runtime.  The original files stay in the repo
as documentation.

Change-Id: I14b9702f6285ce1fb2420287ba0e7d3b59109763
---
M tests/CI/gateTestGroups.json
M tests/CI/gates.jenkinsfile
M tests/CI/periodic-dailyTestGroups.json
M tests/CI/periodics-daily.jenkinsfile
4 files changed, 29 insertions(+), 2 deletions(-)

Approvals:
  Friendly Automation: Looks good to me, approved
  George Joseph: Approved for Submit



diff --git a/tests/CI/gateTestGroups.json b/tests/CI/gateTestGroups.json
index d048896..415a7d7 100644
--- a/tests/CI/gateTestGroups.json
+++ b/tests/CI/gateTestGroups.json
@@ -1,3 +1,10 @@
+/*
+ * This file is for reference/documentation only.
+ * The live configuration is defined in the Config Files
+ * settings of the Asterisk Gates Jenkins job.
+ * This allows is to alter the parameters at runtime.
+ */
+
 [
 	{
 		"name": "ari1",
diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index bc23781..a90b0cf 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -159,7 +159,16 @@
 						}
 					}
 
-					def testGroups = readJSON file: "tests/CI/gateTestGroups.json"
+					def testGroups
+					configFileProvider([configFile(fileId: 'asterisk_gate_test_groups', variable: 'GATE_TEST_GROUPS')]) {
+					echo "Retrieved config file from ${env.GATE_TEST_GROUPS}"
+						testGroups = readJSON file: env.GATE_TEST_GROUPS
+					}
+					echo "Running test groups:"
+					for (def testGroup in testGroups) {
+						echo "${testGroup.name} ${testGroup.dir} ${testGroup.testcmd}"
+					}
+
 					def parallelTasks = [ : ]
 
 					for (def testGroup in testGroups) {
diff --git a/tests/CI/periodic-dailyTestGroups.json b/tests/CI/periodic-dailyTestGroups.json
index 7f0fd7e..cc837f6 100644
--- a/tests/CI/periodic-dailyTestGroups.json
+++ b/tests/CI/periodic-dailyTestGroups.json
@@ -1,3 +1,9 @@
+/*
+ * This file is for reference/documentation only.
+ * The live configuration is defined in the Config Files
+ * settings of the Asterisk Gates Jenkins job.
+ * This allows is to alter the parameters at runtime.
+ */
 [
 	{
 		"name": "ari ",
diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile
index ae762f8..ae5a5f4 100644
--- a/tests/CI/periodics-daily.jenkinsfile
+++ b/tests/CI/periodics-daily.jenkinsfile
@@ -91,7 +91,12 @@
 						}
 					}
 
-					def testGroups = readJSON file: "tests/CI/periodic-dailyTestGroups.json"
+					def testGroups
+					configFileProvider([configFile(fileId: 'asterisk_daily_test_groups', variable: 'DAILY_TEST_GROUPS')]) {
+					echo "Retrieved config file from ${env.DAILY_TEST_GROUPS}"
+						testGroups = readJSON file: env.DAILY_TEST_GROUPS
+					}
+
 					def parallelTasks = [ : ]
 
 					for (def testGroup in testGroups) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11280
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I14b9702f6285ce1fb2420287ba0e7d3b59109763
Gerrit-Change-Number: 11280
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190415/6ece93d5/attachment.html>


More information about the asterisk-code-review mailing list