Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
gitlab-ci-android
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸大学计算机学院
教师群组
宋海霞-shx
androidTest
gitlab-ci-android
提交
f2946578
提交
f2946578
11月 21, 2016
创建
作者:
Greyson Parrelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add comments, break up CI into two stages.
上级
ca0b8bcd
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
15 行增加
和
8 行删除
+15
-8
.gitlab-ci.yml
.gitlab-ci.yml
+10
-5
AddingTest.java
.../java/com/greysonparrelli/gitlabciandroid/AddingTest.java
+2
-2
TestBase.java
...st/java/com/greysonparrelli/gitlabciandroid/TestBase.java
+2
-0
AdderTest.java
...t/java/com/greysonparrelli/gitlabciandroid/AdderTest.java
+1
-1
没有找到文件。
.gitlab-ci.yml
浏览文件 @
f2946578
image
:
openjdk:8-jdk
image
:
openjdk:8-jdk
variables
:
variables
:
ANDROID_
TARGET
_SDK
:
"
25"
ANDROID_
COMPILE
_SDK
:
"
25"
ANDROID_BUILD_TOOLS
:
"
24.0.0"
ANDROID_BUILD_TOOLS
:
"
24.0.0"
ANDROID_SDK_TOOLS
:
"
24.4.1"
ANDROID_SDK_TOOLS
:
"
24.4.1"
...
@@ -10,7 +10,7 @@ before_script:
...
@@ -10,7 +10,7 @@ before_script:
-
apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
-
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
-
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
-
tar --extract --gzip --file=android-sdk.tgz
-
echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_
TARGET
_SDK}
-
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 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 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-android-m2repository
...
@@ -21,10 +21,11 @@ before_script:
...
@@ -21,10 +21,11 @@ before_script:
-
chmod +x ./gradlew
-
chmod +x ./gradlew
stages
:
stages
:
-
build
-
test
-
test
build
:
build
:
stage
:
test
stage
:
build
script
:
script
:
-
./gradlew assembleDebug
-
./gradlew assembleDebug
artifacts
:
artifacts
:
...
@@ -41,9 +42,12 @@ functionalTests:
...
@@ -41,9 +42,12 @@ functionalTests:
script
:
script
:
-
wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
-
wget --quiet --output-document=android-wait-for-emulator https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
-
chmod +x android-wait-for-emulator
-
chmod +x android-wait-for-emulator
-
echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter sys-img-x86-google_apis-${ANDROID_
TARGET
_SDK}
-
echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter sys-img-x86-google_apis-${ANDROID_
COMPILE
_SDK}
-
echo no | android-sdk-linux/tools/android create avd -n test -t android-${ANDROID_
TARGET
_SDK} --abi google_apis/x86
-
echo no | android-sdk-linux/tools/android create avd -n test -t android-${ANDROID_
COMPILE
_SDK} --abi google_apis/x86
-
android-sdk-linux/tools/emulator64-x86 -avd test -no-window -no-audio &
-
android-sdk-linux/tools/emulator64-x86 -avd test -no-window -no-audio &
-
./android-wait-for-emulator
-
./android-wait-for-emulator
-
adb shell input keyevent 82
-
adb shell input keyevent 82
-
./gradlew cAT
-
./gradlew cAT
artifacts
:
paths
:
-
app/build/reports/androidTests/
\ No newline at end of file
app/src/androidTest/java/com/greysonparrelli/gitlabciandroid/AddingTest.java
浏览文件 @
f2946578
...
@@ -16,9 +16,9 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId;
...
@@ -16,9 +16,9 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId;
import
static
android
.
support
.
test
.
espresso
.
matcher
.
ViewMatchers
.
withText
;
import
static
android
.
support
.
test
.
espresso
.
matcher
.
ViewMatchers
.
withText
;
/**
/**
*
Instrumentation test, which will execute on an Android device
.
*
Tests the adding flow in the app
.
*
*
* @
see <a href="http://d.android.com/tools/testing">Testing documentation</a>
* @
author Greyson Parrelli (keybase.io/greyson)
*/
*/
@RunWith
(
AndroidJUnit4
.
class
)
@RunWith
(
AndroidJUnit4
.
class
)
public
class
AddingTest
extends
TestBase
{
public
class
AddingTest
extends
TestBase
{
...
...
app/src/androidTest/java/com/greysonparrelli/gitlabciandroid/TestBase.java
浏览文件 @
f2946578
...
@@ -18,6 +18,7 @@ public abstract class TestBase {
...
@@ -18,6 +18,7 @@ public abstract class TestBase {
@Before
@Before
public
void
setup
()
{
public
void
setup
()
{
// Unlock the screen if it's locked
UiDevice
device
=
UiDevice
.
getInstance
(
InstrumentationRegistry
.
getInstrumentation
());
UiDevice
device
=
UiDevice
.
getInstance
(
InstrumentationRegistry
.
getInstrumentation
());
try
{
try
{
device
.
wakeUp
();
device
.
wakeUp
();
...
@@ -25,6 +26,7 @@ public abstract class TestBase {
...
@@ -25,6 +26,7 @@ public abstract class TestBase {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
// Set the flags on our activity so it'll appear regardless of lock screen state
final
Activity
activity
=
getActivityRule
().
getActivity
();
final
Activity
activity
=
getActivityRule
().
getActivity
();
Runnable
wakeUpDevice
=
new
Runnable
()
{
Runnable
wakeUpDevice
=
new
Runnable
()
{
public
void
run
()
{
public
void
run
()
{
...
...
app/src/test/java/com/greysonparrelli/gitlabciandroid/AdderTest.java
浏览文件 @
f2946578
...
@@ -6,7 +6,7 @@ import org.junit.Test;
...
@@ -6,7 +6,7 @@ import org.junit.Test;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
/**
*
Adds numbers together
.
*
Tests the {@link Adder} class
.
*
*
* @author Greyson Parrelli (keybase.io/greyson)
* @author Greyson Parrelli (keybase.io/greyson)
*/
*/
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论