forked from KasperskyLab/Kaspresso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
80 lines (78 loc) · 3.18 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
check_android_task:
name: Run Android instrumented tests
env:
SCREENSHOTS_ROOT_DIR: /data/user/0/com.kaspersky.kaspressample/files/screenshots
TUTORIAL_SCREENSHOTS_ROOT_DIR: /data/user/0/com.kaspersky.kaspresso.tutorial/files/screenshots
ALLURE_SAMPLE_RESULTS_ROOT_DIR: /data/data/com.kaspersky.kaspresso.alluresupport.sample/files/allure-results
DISPLAY: :99
only_if: $CIRRUS_PR != '' && $CIRRUS_BASE_BRANCH == 'master'
container:
image: cirrusci/android-sdk:30
kvm: true
cpu: 8
memory: 24G
# xfce4 somehow helps to pass "Geolocation" test
install_de_script: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install xfce4 -y
apt-get purge -y pm-utils xscreensaver*
apt-get install xvfb -y
start_de_background_script: |
Xvfb :99 -screen 0 1000x1000x16 &
sleep 5
startxfce4
start_adb_server_background_script:
java -jar artifacts/adbserver-desktop.jar || true
accept_licenses_script:
echo yes | sdkmanager --licenses
install_emulator_script:
# x86_64 somehow affect the "call" test
sdkmanager --install "system-images;android-30;google_apis;x86"
create_avd_script:
echo no | avdmanager create avd --force
-n emulator
-k "system-images;android-30;google_apis;x86"
start_avd_background_script:
$ANDROID_HOME/emulator/emulator
-avd emulator
-no-audio
-no-boot-anim
-gpu swiftshader_indirect
-no-snapshot
# -no-window is not used here because the flag somehow affects the "GPS" test. actual for API=30
assemble_instrumented_tests_script:
./gradlew assembleDebugAndroidTest
wait_for_avd_script:
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 3; done; input keyevent 82'
configure_avd_script: |
adb shell settings put global window_animation_scale 0.0
adb shell settings put global transition_animation_scale 0.0
adb shell settings put global animator_duration_scale 0.0
adb shell settings put secure spell_checker_enabled 0
adb shell settings put secure show_ime_with_hard_keyboard 1
run_tests_script:
./gradlew connectedDebugAndroidTest
# After we do "adb root" connection is closed for a moment. So first attempt to pull screenshots usually fails
# That's why we make 5 attempts to pull folders
always:
pull_screenshots_script: |
adb root
mkdir sample_screenshots
for i in {1..5}; do adb pull $SCREENSHOTS_ROOT_DIR sample_screenshots && break || sleep 5; done
mkdir tutorial_screenshots
adb pull $TUTORIAL_SCREENSHOTS_ROOT_DIR tutorial_screenshots || true
mkdir allure_results
adb pull $ALLURE_SAMPLE_RESULTS_ROOT_DIR allure_results
sample_report_artifacts:
path: "samples/kaspresso-sample/build/reports/androidTests/connected/**/*"
tutorial_report_artifacts:
path: "tutorial/build/reports/androidTests/connected/**/*"
allure_report_artifacts:
path: "samples/kaspresso-allure-support-sample/build/reports/androidTests/connected/**/*"
sample_screenshots_artifacts:
path: "sample_screenshots/**/*"
tutorial_screenshots_artifacts:
path: "tutorial_screenshots/**/*"
allure_results_artifacts:
path: "allure_results/**/*"