Skip to content
Snippets Groups Projects
Commit 8d0af4af authored by John Carlson's avatar John Carlson
Browse files

Fix tests

parent aa41fed5
No related branches found
No related tags found
No related merge requests found
Pipeline #
image: commit451/android-config:latest
#Derived from https://about.gitlab.com/2016/11/30/setting-up-gitlab-ci-for-android-projects/
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "25"
ANDROID_BUILD_TOOLS: "25.0.2"
ANDROID_SDK_TOOLS: "25.2.3"
 
before_script:
# Make sure that there won't be any interactive prompts that await user interaction
- unset DISPLAY
- export TERM=dumb
- export _JAVA_OPTIONS="-Djava.awt.headless=true"
# Increase the heap size to 3 GB for faster builds
- export JAVA_OPTS="-Xmx3G"
# Make the gradle wrapper executable
- chmod +x gradlew
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- wget --quiet --output-document=android-sdk.tgz https://dl.google.com/android/android-sdk_r${ANDROID_SDK_TOOLS}-linux.tgz
- tar --extract --gzip --file=android-sdk.tgz
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_COMPILE_SDK}
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter platform-tools
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter build-tools-${ANDROID_BUILD_TOOLS}
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-android-m2repository
# - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-google_play_services
# - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-m2repository
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
stages:
- build
- test
 
build:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/
unitTests:
stage: test
script:
- ./gradlew testFdroidDebug --stacktrace
- ./gradlew test
Loading
Loading
@@ -22,7 +22,7 @@ def versionBuild = 0 // bump for dogfood builds, public betas, etc.
 
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
buildToolsVersion "25.0.2"
 
project.ext {
LABCOAT_FABRIC_KEY = project.hasProperty("LABCOAT_FABRIC_KEY") ? project.LABCOAT_FABRIC_KEY : "";
Loading
Loading
Loading
Loading
@@ -9,14 +9,14 @@ import junit.framework.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLog;
 
/**
* Tests account login and basic retrieval stuff
*/
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21)
public class RoutingTests {
 
Loading
Loading
Loading
Loading
@@ -34,8 +34,7 @@ public class TestUtil {
GitLab gitLab = GitLabFactory.create(account, gitlabClientBuilder.build(), true);
Response<UserLogin> loginResponse = gitLab
.loginWithUsername("TestAllTheThings", "testing123")
.toBlocking()
.first();
.blockingGet();
assertTrue(loginResponse.isSuccessful());
assertNotNull(loginResponse.body().getPrivateToken());
//attach the newly retrieved private token
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment