diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index a7acd6c6c6..64b71c65fe 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -9,7 +9,7 @@ on: # Run the native libraries first so that the native, Hybrid and React MobileSync tests # don't run simultaniously (to prevents flappers). jobs: - android-nightly-core: + android-nightly: strategy: fail-fast: false matrix: @@ -20,7 +20,7 @@ jobs: secrets: inherit android-nightly-Hybrid: if: success() || failure() - needs: [android-nightly-core] + needs: [android-nightly] strategy: fail-fast: false matrix: diff --git a/.github/workflows/reusable-workflow.yaml b/.github/workflows/reusable-workflow.yaml index 75e2e1b300..89c905ecb1 100644 --- a/.github/workflows/reusable-workflow.yaml +++ b/.github/workflows/reusable-workflow.yaml @@ -168,8 +168,13 @@ jobs: gsutil ls ${BUCKET_PATH} > /dev/null 2>&1 if [ $? == 0 ] ; then - # Copy merged XML file from top level for test reporting - gsutil cp "${BUCKET_PATH}/*test_results_merged.xml" firebase_results/api_${LEVEL}_test_result.xml + # Copy XML file for test reporting + if gsutil ls "${BUCKET_PATH}/*test_results_merged.xml" > /dev/null 2>&1; then + # Sharded runs produce test_results_merged.xml at top level + gsutil cp "${BUCKET_PATH}/*test_results_merged.xml" firebase_results/api_${LEVEL}_test_result.xml + else + gsutil cp "${BUCKET_PATH}/*/test_result_1.xml" firebase_results/api_${LEVEL}_test_result.xml + fi # Copy all shard data for code coverage (only needed for one level) if [ "$LEVEL" == "$PR_API_VERSION" ] ; then diff --git a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/LoginViewModelMockTest.kt b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/LoginViewModelMockTest.kt index 0e8d772a06..8d3e4f78f6 100644 --- a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/LoginViewModelMockTest.kt +++ b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/LoginViewModelMockTest.kt @@ -73,6 +73,10 @@ class LoginViewModelMockTest { mockCookieManager = mockk(relaxed = true) every { CookieManager.getInstance() } returns mockCookieManager + // Mock OAuth2 and AuthenticationUtilities + mockkStatic(OAuth2::class) + mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") + // Create view model after mocking viewModel = LoginViewModel(bootConfig) @@ -94,7 +98,6 @@ class LoginViewModelMockTest { @Test fun onAuthFlowComplete_CallsAuthenticationUtilities_WithCorrectParameters() = runBlocking { // Mock the AuthenticationUtilities.onAuthFlowComplete function - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") // Mock the function to do nothing (just capture parameters) coEvery { @@ -163,7 +166,6 @@ class LoginViewModelMockTest { @Test fun onAuthFlowComplete_CallsAuthenticationUtilitiesSuccessfully() = runBlocking { // Mock the AuthenticationUtilities.onAuthFlowComplete function - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") coEvery { onAuthFlowComplete( @@ -230,7 +232,6 @@ class LoginViewModelMockTest { @Test fun onAuthFlowComplete_ResetsAuthCodeForJwtFlow() = runBlocking { // Mock the AuthenticationUtilities.onAuthFlowComplete function - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") coEvery { onAuthFlowComplete( @@ -278,7 +279,6 @@ class LoginViewModelMockTest { @Test fun onAuthFlowComplete_UsesEmptyString_WhenSelectedServerIsNull() = runBlocking { // Mock the AuthenticationUtilities.onAuthFlowComplete function - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") coEvery { onAuthFlowComplete( @@ -343,9 +343,6 @@ class LoginViewModelMockTest { @Test fun doCodeExchange_CallsExchangeCode_WithCorrectParameters() = runBlocking { - // Mock OAuth2.exchangeCode - mockkStatic(OAuth2::class) - val testServer = "https://test.salesforce.com" val testCode = "test_auth_code_123" val mockTokenResponse = mockk(relaxed = true) @@ -353,7 +350,6 @@ class LoginViewModelMockTest { val mockOnSuccess: (UserAccount) -> Unit = mockk(relaxed = true) // Mock AuthenticationUtilities.onAuthFlowComplete to prevent actual execution - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") coEvery { onAuthFlowComplete( tokenResponse = any(), @@ -408,9 +404,6 @@ class LoginViewModelMockTest { @Test fun doCodeExchange_WithFrontDoorBridge_UsesCorrectServerAndVerifier() = runBlocking { - // Mock OAuth2.exchangeCode - mockkStatic(OAuth2::class) - val frontDoorServer = "https://frontdoor.salesforce.com" val frontDoorUrl = "$frontDoorServer/frontdoor.jsp?sid=test_session" val frontDoorVerifier = "frontdoor_verifier_789" @@ -420,7 +413,6 @@ class LoginViewModelMockTest { val mockOnSuccess: (UserAccount) -> Unit = mockk(relaxed = true) // Mock AuthenticationUtilities.onAuthFlowComplete - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") coEvery { onAuthFlowComplete( tokenResponse = any(), @@ -482,16 +474,12 @@ class LoginViewModelMockTest { @Test fun doCodeExchange_WithNullCode_PassesNullToExchangeCode() = runBlocking { - // Mock OAuth2.exchangeCode - mockkStatic(OAuth2::class) - val testServer = "https://test.salesforce.com" val mockTokenResponse = mockk(relaxed = true) val mockOnError: (String, String?, Throwable?) -> Unit = mockk(relaxed = true) val mockOnSuccess: (UserAccount) -> Unit = mockk(relaxed = true) // Mock AuthenticationUtilities.onAuthFlowComplete - mockkStatic("com.salesforce.androidsdk.auth.AuthenticationUtilitiesKt") coEvery { onAuthFlowComplete( tokenResponse = any(),