Skip to content

Commit d7ae2f7

Browse files
committed
Revert "Disable failing tests"
This reverts commit 5bdafb1.
1 parent d80eaf3 commit d7ae2f7

5 files changed

Lines changed: 26 additions & 14 deletions

File tree

.github/workflows/library.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,16 @@ jobs:
4646
run: git fetch origin master && git rev-list --first-parent --count origin/master
4747

4848
- name: Clean project
49-
run: ./gradlew clean --stacktrace
49+
run: ./gradlew clean --stacktrace
50+
51+
- name: Build project skipping tests
52+
run: ./gradlew build -x test --stacktrace
53+
54+
- name: Run Instrumented Tests manually
55+
uses: reactivecircus/android-emulator-runner@v2
56+
with:
57+
api-level: 34
58+
script: ./gradlew :library:connectedDebug --stacktrace --info
5059

5160
- name: Run unit tests with Gradle
5261
run: ./gradlew :library:clean :library:testDebugUnitTest --stacktrace

.github/workflows/utils.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ jobs:
4848
- name: Clean project
4949
run: ./gradlew clean --stacktrace
5050

51+
- name: Build project skipping tests
52+
run: ./gradlew build -x test --stacktrace
53+
54+
- name: Run Instrumented Tests manually
55+
uses: reactivecircus/android-emulator-runner@v2
56+
with:
57+
api-level: 34
58+
script: ./gradlew :utils:connectedDebug --stacktrace
59+
5160
- name: Generate & upload utils snapshot artifact AAR (Android Archive) file to Sonatype
5261
run: ./gradlew :utils:clean --stacktrace && ./gradlew :utils:assembleRelease --stacktrace && ./gradlew :utils:publishMavenJavaPublicationToMavenCentralRepository --stacktrace
5362

