[BUGFIX] Remove composer max update from regular randomizer
[Packages/TYPO3.CMS.git] / Build / bamboo / src / main / java / core / NightlySpec.java
1 package core;
2
3 /*
4 * This file is part of the TYPO3 CMS project.
5 *
6 * It is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License, either version 2
8 * of the License, or any later version.
9 *
10 * For the full copyright and license information, please read the
11 * LICENSE.txt file that was distributed with this source code.
12 *
13 * The TYPO3 project - inspiring people to share!
14 */
15
16 import java.util.ArrayList;
17
18 import com.atlassian.bamboo.specs.api.BambooSpec;
19 import com.atlassian.bamboo.specs.api.builders.BambooKey;
20 import com.atlassian.bamboo.specs.api.builders.Variable;
21 import com.atlassian.bamboo.specs.api.builders.plan.Job;
22 import com.atlassian.bamboo.specs.api.builders.plan.Plan;
23 import com.atlassian.bamboo.specs.api.builders.plan.Stage;
24 import com.atlassian.bamboo.specs.api.builders.plan.branches.BranchCleanup;
25 import com.atlassian.bamboo.specs.api.builders.plan.branches.PlanBranchManagement;
26 import com.atlassian.bamboo.specs.api.builders.project.Project;
27 import com.atlassian.bamboo.specs.builders.task.ScriptTask;
28 import com.atlassian.bamboo.specs.builders.trigger.ScheduledTrigger;
29 import com.atlassian.bamboo.specs.model.task.ScriptTaskProperties;
30 import com.atlassian.bamboo.specs.util.BambooServer;
31
32 /**
33 * Core master nightly test plan.
34 */
35 @BambooSpec
36 public class NightlySpec extends AbstractCoreSpec {
37
38 protected static String planName = "Core master nightly";
39 protected static String planKey = "GTN";
40
41 protected int numberOfAcceptanceTestJobs = 8;
42 protected int numberOfFunctionalMysqlJobs = 6;
43 protected int numberOfFunctionalMssqlJobs = 16;
44 protected int numberOfFunctionalPgsqlJobs = 6;
45 protected int numberOfFunctionalSqliteJobs = 6;
46 protected int numberOfUnitRandomOrderJobs = 2;
47
48 /**
49 * Run main to publish plan on Bamboo
50 */
51 public static void main(final String[] args) throws Exception {
52 // By default credentials are read from the '.credentials' file.
53 BambooServer bambooServer = new BambooServer(bambooServerName);
54 bambooServer.publish(new NightlySpec().createPlan());
55 bambooServer.publish(new NightlySpec().getDefaultPlanPermissions(projectKey, planKey));
56 }
57
58 /**
59 * Core master pre-merge plan is in "TYPO3 core" project of bamboo
60 */
61 Project project() {
62 return new Project().name(projectName).key(projectKey);
63 }
64
65 /**
66 * Returns full Plan definition
67 */
68 Plan createPlan() {
69 // PREPARATION stage
70 ArrayList<Job> jobsPreparationStage = new ArrayList<Job>();
71 jobsPreparationStage.add(this.getJobBuildLabels());
72 Stage stagePreparation = new Stage("Preparation")
73 .jobs(jobsPreparationStage.toArray(new Job[jobsPreparationStage.size()]));
74
75
76 // MAIN stage
77 ArrayList<Job> jobsMainStage = new ArrayList<Job>();
78
79 jobsMainStage.add(this.getJobComposerValidate("PHP72"));
80
81 jobsMainStage.add(this.getJobAcceptanceTestInstallMysql(0, "PHP72", this.getTaskComposerInstall("PHP72")));
82 jobsMainStage.add(this.getJobAcceptanceTestInstallMysql(0, "PHP73", this.getTaskComposerInstall("PHP73")));
83 jobsMainStage.add(this.getJobAcceptanceTestInstallPgsql(0, "PHP72", this.getTaskComposerInstall("PHP72")));
84 jobsMainStage.add(this.getJobAcceptanceTestInstallPgsql(0, "PHP73", this.getTaskComposerInstall("PHP73")));
85 jobsMainStage.add(this.getJobAcceptanceTestInstallSqlite(0, "PHP72", this.getTaskComposerInstall("PHP72")));
86 jobsMainStage.add(this.getJobAcceptanceTestInstallSqlite(0, "PHP73", this.getTaskComposerInstall("PHP73")));
87
88 jobsMainStage.addAll(this.getJobsAcceptanceTestsBackendMysql(0, this.numberOfAcceptanceTestJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
89 jobsMainStage.addAll(this.getJobsAcceptanceTestsBackendMysql(0, this.numberOfAcceptanceTestJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
90
91 jobsMainStage.add(this.getJobCglCheckFullCore(0, "PHP72", this.getTaskComposerInstall("PHP72")));
92
93 jobsMainStage.add(this.getJobIntegrationAnnotations(0, "PHP72", this.getTaskComposerInstall("PHP72")));
94
95 jobsMainStage.add(this.getJobIntegrationVarious(0, "PHP72", this.getTaskComposerInstall("PHP72")));
96
97 jobsMainStage.addAll(this.getJobsFunctionalTestsMysql(0, this.numberOfFunctionalMysqlJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
98 jobsMainStage.addAll(this.getJobsFunctionalTestsMysql(0, this.numberOfFunctionalMysqlJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
99 jobsMainStage.addAll(this.getJobsFunctionalTestsMssql(0, this.numberOfFunctionalMssqlJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
100 // no mssql with php 7.3 yet
101 // jobsMainStage.addAll(this.getJobsFunctionalTestsMssql(0, this.numberOfFunctionalMssqlJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
102 jobsMainStage.addAll(this.getJobsFunctionalTestsPgsql(0, this.numberOfFunctionalPgsqlJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
103 jobsMainStage.addAll(this.getJobsFunctionalTestsPgsql(0, this.numberOfFunctionalPgsqlJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
104 jobsMainStage.addAll(this.getJobsFunctionalTestsSqlite(0, this.numberOfFunctionalSqliteJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
105 jobsMainStage.addAll(this.getJobsFunctionalTestsSqlite(0, this.numberOfFunctionalSqliteJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
106
107 jobsMainStage.add(this.getJobUnitJavaScript(0, "PHP72", this.getTaskComposerInstall("PHP72")));
108
109 jobsMainStage.add(this.getJobLintPhp("PHP72"));
110 jobsMainStage.add(this.getJobLintPhp("PHP73"));
111
112 jobsMainStage.add(this.getJobLintScssTs("PHP72"));
113
114 jobsMainStage.add(this.getJobUnitPhp(0, "PHP72", this.getTaskComposerInstall("PHP72")));
115 jobsMainStage.add(this.getJobUnitPhp(0, "PHP73", this.getTaskComposerInstall("PHP73")));
116 jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP72", this.getTaskComposerInstall("PHP72")));
117 jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP73", this.getTaskComposerInstall("PHP73")));
118 jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
119 jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
120
121 Stage stageMainStage = new Stage("Main stage")
122 .jobs(jobsMainStage.toArray(new Job[jobsMainStage.size()]));
123
124
125 // COMPOSER UPDATE MAX stage
126 ArrayList<Job> jobsComposerMaxStage = new ArrayList<Job>();
127
128 jobsComposerMaxStage.add(this.getJobAcceptanceTestInstallMysql(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
129 jobsComposerMaxStage.add(this.getJobAcceptanceTestInstallMysql(1, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
130 jobsComposerMaxStage.add(this.getJobAcceptanceTestInstallPgsql(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
131 jobsComposerMaxStage.add(this.getJobAcceptanceTestInstallPgsql(1, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
132 jobsComposerMaxStage.add(this.getJobAcceptanceTestInstallSqlite(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
133 jobsComposerMaxStage.add(this.getJobAcceptanceTestInstallSqlite(1, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
134
135 jobsComposerMaxStage.addAll(this.getJobsAcceptanceTestsBackendMysql(1, this.numberOfAcceptanceTestJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
136 jobsComposerMaxStage.addAll(this.getJobsAcceptanceTestsBackendMysql(1, this.numberOfAcceptanceTestJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
137
138 jobsComposerMaxStage.add(this.getJobCglCheckFullCore(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
139
140 jobsComposerMaxStage.add(this.getJobIntegrationAnnotations(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
141
142 jobsComposerMaxStage.add(this.getJobIntegrationVarious(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
143
144 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsMysql(1, this.numberOfFunctionalMysqlJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
145 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsMysql(1, this.numberOfFunctionalMysqlJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
146 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsMssql(1, this.numberOfFunctionalMssqlJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
147 // no mssql with php 7.3 yet
148 // jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsMssql(1, this.numberOfFunctionalMssqlJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
149 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsPgsql(1, this.numberOfFunctionalPgsqlJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
150 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsPgsql(1, this.numberOfFunctionalPgsqlJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
151 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsSqlite(1, this.numberOfFunctionalSqliteJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
152 jobsComposerMaxStage.addAll(this.getJobsFunctionalTestsSqlite(1, this.numberOfFunctionalSqliteJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
153
154 jobsComposerMaxStage.add(this.getJobUnitJavaScript(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
155
156 jobsComposerMaxStage.add(this.getJobUnitPhp(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
157 jobsComposerMaxStage.add(this.getJobUnitPhp(1, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
158 jobsComposerMaxStage.add(this.getJobUnitDeprecatedPhp(1, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
159 jobsComposerMaxStage.add(this.getJobUnitDeprecatedPhp(1, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
160
161 // Disabled for now since young phpunit with built-in randomizer collides with this one. Needs investigation.
162 //jobsComposerMaxStage.addAll(this.getJobUnitPhpRandom(1, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerUpdateMax("PHP72")));
163 //jobsComposerMaxStage.addAll(this.getJobUnitPhpRandom(1, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerUpdateMax("PHP73")));
164
165 Stage stageComposerMaxStage = new Stage("Composer update max")
166 .jobs(jobsComposerMaxStage.toArray(new Job[jobsComposerMaxStage.size()]));
167
168 // COMPOSER UPDATE MIN stage
169 ArrayList<Job> jobsComposerMinStage = new ArrayList<Job>();
170
171 jobsComposerMinStage.add(this.getJobAcceptanceTestInstallMysql(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
172 jobsComposerMinStage.add(this.getJobAcceptanceTestInstallMysql(2, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
173 jobsComposerMinStage.add(this.getJobAcceptanceTestInstallPgsql(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
174 jobsComposerMinStage.add(this.getJobAcceptanceTestInstallPgsql(2, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
175 jobsComposerMinStage.add(this.getJobAcceptanceTestInstallSqlite(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
176 jobsComposerMinStage.add(this.getJobAcceptanceTestInstallSqlite(2, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
177
178 jobsComposerMinStage.addAll(this.getJobsAcceptanceTestsBackendMysql(2, this.numberOfAcceptanceTestJobs, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
179 jobsComposerMinStage.addAll(this.getJobsAcceptanceTestsBackendMysql(2, this.numberOfAcceptanceTestJobs, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
180
181 jobsComposerMinStage.add(this.getJobCglCheckFullCore(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
182
183 jobsComposerMinStage.add(this.getJobIntegrationAnnotations(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
184
185 jobsComposerMinStage.add(this.getJobIntegrationVarious(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
186
187 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsMysql(2, this.numberOfFunctionalMysqlJobs, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
188 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsMysql(2, this.numberOfFunctionalMysqlJobs, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
189 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsMssql(2, this.numberOfFunctionalMssqlJobs, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
190 // no mssql with php 7.3 yet
191 // jobsComposerMinStage.addAll(this.getJobsFunctionalTestsMssql(2, this.numberOfFunctionalMssqlJobs, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
192 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsPgsql(2, this.numberOfFunctionalPgsqlJobs, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
193 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsPgsql(2, this.numberOfFunctionalPgsqlJobs, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
194 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsSqlite(2, this.numberOfFunctionalSqliteJobs, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
195 jobsComposerMinStage.addAll(this.getJobsFunctionalTestsSqlite(2, this.numberOfFunctionalSqliteJobs, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
196
197 jobsComposerMinStage.add(this.getJobUnitJavaScript(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
198
199 jobsComposerMinStage.add(this.getJobUnitPhp(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
200 jobsComposerMinStage.add(this.getJobUnitPhp(2, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
201 jobsComposerMinStage.add(this.getJobUnitDeprecatedPhp(2, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
202 jobsComposerMinStage.add(this.getJobUnitDeprecatedPhp(2, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
203 jobsComposerMinStage.addAll(this.getJobUnitPhpRandom(2, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerUpdateMin("PHP72")));
204 jobsComposerMinStage.addAll(this.getJobUnitPhpRandom(2, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerUpdateMin("PHP73")));
205
206 Stage stageComposerMinStage = new Stage("Composer update min")
207 .jobs(jobsComposerMinStage.toArray(new Job[jobsComposerMinStage.size()]));
208
209 // Compile plan
210 return new Plan(project(), planName, planKey)
211 .description("Execute TYPO3 core master nightly tests. Auto generated! See Build/bamboo of core git repository.")
212 .pluginConfigurations(this.getDefaultPlanPluginConfiguration())
213 .stages(
214 stagePreparation,
215 stageMainStage,
216 stageComposerMaxStage,
217 stageComposerMinStage
218 )
219 .linkedRepositories("github TYPO3 TYPO3.CMS")
220 .triggers(
221 new ScheduledTrigger()
222 .name("Scheduled")
223 .description("daily at night")
224 // daily 03:23
225 .cronExpression("0 23 3 ? * *")
226 )
227 .variables(
228 new Variable("changeUrl", ""),
229 new Variable("patchset", "")
230 )
231 .planBranchManagement(
232 new PlanBranchManagement()
233 .delete(new BranchCleanup())
234 .notificationForCommitters()
235 );
236 }
237 }