Debug failing test

pull/37/head
Mattia Iavarone 8 years ago
parent 452c694e14
commit ef3672e8d6
  1. 4
      .travis.yml
  2. 16
      cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java
  3. 1
      cameraview/src/androidTest/java/com/otaliastudios/cameraview/TestActivity.java

@ -57,9 +57,9 @@ before_script:
script: script:
- ./gradlew clean testDebugUnitTest - ./gradlew clean testDebugUnitTest
- adb logcat -c - adb logcat -c
- adb logcat & - adb logcat -v color Test:V TestRunner:V CameraView:V CameraController:V Camera1:V WorkerHandler:V *:S &
- export LOGCAT_PID=$! - export LOGCAT_PID=$!
- ./gradlew --info connectedCheck # Want info here - ./gradlew connectedCheck
- kill $LOGCAT_PID - kill $LOGCAT_PID
- ./gradlew mergedCoverageReport - ./gradlew mergedCoverageReport

@ -142,7 +142,7 @@ public class IntegrationTest extends BaseTest {
waitForClose(false); waitForClose(false);
} }
// @Test @Test
// TODO: This works great on the device but crashes on the emulator. // TODO: This works great on the device but crashes on the emulator.
// There must be something wrong with the emulated camera... // There must be something wrong with the emulated camera...
// Like stopPreview() and release() are not really sync calls? // Like stopPreview() and release() are not really sync calls?
@ -317,10 +317,9 @@ public class IntegrationTest extends BaseTest {
//region testSetVideoQuality //region testSetVideoQuality
// This can be tricky because can trigger layout changes. // This can be tricky because can trigger layout changes.
// @Test(expected = IllegalStateException.class) // TODO: @Test(expected = IllegalStateException.class)
// TODO: Can't run on Travis, MediaRecorder not supported. // Can't run on Travis, MediaRecorder not supported.
// Error while starting MediaRecorder. java.lang.RuntimeException: start failed. // Error while starting MediaRecorder. java.lang.RuntimeException: start failed.
@Test
public void testSetVideoQuality_whileRecording() { public void testSetVideoQuality_whileRecording() {
camera.setSessionType(SessionType.VIDEO); camera.setSessionType(SessionType.VIDEO);
camera.setVideoQuality(VideoQuality.HIGHEST); camera.setVideoQuality(VideoQuality.HIGHEST);
@ -328,7 +327,6 @@ public class IntegrationTest extends BaseTest {
waitForOpen(true); waitForOpen(true);
camera.startCapturingVideo(null); camera.startCapturingVideo(null);
camera.setVideoQuality(VideoQuality.LOWEST); camera.setVideoQuality(VideoQuality.LOWEST);
throw new RuntimeException(CameraLogger.lastTag + ":" + CameraLogger.lastMessage);
} }
//-@Test //-@Test
@ -361,8 +359,8 @@ public class IntegrationTest extends BaseTest {
//region test startVideo //region test startVideo
// @Test(expected = IllegalStateException.class) // TODO: @Test(expected = IllegalStateException.class)
// TODO: fails on Travis. Some emulators can't deal with MediaRecorder // Fails on Travis. Some emulators can't deal with MediaRecorder
// Error while starting MediaRecorder. java.lang.RuntimeException: start failed. // Error while starting MediaRecorder. java.lang.RuntimeException: start failed.
// as documented. This works locally though. // as documented. This works locally though.
public void testStartVideo_whileInPictureMode() { public void testStartVideo_whileInPictureMode() {
@ -372,8 +370,8 @@ public class IntegrationTest extends BaseTest {
camera.startCapturingVideo(null); camera.startCapturingVideo(null);
} }
// @Test // TODO: @Test
// TODO: fails on Travis. Some emulators can't deal with MediaRecorder, // Fails on Travis. Some emulators can't deal with MediaRecorder,
// Error while starting MediaRecorder. java.lang.RuntimeException: start failed. // Error while starting MediaRecorder. java.lang.RuntimeException: start failed.
// as documented. This works locally though. // as documented. This works locally though.
public void testStartEndVideo() { public void testStartEndVideo() {

@ -24,6 +24,7 @@ public class TestActivity extends Activity {
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
wakeScreen(); wakeScreen();
// Match parent decor view. // Match parent decor view.

Loading…
Cancel
Save