File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
src/commonJvmLikeTest/kotlin/com/adamratzman/spotify Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,13 @@ jobs:
29
29
java-version : ' 11'
30
30
- name : Install curl
31
31
run : sudo apt-get install -y curl libcurl4-openssl-dev
32
- - name : Test secret
33
- run : echo "client id secret is $SPOTIFY_CLIENT_ID"
34
32
- name : Test android
35
33
run : ./gradlew testDebugUnitTest
36
34
- name : Test jvm
37
35
run : ./gradlew jvmTest
38
36
- name : Archive test results
39
37
uses : actions/upload-artifact@v2
38
+ if : always()
40
39
with :
41
40
name : code-coverage-report
42
41
path : build/reports
@@ -63,14 +62,13 @@ jobs:
63
62
java-version : ' 11'
64
63
- name : Install curl
65
64
run : sudo apt-get install -y curl libcurl4-openssl-dev
66
- - name : Test secret
67
- run : echo "client id secret is $SPOTIFY_CLIENT_ID"
68
65
- name : Test android
69
66
run : ./gradlew testDebugUnitTest
70
67
- name : Test jvm
71
68
run : ./gradlew jvmTest
72
69
- name : Archive test results
73
70
uses : actions/upload-artifact@v2
71
+ if : always()
74
72
with :
75
73
name : code-coverage-report
76
74
path : build/reports
Original file line number Diff line number Diff line change @@ -18,7 +18,19 @@ actual fun isHttpLoggingEnabled(): Boolean = System.getenv("SPOTIFY_LOG_HTTP") =
18
18
actual fun arePlayerTestsEnabled (): Boolean = System .getenv(" SPOTIFY_ENABLE_PLAYER_TESTS" )?.toBoolean() == true
19
19
actual fun areLivePkceTestsEnabled (): Boolean = System .getenv(" VERBOSE_TEST_ENABLED" )?.toBoolean() ? : false
20
20
21
+ var hasInstantiatedApi: Boolean = false
22
+ var backingApi: GenericSpotifyApi ? = null
23
+
21
24
actual suspend fun buildSpotifyApi (testClassQualifiedName : String , testName : String ): GenericSpotifyApi ? {
25
+ if (! hasInstantiatedApi) {
26
+ backingApi = buildSpotifyApiInternal()
27
+ hasInstantiatedApi = true
28
+ }
29
+
30
+ return backingApi;
31
+ }
32
+
33
+ private suspend fun buildSpotifyApiInternal (): GenericSpotifyApi ? {
22
34
val clientId = getTestClientId()
23
35
val clientSecret = getTestClientSecret()
24
36
val tokenString = getTestTokenString()
You can’t perform that action at this time.
0 commit comments