library/src/main/java/io/ona/kujaku/services/TrackingService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private synchronized void recordPendingLocation() {
502502
/**
503503
* Volatile because different methods are called from the main thread and serviceThread
504504
*/
505-
private final LocationListener locationListener = new LocationListener() {
505+
private volatile LocationListener locationListener = new LocationListener() {
506506
@Override
507507
public void onStatusChanged(String provider, int status, Bundle extras) {
508508

library/src/test/java/io/ona/kujaku/services/MapboxOfflineDownloaderServiceTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.json.JSONObject;
2222
import org.junit.After;
2323
import org.junit.Before;
24-
import org.junit.Ignore;
2524
import org.junit.Test;
2625
import org.junit.runner.RunWith;
2726
import org.mockito.Mockito;
@@ -66,6 +65,11 @@
6665
import static org.junit.Assert.fail;
6766
import static org.mockito.Mockito.mock;
6867

68+
/**
69+
*
70+
*
71+
* Created by Ephraim Kigamba - ekigamba@ona.io on 05/12/2017.
72+
*/
6973
@RunWith(RobolectricTestRunner.class)
7074
@Config(manifest = Config.NONE,
7175
shadows = {
@@ -85,7 +89,7 @@ public class MapboxOfflineDownloaderServiceTest {
8589
private Context context;
8690
private MapboxOfflineDownloaderService mapboxOfflineDownloaderService;
8791

88-
private final String sampleValidMapboxStyleURL = "mapbox://styles/ona/90kiosdcIJ3d";
92+
private String sampleValidMapboxStyleURL = "mapbox://styles/ona/90kiosdcIJ3d";
8993
private String mapboxAccessToken;
9094
private float minZoom = 22;
9195
private float maxZoom = 10;
@@ -241,19 +245,16 @@ public void persistOfflineMapTaskShouldSaveQueueTaskWhenGivenValidDownloadTask()
241245
}
242246

243247
@Test
244-
@Ignore("Hanging on CI")
245248
public void sendBroadcastShouldProduceValidIntentWhenGivenDownloadUpdate() {
246249
assertValidBroadcastCreatedWhenSendBroadcastIsCalled(MapboxOfflineDownloaderService.SERVICE_ACTION_RESULT.SUCCESSFUL, mapName, "9.0%", MapboxOfflineDownloaderService.SERVICE_ACTION.DOWNLOAD_MAP);
247250
}
248251

249252
@Test
250-
@Ignore("Hanging on CI")
251253
public void sendBroadcast2ShouldProduceValidIntentWhenGivenDownloadUpdate() {
252254
assertValidBroadcastCreatedWhenSendBroadcast2IsCalled(MapboxOfflineDownloaderService.SERVICE_ACTION_RESULT.SUCCESSFUL, mapName, MapboxOfflineDownloaderService.SERVICE_ACTION.DELETE_MAP);
253255
}
254256

255257
@Test
256-
@Ignore("Hanging on CI")
257258
public void mapboxTileLimitExceededShouldCreateValidBroadcast() throws InterruptedException, NoSuchFieldException, IllegalAccessException {
258259
latch = new CountDownLatch(1);
259260

@@ -269,7 +270,6 @@ public void mapboxTileLimitExceededShouldCreateValidBroadcast() throws Interrupt
269270
}
270271

271272
@Test
272-
@Ignore("Failing : To Do Fix")
273273
public void onErrorShouldCreateValidBroadcastWhenGivenNonEmptyReasonAndMessage() throws NoSuchFieldException, IllegalAccessException {
274274
latch = new CountDownLatch(1);
275275

@@ -286,7 +286,6 @@ public void onErrorShouldCreateValidBroadcastWhenGivenNonEmptyReasonAndMessage()
286286
}
287287

288288
@Test
289-
@Ignore("Hanging on CI")
290289
public void onErrorShouldCreateValidBroadcastWhenGivenNonEmptyReasonAndEmptyMessage() throws NoSuchFieldException, IllegalAccessException, InterruptedException {
291290
latch = new CountDownLatch(1);
292291

@@ -304,7 +303,6 @@ public void onErrorShouldCreateValidBroadcastWhenGivenNonEmptyReasonAndEmptyMess
304303
}
305304

306305
@Test
307-
@Ignore("Hanging on CI")
308306
public void onStatusChangedShouldShowProgressNotificationWhenGivenIncompleteOfflineRegionStatus() throws NoSuchFieldException, IllegalAccessException, InterruptedException, NoSuchMethodException, InvocationTargetException {
309307
latch = new CountDownLatch(1);
310308
OfflineRegionStatus incompleteOfflineRegionStatus = createOfflineRegion(OfflineRegion.STATE_ACTIVE, 200, 98923, 898, 230909, 300, true, false);
@@ -427,7 +425,6 @@ public void getTaskStatusShouldUpdateCurrentDownloadMapNameWhenGivenValidDeleteQ
427425
}
428426

429427
@Test
430-
@Ignore("Hanging on CI")
431428
public synchronized void onStatusChangedShouldShowDownloadCompleteNotificationWhenGivenCompletedOfflineRegion() throws Throwable {
432429
latch = new CountDownLatch(1);
433430
OfflineRegionStatus completeOfflineRegionStatus = createOfflineRegion(OfflineRegion.STATE_ACTIVE, 300, 98923, 898, 230909, 300, true, true);

library/src/test/java/io/ona/kujaku/services/TrackingServiceTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public void testTrackingServiceDefaultUiConfiguration() {
192192
}
193193

194194
@Test
195-
@Ignore("Hanging on CI")
196195
public void testStartAndBindService() throws InterruptedException {
197196
CountDownLatch latch1 = new CountDownLatch(1);
198197
CountDownLatch latch2 = new CountDownLatch(1);
@@ -222,7 +221,6 @@ public void onServiceDisconnected(ComponentName name) {
222221
}
223222

224223
@Test
225-
@Ignore("Hanging on CI")
226224
public void testServiceWithLocationInDistanceTolerance() throws InterruptedException {
227225
controller = Robolectric.buildService(TrackingService.class,
228226
TrackingService.getIntent(context, MapActivity.class, new TrackingServiceHighAccuracyOptions()));
@@ -320,7 +318,6 @@ public void onServiceDisconnected() {
320318
}
321319

322320
@Test
323-
@Ignore("Flakey Unit Test : To Do Fix")
324321
public void testServiceWithTags() throws InterruptedException {
325322
long startTag = 1000;
326323
long nextTag = 2000;

0 commit comments

Comments
 (0)