Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Kujaku CI Build and Workflow configurations #376

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,17 @@ jobs:
run: git fetch origin master && git rev-list --first-parent --count origin/master

- name: Clean project
run: ./gradlew clean --stacktrace
run: ./gradlew clean --stacktrace

- name: Build project skipping tests
run: ./gradlew build -x test --stacktrace

- name: Run Instrumented Tests manually
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
script: ./gradlew :library:connectedDebug --stacktrace --info

- name: Run unit tests with Gradle
run: ./gradlew :library:clean :library:testDebugUnitTest --stacktrace
- name: Generate & upload library snapshot artifact AAR (Android Archive) file
run: ./gradlew :library:clean --stacktrace && ./gradlew :library:assembleRelease --stacktrace && ./gradlew :library:publishMavenJavaPublicationToMavenCentralRepository --stacktrace

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ jobs:
- name: Clean project
run: ./gradlew clean --stacktrace

- name: Build project skipping tests
run: ./gradlew build -x test --stacktrace

- name: Run Instrumented Tests manually
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
script: ./gradlew :utils:connectedDebug --stacktrace

- name: Generate & upload utils snapshot artifact AAR (Android Archive) file to Sonatype
run: ./gradlew :utils:clean --stacktrace && ./gradlew :utils:assembleRelease --stacktrace && ./gradlew :utils:publishMavenJavaPublicationToMavenCentralRepository --stacktrace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private synchronized void recordPendingLocation() {
/**
* Volatile because different methods are called from the main thread and serviceThread
*/
private final LocationListener locationListener = new LocationListener() {
private volatile LocationListener locationListener = new LocationListener() {
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.json.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
Expand Down Expand Up @@ -79,23 +78,23 @@
})
public class MapboxOfflineDownloaderServiceTest {

private String mapName = UUID.randomUUID().toString();
private final String mapName = UUID.randomUUID().toString();
private static final String TAG = MapboxOfflineDownloaderServiceTest.class.getSimpleName();

private Context context;
private MapboxOfflineDownloaderService mapboxOfflineDownloaderService;

private final String sampleValidMapboxStyleURL = "mapbox://styles/ona/90kiosdcIJ3d";
private String mapboxAccessToken;
private float minZoom = 22;
private float maxZoom = 10;
private LatLng topLeftBound = new LatLng(9.1, 9.1);
private LatLng topRightBound = new LatLng(9.1, 20.5);
private LatLng bottomRightBound = new LatLng(1.1, 20.5);
private LatLng bottomLeftBound = new LatLng(9.1, 1.1);
private final float minZoom = 22;
private final float maxZoom = 10;
private final LatLng topLeftBound = new LatLng(9.1, 9.1);
private final LatLng topRightBound = new LatLng(9.1, 20.5);
private final LatLng bottomRightBound = new LatLng(1.1, 20.5);
private final LatLng bottomLeftBound = new LatLng(9.1, 1.1);

private CountDownLatch latch;
private ArrayList<Object> resultsToCheck = new ArrayList<>();
private final ArrayList<Object> resultsToCheck = new ArrayList<>();

@Before
public void setUp() throws Exception {
Expand Down Expand Up @@ -241,19 +240,16 @@ public void persistOfflineMapTaskShouldSaveQueueTaskWhenGivenValidDownloadTask()
}

@Test
@Ignore("Hanging on CI")
public void sendBroadcastShouldProduceValidIntentWhenGivenDownloadUpdate() {
assertValidBroadcastCreatedWhenSendBroadcastIsCalled(MapboxOfflineDownloaderService.SERVICE_ACTION_RESULT.SUCCESSFUL, mapName, "9.0%", MapboxOfflineDownloaderService.SERVICE_ACTION.DOWNLOAD_MAP);
}

@Test
@Ignore("Hanging on CI")
public void sendBroadcast2ShouldProduceValidIntentWhenGivenDownloadUpdate() {
assertValidBroadcastCreatedWhenSendBroadcast2IsCalled(MapboxOfflineDownloaderService.SERVICE_ACTION_RESULT.SUCCESSFUL, mapName, MapboxOfflineDownloaderService.SERVICE_ACTION.DELETE_MAP);
}

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

Expand All @@ -269,7 +265,6 @@ public void mapboxTileLimitExceededShouldCreateValidBroadcast() throws Interrupt
}

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

Expand All @@ -286,7 +281,6 @@ public void onErrorShouldCreateValidBroadcastWhenGivenNonEmptyReasonAndMessage()
}

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

Expand All @@ -304,7 +298,6 @@ public void onErrorShouldCreateValidBroadcastWhenGivenNonEmptyReasonAndEmptyMess
}

@Test
@Ignore("Hanging on CI")
public void onStatusChangedShouldShowProgressNotificationWhenGivenIncompleteOfflineRegionStatus() throws NoSuchFieldException, IllegalAccessException, InterruptedException, NoSuchMethodException, InvocationTargetException {
latch = new CountDownLatch(1);
OfflineRegionStatus incompleteOfflineRegionStatus = createOfflineRegion(OfflineRegion.STATE_ACTIVE, 200, 98923, 898, 230909, 300, true, false);
Expand Down Expand Up @@ -427,7 +420,6 @@ public void getTaskStatusShouldUpdateCurrentDownloadMapNameWhenGivenValidDeleteQ
}

@Test
@Ignore("Hanging on CI")
public synchronized void onStatusChangedShouldShowDownloadCompleteNotificationWhenGivenCompletedOfflineRegion() throws Throwable {
latch = new CountDownLatch(1);
OfflineRegionStatus completeOfflineRegionStatus = createOfflineRegion(OfflineRegion.STATE_ACTIVE, 300, 98923, 898, 230909, 300, true, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public void testTrackingServiceDefaultUiConfiguration() {
}

@Test
@Ignore("Hanging on CI")
public void testStartAndBindService() throws InterruptedException {
CountDownLatch latch1 = new CountDownLatch(1);
CountDownLatch latch2 = new CountDownLatch(1);
Expand Down Expand Up @@ -222,7 +221,6 @@ public void onServiceDisconnected(ComponentName name) {
}

@Test
@Ignore("Hanging on CI")
public void testServiceWithLocationInDistanceTolerance() throws InterruptedException {
controller = Robolectric.buildService(TrackingService.class,
TrackingService.getIntent(context, MapActivity.class, new TrackingServiceHighAccuracyOptions()));
Expand Down Expand Up @@ -320,7 +318,6 @@ public void onServiceDisconnected() {
}

@Test
@Ignore("Flakey Unit Test : To Do Fix")
public void testServiceWithTags() throws InterruptedException {
long startTag = 1000;
long nextTag = 2000;
Expand Down
Loading