Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for Native Auth #1966

Merged
merged 25 commits into from
Dec 13, 2023
Merged

Add unit tests for Native Auth #1966

merged 25 commits into from
Dec 13, 2023

Conversation

SaurabhMSFT
Copy link
Contributor

This PR adds unit tests for Native Auth. No new dependency has been added.

SaurabhMSFT and others added 8 commits October 3, 2023 19:35
The code in this pull request is for the base work needed to support Signup, SignIn and SSPR features for Native Auth. Any class that is used by at least two of the features has been included in this pull request.

This pull request introduces kotlin co routines libraries as dependencies for msal and its associated test project. Further mockk, mockito libraries have been added as dependencies for test projects.

A companion PR in the MSAL Common repository is
AzureAD/microsoft-authentication-library-common-for-android#2166
ciam-feature will be update to 82f5153 commit of dev branch

---------

Co-authored-by: melissaahn <[email protected]>
Co-authored-by: iamgusain <[email protected]>
Co-authored-by: Dome Pongmongkol <[email protected]>
Co-authored-by: Sowmya Malayanur <[email protected]>
ciam-feature is updated to 991c541
commit from dev branch

---------

Co-authored-by: melissaahn <[email protected]>
Co-authored-by: iamgusain <[email protected]>
Co-authored-by: Dome Pongmongkol <[email protected]>
Co-authored-by: Sowmya Malayanur <[email protected]>
Co-authored-by: Mohit <[email protected]>
Co-authored-by: tanmaymanolkar1 <[email protected]>
Co-authored-by: amoyixi <[email protected]>
Co-authored-by: yixilin <[email protected]>
Co-authored-by: fadidurah <[email protected]>
Co-authored-by: Dean Xu <[email protected]>
This PR includes the work for SignIn relates features of Native Auth

Companion PR in MSAL Common repo is
AzureAD/microsoft-authentication-library-common-for-android#2207
This PR includes the work for Signup related features of Native Auth. No
new dependencies have been added as part of this PR.

A technical overview of Native Auth is available at
https://dev.azure.com/IdentityDivision/DevEx/_git/AuthLibrariesApiReview?path=/%5BAndroid%5D%20Native%20authentication/technical_overview.md&version=GBsammy/native-authentication&_a=preview

A companion PR in MSAL Common is
AzureAD/microsoft-authentication-library-common-for-android#2229
ciam-feature is updated to 9735ed9
commit from dev branch

---------

Co-authored-by: melissaahn <[email protected]>
Co-authored-by: iamgusain <[email protected]>
Co-authored-by: Dome Pongmongkol <[email protected]>
Co-authored-by: Sowmya Malayanur <[email protected]>
Co-authored-by: Mohit <[email protected]>
Co-authored-by: tanmaymanolkar1 <[email protected]>
Co-authored-by: amoyixi <[email protected]>
Co-authored-by: yixilin <[email protected]>
Co-authored-by: fadidurah <[email protected]>
Co-authored-by: Dean Xu <[email protected]>
Co-authored-by: Neha Goel <[email protected]>
Co-authored-by: Dome Pongmongkol <[email protected]>
Co-authored-by: pedro romero vargas <[email protected]>
This PR includes the work for self service password reset related
features of Native Auth. No new dependencies have been added as part of
this PR.

A technical overview of Native Auth is available at
https://dev.azure.com/IdentityDivision/DevEx/_git/AuthLibrariesApiReview?path=/%5BAndroid%5D%20Native%20authentication/technical_overview.md&version=GBsammy/native-authentication&_a=preview

A companion PR in MSAL is
AzureAD/microsoft-authentication-library-common-for-android#2230
@github-actions github-actions bot added the msal label Nov 30, 2023
@SaurabhMSFT SaurabhMSFT marked this pull request as ready for review December 1, 2023 16:17
@SaurabhMSFT SaurabhMSFT requested a review from a team as a code owner December 1, 2023 16:17
@SaurabhMSFT SaurabhMSFT changed the base branch from ciam-feature to dev December 8, 2023 11:56
@SaurabhMSFT SaurabhMSFT added the No-Changelog This change does not update the changelog. label Dec 8, 2023
@SaurabhMSFT SaurabhMSFT requested a review from a team as a code owner December 13, 2023 11:36
@@ -842,6 +842,8 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
null,
null
);
} catch (MsalException e) {
Copy link
Contributor Author

@SaurabhMSFT SaurabhMSFT Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MsalException is a type of BaseException. The below clause was converting all MsalExceptions into unknown MsalException.

// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package com.microsoft.identity.client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in dedicated native auth folder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and we should update code owners with this path

@@ -62,7 +62,13 @@ jobs:
- task: Gradle@2
displayName: Run Unit tests
inputs:
tasks: msal:testLocalDebugUnitTest -Plabtest -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}}
tasks: msal:testLocalDebugUnitTest -Plabtest -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} --tests *com.microsoft.identity.client*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahzaibj and @fadidurah can you review this? As this is a change to your test configuration, CI, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen --tests used before, but i'm guessing you're just spliting the test suite into native auth and non-native auth, which seems fine to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this runs tests in the specified package.

@SaurabhMSFT SaurabhMSFT merged commit 26656d8 into dev Dec 13, 2023
9 checks passed
@SaurabhMSFT SaurabhMSFT deleted the saugautam/2642915 branch December 13, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal No-Changelog This change does not update the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants