@@ -19,18 +19,7 @@ class MainTest extends Specification {
19
19
}
20
20
21
21
static assertResults (results , Closure closure ) {
22
- // 1.Ensure one or more results exist
23
- assert results
24
-
25
- // 2. Ensure we don't have any failures
26
- results. each {
27
- assert ! it. value. contains(' FAILED' )
28
- }
29
-
30
- // 3. Run test specific asserts
31
- results. each {
32
- closure(it)
33
- }
22
+ AssertHelpers . assertResults(results, closure)
34
23
}
35
24
36
25
// This version range is in the OneSignal instructions
@@ -1177,44 +1166,6 @@ class MainTest extends Specification {
1177
1166
}
1178
1167
}
1179
1168
1180
- // Note: Slow 20 second test, this is doing a full build
1181
- // This is needed as we are making sure compile and runtime versions are not being miss aligned
1182
- // Asserts just a double check as Gradle or AGP fails to build when this happens
1183
- def " Upgrade to compatible OneSignal SDK when targetSdkVersion is 26 with build tasks" () {
1184
- GradleTestTemplate . buildArgumentSets = [
1185
- ' 6.7.1' : [[' build' ]]
1186
- ]
1187
- GradleTestTemplate . gradleVersions[' 6.7.1' ] = ' com.android.tools.build:gradle:4.1.1'
1188
-
1189
- when :
1190
- def results = runGradleProject([
1191
- compileSdkVersion : 26 ,
1192
- targetSdkVersion : 26 ,
1193
- compileLines : " compile 'com.onesignal:OneSignal:3.5.+'"
1194
- ])
1195
-
1196
- then :
1197
- assert results // Asserting existence and contains 1+ entries
1198
- }
1199
-
1200
-
1201
- // Note: Slow 20 second test, this is doing a full build
1202
- def ' Full build on project with sub project prints no errors' () {
1203
- GradleTestTemplate . buildArgumentSets[GRADLE_LATEST_VERSION ] = [[' build' ]]
1204
-
1205
- when :
1206
- def results = runGradleProject([
1207
- skipGradleVersion : GRADLE_OLDEST_VERSION ,
1208
- subProjectCompileLines : """ \
1209
- compile 'com.onesignal:OneSignal:3.6.4'
1210
- """
1211
- ])
1212
-
1213
- then :
1214
- assertResults(results) {
1215
- assert ! it. value. toLowerCase(). contains(' failure' )
1216
- }
1217
- }
1218
1169
def ' upgrade support library to 25 when gms is 11.2.0' () {
1219
1170
def compileLines = """ \
1220
1171
compile 'com.google.android.gms:play-services-base:11.2.0'
@@ -1306,7 +1257,6 @@ class MainTest extends Specification {
1306
1257
}
1307
1258
}
1308
1259
1309
-
1310
1260
// Note: Run manually to find the min compileSdkVersion for each support version
1311
1261
def ' Find min-support version for compileSdkVersion' () {
1312
1262
GradleTestTemplate . buildArgumentSets[GRADLE_LATEST_VERSION ] = [[' compileDebugSources' ]]
@@ -1324,52 +1274,4 @@ class MainTest extends Specification {
1324
1274
then :
1325
1275
assert results // Asserting existence and contains 1+ entries
1326
1276
}
1327
-
1328
- // This test is designed to fail with new Google releases
1329
- // - This is a flag to know we need to make a change in this plugin to resolve version conflicts
1330
- // Run manually search for "Warning:".
1331
- def ' Find min-support for Firebase and GMS - build' () {
1332
- GradleTestTemplate . buildArgumentSets[GRADLE_LATEST_VERSION ] = [[' build' ]]
1333
- when :
1334
- // Keep as '+' for latest when checking in to this fails when Google changes requirements
1335
- def results = runGradleProject([
1336
- ' android.useAndroidX' : true ,
1337
- compileLines : """
1338
- compile 'com.google.android.gms:play-services-ads:+'
1339
- compile 'com.google.android.gms:play-services-base:+'
1340
- compile 'com.google.android.gms:play-services-location:+'
1341
- // compile 'com.onesignal:OneSignal:[3.11.1, 3.99.99]' // TODO: Need to fix, see note below
1342
- """ ,
1343
- skipGradleVersion : GRADLE_OLDEST_VERSION
1344
- ])
1345
- // NOTE: There is a mix between AndroidX and the Android Support Library.
1346
- // One to this test may cause duplicated or missing classes with either of these
1347
- // Might need to follow the AndroidX migration guide to fix and re-add support library
1348
-
1349
- then :
1350
- assert results // Assert success
1351
- }
1352
-
1353
- // Run manually search for "Warning:".
1354
- // If a support library class is listed
1355
- // then the support library needs to be updated for the firebase / GMS version
1356
- def ' test core and messaging - build' () {
1357
- // Other run options that can be manually run to help debug the issue
1358
- // GradleTestTemplate.buildArgumentSets[GRADLE_OLDEST_VERSION] = [['checkReleaseDuplicateClasses', '--info']]
1359
- // GradleTestTemplate.buildArgumentSets[GRADLE_OLDEST_VERSION] = [['transformClassesAndResourcesWithProguardForDebug', '--info']]
1360
- // GradleTestTemplate.buildArgumentSets[GRADLE_LATEST_VERSION] = [['dependencies', '--configuration', 'debugCompileClasspath', '--info']]
1361
- GradleTestTemplate . buildArgumentSets[GRADLE_LATEST_VERSION ] = [[' build' ]] // , '--info']]
1362
- when :
1363
- def results = runGradleProject([
1364
- compileLines : """
1365
- implementation 'com.google.android.gms:play-services-base:15.0.1'
1366
- implementation 'com.google.android.gms:play-services-basement:17.4.0'
1367
- """ ,
1368
- skipGradleVersion : GRADLE_OLDEST_VERSION ,
1369
- ' android.useAndroidX' : true ,
1370
- ])
1371
-
1372
- then :
1373
- assert results // Assert success
1374
- }
1375
1277
}
0 commit comments