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 Integration Tests for User Sharing API #23329

Conversation

BimsaraBodaragama
Copy link
Member

@BimsaraBodaragama BimsaraBodaragama commented Mar 2, 2025

This PR introduces comprehensive integration tests for the User Sharing API, ensuring correctness in user sharing, unsharing, and verification through a successful GET request for a user's shared organizations and assigned shared roles to a shared user in a given organization. These tests validate request handling, response accuracy, and expected behavior across various valid and invalid scenarios, ensuring API reliability in standard usage.

Test Coverage:

✅ Successful Scenarios

  1. Selective User Sharing:
    • Covers single and multiple users across multiple organizations.
    • Validates all selective resource-sharing policies:
      • SELECTED_ORG_ONLY
      • SELECTED_ORG_WITH_ALL_EXISTING_CHILDREN_ONLY
      • SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN
      • SELECTED_ORG_WITH_EXISTING_IMMEDIATE_CHILDREN_ONLY
      • SELECTED_ORG_WITH_EXISTING_IMMEDIATE_AND_FUTURE_CHILDREN
  2. General User Sharing:
    • Covers single and multiple users.
    • Validates all general resource-sharing policies:
      • ALL_EXISTING_ORGS_ONLY
      • ALL_EXISTING_AND_FUTURE_ORGS
      • IMMEDIATE_EXISTING_ORGS_ONLY
      • IMMEDIATE_EXISTING_AND_FUTURE_ORGS
  3. General User Unsharing:
    • Covers single and multiple users.
  4. Selective User Unsharing:
    • Covers single and multiple users.
    • Covers single and multiple organizations.

Failure Scenarios

  1. Selective User Sharing:
    • Selective User Sharing with invalid roles (single and multiple invalid roles).
    • Selective User Sharing with invalid organizations (single and multiple invalid organizations).
    • Selective User Sharing with invalid users (single and multiple invalid users).
    • Selective User Sharing with conflicting users (user exists in a child organization under the same username).
    • Selective User Sharing with non-immediate child organizations.
  2. General User Sharing:
    • General User Sharing with invalid roles.
    • General User Sharing with invalid users.
    • General User Sharing with conflicting users.
  3. General User Unsharing:
    • General User Unsharing with invalid users (single and multiple invalid users).
  4. Selective User Unsharing:
    • Selective User Unsharing with invalid users and invalid organizations (single and multiple cases).
  5. Selective User Re-Sharing:
    • Invalid Selective User Re-sharing (a shared user from a parent org cannot be re-shared from a child org).
  6. General User Re-Sharing:
    • Invalid General User Re-sharing (a shared user from a parent org cannot be re-shared from a child org).

Related Issue

Add Integration Tests for User Sharing API #23328

@BimsaraBodaragama

This comment was marked as duplicate.

@BimsaraBodaragama
Copy link
Member Author

BimsaraBodaragama commented Mar 8, 2025

Integration Test Runner

Attempt 1

Integration Test Runner For this PR can be found here.
Status: Successful ✅

Attempt 2

Integration Test Runner For this PR can be found here.
Status: Successful ✅

Attempt 3

Integration Test Runner For this PR can be found here.
Status: Successful ✅

Attempt 4

Integration Test Runner For this PR can be found here.
Status: Successful ✅

Attempt 5

Integration Test Runner For this PR can be found here.
Status: Successful ✅

The integration test runner for this PR has been triggered and executed multiple times to ensure there are no intermittent test failures caused by awaiting the completion of asynchronous processes involved in these integration tests introduced in this PR.

@AnuradhaSK
Copy link
Contributor

Please squash the commits

@BimsaraBodaragama BimsaraBodaragama force-pushed the integration-tests/user-sharing-2 branch from a8a91fc to ee09a55 Compare March 11, 2025 09:12
@BimsaraBodaragama BimsaraBodaragama force-pushed the integration-tests/user-sharing-2 branch from ee09a55 to a578653 Compare March 11, 2025 09:16
@BimsaraBodaragama
Copy link
Member Author

BimsaraBodaragama commented Mar 11, 2025

The changes originally intended in this PR will now be tracked in a different PR: #23423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants