-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathZenithTest.groovy
More file actions
190 lines (154 loc) · 4.84 KB
/
Copy pathZenithTest.groovy
File metadata and controls
190 lines (154 loc) · 4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/* Test results of generators */
import static org.junit.Assert.assertTrue;
import java.io.File;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
/**
* Test to be run after all installer metadata has been generated.
* Sanity checks for the installer metadata.
*/
class ZenithTest {
@Rule
public TestRule watchman = [failed: {e, d ->
println d
e.printStackTrace()
System.exit(1)
}
] as TestWatcher; // System.exit(1) if any test fails
void checkFileSize(long minimumSize, String fileName) {
File dataFile = new File("target/" + fileName);
assertTrue("File target/" + fileName + " does not exist", dataFile.exists());
long actualSize = dataFile.length();
assertTrue(
"Size of target/" + fileName + " was " + actualSize + ", less than minimum " + minimumSize,
actualSize >= minimumSize,
);
}
@Test
void adoptopenjdk() {
checkFileSize(300_000L, "io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.json");
}
@Test
void allure() {
checkFileSize(10_000L, "ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstaller.json");
}
@Test
void ant() {
checkFileSize(4_000L, "hudson.tasks.Ant.AntInstaller.json");
}
@Test
void buckminster() {
checkFileSize(4_000L, "hudson.plugins.buckminster.BuckminsterInstallation.BuckminsterInstaller.json");
}
@Test
void chromedriver() {
checkFileSize(10_000L, "org.jenkins-ci.plugins.chromedriver.ChromeDriver.json");
}
@Test
void cmake() {
checkFileSize(200_000L, "hudson.plugins.cmake.CmakeInstaller.json");
}
@Test
void codeql() {
checkFileSize(400L, "io.jenkins.plugins.codeql.CodeQLInstaller.json");
}
@Test
void consul() {
checkFileSize(400_000L, "com.inneractive.jenkins.plugins.consul.ConsulInstaller.json");
}
@Test
void dependencycheck() {
checkFileSize(15_000L, "org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstaller.json");
}
@Test
void dotnetSdk() {
checkFileSize(90_000L, "io.jenkins.plugins.dotnet.data.Downloads.json");
}
@Test
void flyway() {
checkFileSize(15_000L, "sp.sd.flywayrunner.installation.FlywayInstaller.json");
}
@Test
void golang() {
checkFileSize(600_000L, "org.jenkinsci.plugins.golang.GolangInstaller.json");
}
@Test
void gradle() {
checkFileSize(60_000L, "hudson.plugins.gradle.GradleInstaller.json");
}
@Test
void grails() {
checkFileSize(24_000L, "com.g2one.hudson.grails.GrailsInstaller.json");
}
@Test
void groovy() {
checkFileSize(20_000L, "hudson.plugins.groovy.GroovyInstaller.json");
}
@Test
void jdk() {
checkFileSize(400_000L, "hudson.tools.JDKInstaller.json");
}
// TODO: Fix the leiningen generator and stop ignoring this test
@Test
@Ignore
void leiningen() {
checkFileSize(80L, "org.jenkins-ci.plugins.leiningen.LeinInstaller.json");
}
@Test
void maven() {
checkFileSize(8_000L, "hudson.tasks.Maven.MavenInstaller.json");
}
// TODO: Fix the mongodb generator and stop ignoring this test
@Test
@Ignore
void mongodb() {
checkFileSize(80L, "org.jenkinsci.plugins.mongodb.MongoDBInstaller.json");
}
@Test
void nodejs() {
checkFileSize(80_000L, "hudson.plugins.nodejs.tools.NodeJSInstaller.json");
}
@Test
void packer() {
checkFileSize(300_000L, "biz.neustar.jenkins.plugins.packer.PackerInstaller.json");
}
@Test
void play() {
checkFileSize(8_000L, "hudson.plugins.play.PlayInstaller.json");
}
@Test
void recipe() {
checkFileSize(2_000L, "org.jenkinsci.plugins.recipe.RecipeCatalog.json");
}
@Test
void sbt() {
checkFileSize(10_000L, "org.jvnet.hudson.plugins.SbtPluginBuilder.SbtInstaller.json");
}
@Test
void sbuild() {
checkFileSize(2_000L, "org.sbuild.jenkins.plugin.SBuildInstaller.json");
}
@Test
void scala() {
checkFileSize(10_000L, "hudson.plugins.scala.ScalaInstaller.json");
}
@Test
void scriptler() {
checkFileSize(24_000L, "org.jenkinsci.plugins.scriptler.CentralScriptJsonCatalog.json");
}
@Test
void sonarqubescanner() {
checkFileSize(8_000L, "hudson.plugins.sonar.SonarRunnerInstaller.json");
}
@Test
void sonarqubescannermsbuild() {
checkFileSize(60_000L, "hudson.plugins.sonar.MsBuildSonarQubeRunnerInstaller.json");
}
@Test
void terraform() {
checkFileSize(700_000L, "org.jenkinsci.plugins.terraform.TerraformInstaller.json");
}
}