This repository was archived by the owner on Jan 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +64
-14
lines changed
src/test/java/com/algolia/search/saas Expand file tree Collapse file tree 7 files changed +64
-14
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,16 @@ proguard/
43
43
# Temporary files
44
44
* .bak
45
45
* .tmp
46
+
47
+ # fastlane specific
48
+ fastlane /report.xml
49
+
50
+ # deliver temporary files
51
+ fastlane /Preview.html
52
+
53
+ # snapshot generated screenshots
54
+ fastlane /screenshots
55
+
56
+ # scan temporary files
57
+ fastlane /test_output /
58
+ fastlane /README.md
Original file line number Diff line number Diff line change 40
40
- $HOME/.gradle/daemon
41
41
- $HOME/.gradle/native
42
42
- $HOME/.gradle/wrapper
43
+ install : true
43
44
before_script :
44
45
# Avoid useless reupload of cache after every build, see https://docs.travis-ci.com/user/languages/android
45
46
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
@@ -49,6 +50,7 @@ before_script:
49
50
- emulator -avd test -no-skin -no-window &
50
51
- android-wait-for-emulator
51
52
- adb shell input keyevent 82 &
53
+
52
54
script :
53
55
- set -o pipefail
54
56
- travis_wait bash run_test.sh
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ android {
41
41
versionName PUBLISH_VERSION
42
42
}
43
43
buildTypes {
44
+ all {
45
+ buildConfigField " String" , " ALGOLIA_APPLICATION_ID" , " \" $System . env . ALGOLIA_APPLICATION_ID \" "
46
+ buildConfigField " String" , " ALGOLIA_API_KEY" , " \" $System . env . ALGOLIA_API_KEY \" "
47
+ buildConfigField " String" , " PLACES_APPLICATION_ID" , " \" $System . env . PLACES_APPLICATION_ID \" "
48
+ buildConfigField " String" , " PLACES_API_KEY" , " \" $System . env . PLACES_API_KEY \" "
49
+ }
44
50
release {
45
51
minifyEnabled false
46
52
proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
@@ -170,6 +176,13 @@ task testUploadArchives(type: Upload) {
170
176
}
171
177
}
172
178
179
+ // Logging the tests
180
+ tasks. withType(Test ) {
181
+ testLogging {
182
+ events " started" , " passed" , " skipped" , " failed"
183
+ }
184
+ }
185
+
173
186
// Edit the Maven POM.
174
187
//
175
188
// NOTE: This function is meant to factorize POM generation between the built-in `uploadArchives` and the custom
Original file line number Diff line number Diff line change 25
25
26
26
import android .support .annotation .NonNull ;
27
27
import java .util .Arrays ;
28
+ import com .algolia .search .saas .android .BuildConfig ;
29
+ import java .util .UUID ;
28
30
29
31
public class Helpers {
30
- public static String app_id = "%ALGOLIA_APPLICATION_ID%" ;
31
- public static String api_key = "%ALGOLIA_API_KEY%" ;
32
- public static String PLACES_APP_ID = "%PLACES_APPLICATION_ID%" ;
33
- public static String PLACES_API_KEY = "%PLACES_API_KEY%" ;
34
- public static String job_number = "%JOB_NUMBER%" ;
32
+ public static String app_id = BuildConfig .ALGOLIA_APPLICATION_ID ;
33
+ public static String api_key = BuildConfig .ALGOLIA_API_KEY ;
34
+ public static String PLACES_APP_ID = BuildConfig .PLACES_APPLICATION_ID ;
35
+ public static String PLACES_API_KEY = BuildConfig .PLACES_API_KEY ;
35
36
36
37
public static int wait = 30 ;
37
38
@@ -43,10 +44,7 @@ static String getLongApiKey() {
43
44
}
44
45
45
46
static String safeIndexName (String name ) {
46
- if (job_number .matches ("\\ d+\\ .\\ d+" )) {
47
- name = String .format ("%s_travis-%s" , name , job_number );
48
- }
49
- return name ;
47
+ return name + UUID .randomUUID ();
50
48
}
51
49
52
50
/**
Original file line number Diff line number Diff line change
1
+
2
+ actions_path 'actions/'
3
+ fastlane_version "2.61.0"
4
+ default_platform :android
5
+
6
+ platform :android do
7
+ desc "Runs all the tests"
8
+ lane :test do
9
+ gradle (
10
+ task : "test" ,
11
+ build_type : "Release"
12
+ )
13
+ end
14
+
15
+ #desc "Deploy the library. Available options: type:major|minor|patch optional: branch:YOUR_BRANCH notest:true|false (default false)"
16
+ desc "Deploy the library. Available options: optional: branch:YOUR_BRANCH (default master)"
17
+ lane :deploy do |options |
18
+ branch = options [ :branch ] || "master"
19
+ prepare_git ( branch )
20
+ sh ( "./release.sh" )
21
+ end
22
+
23
+ end
24
+
25
+ def prepare_git ( branch )
26
+ ensure_git_status_clean
27
+ ensure_git_branch ( branch :branch )
28
+ git_pull
29
+ end
Original file line number Diff line number Diff line change 3
3
set -e
4
4
set -o pipefail
5
5
6
- FILE=algoliasearch/src/test/java/com/algolia/search/saas/Helpers.java
7
- export FILE
8
-
9
6
my_travis_retry () {
10
7
local result=0
11
8
local count=1
@@ -43,6 +40,4 @@ if ! [[ $TRAVIS_JOB_NUMBER && ${TRAVIS_JOB_NUMBER-_} ]]; then
43
40
fi
44
41
45
42
echo " Running Android test..."
46
- ./setup_tests.sh
47
43
$RETRY ./gradlew testRelease
48
- ./teardown_tests.sh
You can’t perform that action at this time.
0 commit comments