Commit b1181b80 authored by Peio Rigaux's avatar Peio Rigaux

enabled unit tests for the CHECKED RIGHT job to avoid link error at runtime,...

enabled unit tests for the CHECKED RIGHT job to avoid link error at runtime, and commenting useless builds in ci files
parent a1ec04ad
......@@ -7,4 +7,4 @@ cmake/Windows/**/bin
cmake/Windows/wrapper/LinphoneWrapper.cs
cmake/Windows/nuget/Win32
cmake/Windows/nuget/NuGetLinphoneSDK
**/*.temp
\ No newline at end of file
**/*.temp
......@@ -10,15 +10,23 @@
script:
- sdkmanager
- mkdir -p build-android
- cd build-android
- mkdir -p build
- cd build
- echo $CMAKE_GENERATOR
- echo $ANDROID_ARCHS
- echo $DEFAULT_LINUX_CMAKE_OPTIONS
- echo $CMAKE_OPTIONS
- cmake .. -G "$CMAKE_GENERATOR" -DLINPHONESDK_PLATFORM=Android -DLINPHONESDK_ANDROID_ARCHS="$ANDROID_ARCHS" $DEFAULT_LINUX_CMAKE_OPTIONS $CMAKE_OPTIONS
- cmake --build . --target sdk -- $ADDITIONAL_BUILD_OPTIONS
artifacts:
paths:
- build-android/linphone-sdk/bin/outputs/aar/*.aar
- build-android/linphone-sdk/bin/distributions/linphone-sdk-*.zip
- build/linphone-sdk/bin/outputs/aar/*.aar
- build/linphone-sdk/bin/distributions/linphone-sdk-*.zip
#Needed for tester
- build/libs-debug/*
- linphone/tester/*
when: always
expire_in: 1 week
......@@ -106,6 +114,7 @@ job-android-ninja-r17c:
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-android:r17c
variables:
CMAKE_GENERATOR: Ninja
CMAKE_OPTIONS: -DENABLE_UNIT_TESTS=ON
extends: .job-android
......@@ -138,3 +147,63 @@ job-android-ninja-r19:
variables:
CMAKE_GENERATOR: Ninja
extends: .job-android
test-android-r17c:
tags: [ "docker-android-test-r17c" ]
stage: test
allow_failure: true
dependencies:
- job-android-ninja-r17c
only:
variables:
- $NIGHTLY_MASTER
script:
- cd ${CI_PROJECT_DIR}/tester/Android
# uninstalling tester apps on device to prevent conflicts, but running anyway if there isn't some found.
- adb uninstall org.linphone.tester.test || true
- adb uninstall org.linphone.tester || true
# build of the testers
- ./gradlew assembleDebug
- ./gradlew assembleDebugAndroidTest
# gathering full trace of logcat in case of a coredump
- |
for x in `adb devices | sed -n '1!p' | sed '/^$/d' | awk '{print $1;}'`; do
adb -s $x logcat -c
adb -s $x logcat -v time > $x.txt &
echo $! > $x.pid
done
# Test launching
- |
java -jar ~/spoon.jar --output spoon --apk app/build/outputs/apk/debug/app-debug.apk \
--test-apk app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--class-name 'org.linphone.tester.AllTests' \
--fail-on-failure --fail-if-no-device-connected --grant-all || ( if [ $? -ne 0 ]
then
echo "Some tests are failed" && false
fi)
after_script:
#putting all the trace in the ndk stack txt file
- |
for x in `adb devices | sed -n '1!p' | sed '/^$/d' | awk '{print $1;}'`; do
cat tester/Android/$x.txt | ndk-stack -sym build/libs-debug/`adb -s $x shell getprop ro.product.cpu.abi | tr -d '\r'` > tester/Android/$x-ndk-stack.txt
done
#debugging output to see why the tests are failing in runner
- cat tester/Android/$x.txt
- tar zcvf tester/Android/logs-tests-android.tar.gz tester/Android/spoon/ tester/Android/*.txt
#Gathering artifacts in one folder to ease their use
- sudo mkdir ${CI_PROJECT_DIR}/results
- sudo chmod 777 ${CI_PROJECT_DIR}/results
- mv tester/Android/logs-tests-android.tar.gz ${CI_PROJECT_DIR}/results
artifacts:
paths:
- results/*
when: always
expire_in: 4 week
......@@ -62,8 +62,8 @@ job-android-upload:
script:
- git config --global user.email "gitlab@belledonne-communications.com"
- git config --global user.name "Gitlab"
- mkdir -p build-android
- cd build-android
- mkdir -p build
- cd build
- cmake .. -G "$CMAKE_GENERATOR" -DLINPHONESDK_PLATFORM=Android -DLINPHONESDK_ANDROID_ARCHS="arm64, armv7, x86_64, x86" $DEFAULT_LINUX_CMAKE_OPTIONS $CMAKE_OPTIONS
- cmake --build . --target sdk -- $ADDITIONAL_BUILD_OPTIONS
- rsync -ave ssh --exclude "*.aar" --exclude "*.jar" $ANDROID_MAVEN_URL maven_repository
......
FROM gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-android:r17c
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#installing usb tools (lsusb) and prompting authorization alert on device once and for all
RUN sudo apt-get install usbutils -y
RUN wget -O ~/spoon.jar "https://search.maven.org/remote_content?g=com.squareup.spoon&a=spoon-runner&v=LATEST&c=jar-with-dependencies"
\ No newline at end of file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone.tester"
android:sharedUserId="org.linphone.tester">
package="org.linphone.tester">
<instrumentation
android:name="androidx.test.runner.AndroidJUnitRunner"
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone.tester"
android:sharedUserId="org.linphone.tester">
package="org.linphone.tester">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
......@@ -32,4 +31,4 @@
</application>
</manifest>
\ No newline at end of file
</manifest>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment