Skip to content

Shore up multi tenant tests #4484

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

Merged
merged 6 commits into from
Apr 14, 2025
Merged

Shore up multi tenant tests #4484

merged 6 commits into from
Apr 14, 2025

Conversation

pablonyx
Copy link
Contributor

@pablonyx pablonyx commented Apr 9, 2025

Description

Fixes https://linear.app/danswer/issue/DAN-1770/testing-for-cloud-flows

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Copy link

vercel bot commented Apr 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2025 5:55pm

@pablonyx pablonyx marked this pull request as ready for review April 9, 2025 00:13
@pablonyx pablonyx requested a review from a team as a code owner April 9, 2025 00:13
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances multi-tenant tests by improving organization and clarity while introducing helper functions for shared setup. It also adds debugging prints that risk exposing sensitive data and may cause unintended behavior.

  • /backend/tests/integration/common_utils/managers/chat.py: Added prints for headers and cookies; risk if user_performing_action is None and exposing sensitive data.
  • /backend/ee/onyx/server/middleware/tenant_tracking.py: Introduced debug prints and a problematic finally block that overrides intended returns.
  • /backend/tests/integration/multitenant_tests/invitation/test_user_invitation.py: Split invitation tests for better separation of roles and flows.
  • /backend/tests/integration/multitenant_tests/syncing/test_search_permissions.py: Moved common tenant setup into a helper; ensure reset_multitenant isolates concurrent runs.
  • /backend/tests/integration/multitenant_tests/tenants/test_tenant_creation.py: Expanded tenant creation tests; consider unique identifiers to avoid collisions.

5 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@evan-danswer evan-danswer left a comment

Choose a reason for hiding this comment

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

some nits!

@@ -130,6 +128,7 @@ export function LLMProviderUpdateForm({
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={async (values, { setSubmitting }) => {
alert("onSubmit");
Copy link
Contributor

Choose a reason for hiding this comment

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

leftover alert?

</>
)}

{/* NOTE: this is above the test button to make sure it's visible */}
{testError && <Text className="text-error mt-2">{testError}</Text>}

<div className="flex w-full mt-4">
<Button type="submit" variant="submit">
<Button
onClick={() => alert(JSON.stringify(formikProps.errors))}
Copy link
Contributor

Choose a reason for hiding this comment

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

intentional alert? or no

@pablonyx pablonyx added this pull request to the merge queue Apr 14, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 14, 2025
* update

* fix

* finalize`

* remove unnecessary prints

* fix
@pablonyx pablonyx removed this pull request from the merge queue due to a manual request Apr 14, 2025
@pablonyx pablonyx enabled auto-merge April 14, 2025 17:52
@pablonyx pablonyx added this pull request to the merge queue Apr 14, 2025
Merged via the queue into main with commit e572ce9 Apr 14, 2025
10 of 11 checks passed
@pablonyx pablonyx deleted the shore_up_multitenant branch April 14, 2025 19:14
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.

2 participants