Skip to content

Update e2e tests for premium license#176

Merged
bears4barrett merged 23 commits intomainfrom
ENG-1073/premium-e2e-tests-update
Sep 22, 2025
Merged

Update e2e tests for premium license#176
bears4barrett merged 23 commits intomainfrom
ENG-1073/premium-e2e-tests-update

Conversation

@bears4barrett
Copy link
Copy Markdown
Contributor

@bears4barrett bears4barrett commented Sep 19, 2025

This PR updates the e2e test environment to premium license. This is to support further e2e tests that relate to multiple users, resource sharing, as well as other premium features.

The most notable change from free license to premium is an initial "anonymous" user no longer exists. This PR handles the initial user with a new api/auth/test/login endpoint to simulate a new user login without the need to go through OIDC flow or third party OAuth. This new endpoint is for test purposes only and results in 404 unless the explicit ENABLE_TEST_LOGIN_ENDPOINT env var is set to true.

Playwright config has been updated to handle login, then initial setup (telemetry consent & data source), then run the tests. This improves the one time flows and removes the need to handle them in each subsequent test. It also improves the test run speed for not waiting on these steps reoccurring in every test.

In addition I have update playwright config to run the tests in parallel to speed up the test suite.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @bears4barrett, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request transitions the end-to-end testing environment to a premium license configuration, which is crucial for developing and validating features related to multiple users and resource sharing. The core change involves introducing a new, test-specific API endpoint to simulate user logins, thereby replacing the previous anonymous user setup and streamlining the authentication process for e2e tests.

Highlights

  • Premium License E2E Environment: The e2e test environment has been upgraded to simulate a premium license setup, enabling future tests for multi-user and resource sharing features.
  • New Test Login Endpoint: A dedicated "api/auth/test/login" endpoint was added, exclusively for testing, to simulate user login and bypass OIDC/OAuth flows, addressing the absence of an initial "anonymous" user in premium environments.
  • Updated E2E Setup: Existing e2e tests now integrate this new login mechanism into their "performInitialSetup" routine, ensuring a consistent and authenticated starting state for premium-specific tests.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a test-only login endpoint to support e2e tests with a premium license, which no longer has an anonymous user. The changes are well-structured, with a new API route for test logins and updates to Playwright test helpers to use it. I've identified a potential race condition and a logic inconsistency in the new test login endpoint, along with a minor point for code cleanup. Overall, this is a good step towards improving the e2e test suite for premium features.

Comment thread app/api/auth/test/login/route.ts Outdated
Comment thread app/api/auth/test/login/route.ts
Comment thread tests/e2e/setup/initial-data-source.ts Outdated
Comment thread tests/e2e/playwright.config.ts
Comment thread .gitignore Outdated
@bears4barrett bears4barrett merged commit f532bca into main Sep 22, 2025
5 checks passed
@bears4barrett bears4barrett deleted the ENG-1073/premium-e2e-tests-update branch September 22, 2025 17:55
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.

3 participants