Skip to content

Conversation

@dittops
Copy link
Member

@dittops dittops commented Dec 29, 2025

Summary

  • Add comprehensive E2E test suite for budapp authentication flows
  • Implement test infrastructure with k3d cluster support and pytest fixtures
  • Create reusable auth helpers and assertion utilities
  • Cover login/logout, registration, token refresh, password reset, and protected endpoints
  • Add user profile data verification tests after registration
  • Update rate limiter to support disabling via RATE_LIMIT_ENABLED config

Test Coverage

  • 67 tests passing, 7 skipped (notification-dependent flows)
  • Login flows with valid/invalid credentials
  • Registration with data validation and duplicate prevention
  • Token refresh mechanics and expiration handling
  • Protected endpoint access control
  • User profile verification after registration

Files Added/Modified

  • tests/e2e/ - Complete E2E test infrastructure
  • services/budapp/budapp/commons/config.py - Added rate_limit_enabled setting
  • services/budapp/budapp/commons/rate_limiter.py - Support disabling rate limits for tests

Test Plan

  • All auth flow tests pass locally
  • Tests handle nested API response structures
  • Rate limiting can be disabled for test environments
  • Proper .gitignore files to exclude test artifacts

🤖 Generated with Claude Code

Add comprehensive E2E test suite for budapp authentication:

- Login/logout flows with token validation
- User registration with data verification
- Token refresh mechanics
- Password reset flows
- Protected endpoint access control
- User profile data verification after registration

Infrastructure:
- k3d/kind cluster setup scripts
- Helm values for E2E environment
- Dapr component configurations
- pytest fixtures and helpers

Also adds RATE_LIMIT_ENABLED config to budapp for disabling
rate limiting in test environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dittops, 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 introduces a new, comprehensive end-to-end (E2E) test suite for the budapp's authentication flows. The primary goal is to ensure the reliability and correctness of user authentication mechanisms across various deployment environments, including Kubernetes clusters and local Docker setups. This enhancement significantly improves the confidence in the core user access functionalities by validating complete user journeys and critical security aspects like token management and rate limiting.

Highlights

  • Comprehensive E2E Test Suite: Introduced a new end-to-end (E2E) test suite specifically designed to validate the entire authentication flow of the budapp service. This suite covers critical user journeys from registration to protected endpoint access.
  • Robust Test Infrastructure: Implemented a flexible test infrastructure supporting k3d, Kind, and existing Kubernetes clusters, along with a Docker Compose option for lightweight local iteration. This includes dedicated Dapr configurations and Helm value overrides for E2E environments.
  • Authentication Flow Coverage: The E2E tests cover key authentication scenarios including user registration, login (valid/invalid credentials, remember_me, first login), token refresh, logout (token blacklisting), password reset, and access to protected endpoints with various token states.
  • Reusable Test Helpers and Fixtures: Developed a set of reusable pytest fixtures and helper utilities for authentication, API client interactions, and common assertions, streamlining the process of writing new E2E tests.
  • Rate Limiter Configuration: Modified the application's rate limiter to allow disabling it via a RATE_LIMIT_ENABLED configuration, which is crucial for preventing test flakiness and ensuring consistent test execution in E2E environments.
  • User Profile Data Verification: Added specific tests to verify that user profile data, including ID, email, name, role, and status, is correctly stored and retrieved after registration and authentication.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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
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 comprehensive and well-structured E2E test suite for authentication flows. The test infrastructure is robust, with support for k3d, Kind, and existing Kubernetes clusters, which greatly improves developer experience. The tests themselves are thorough, covering positive and negative paths, validation, and security aspects like rate limiting and privilege escalation. The use of helper classes and fixtures makes the tests clean and maintainable.

I've identified a few areas for improvement, mainly around configuration and dependency management to enhance stability and reproducibility. This includes pinning Docker image versions for Dapr, specifying the Kind node image version, fixing a placeholder for a crypto key, and pinning Python dependencies.

Overall, this is an excellent contribution that significantly improves the testing story for the project.

Comment on lines +383 to +387
asymmetricKey: |
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA0Z3VS5JJcds3xfn/ygWyF8PbnGy0AHB7MvGj2yDryPEut5hy
e2e-test-asymmetric-key-placeholder
-----END RSA PRIVATE KEY-----
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The asymmetricKey for Dapr crypto contains a placeholder value. This will cause a failure when Dapr attempts to use it for encryption. Please replace the placeholder with a valid, test-only RSA private key. You can generate one for testing purposes.

Comment on lines +72 to +81
image: daprio/placement:edge
container_name: e2e-placement
command: ["./placement", "--port", "50006"]
ports:
- "50006:50006"
networks:
- e2e-network

e2e-scheduler:
image: daprio/dapr
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better stability and reproducibility of the test environment, it's recommended to pin the Dapr images to specific versions instead of using :edge or an implicit :latest. Using floating tags can introduce unexpected changes and cause test flakiness. The same applies to the daprio/daprd:edge image on line 181.

For example:

  e2e-placement:
    image: daprio/placement:1.13.2
    ...
  e2e-scheduler:
    image: daprio/dapr:1.13.2
    ...

And for the sidecar:

  e2e-budapp-sidecar:
    image: daprio/daprd:1.13.2
    ...

Please use the Dapr version that matches the one being used in production or development.

Comment on lines +9 to +10
nodes:
- role: control-plane
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To ensure a reproducible test environment, it's a good practice to pin the Kubernetes version for the Kind cluster. You can do this by specifying an image for the node.

nodes:
  - role: control-plane
    image: kindest/node:v1.28.0

Comment on lines +51 to +54
"redis_url": os.getenv(
"E2E_REDIS_URL",
"redis://default:e2e-redis-password@localhost:30379/2"
),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The Redis password is hardcoded in the default redis_url. It's better to construct this URL from environment variables to keep configuration consistent and flexible, especially since other credentials are being loaded from the environment. For example, you could introduce E2E_REDIS_PASSWORD in your .env.e2e.sample and use it to build the default URL.

Comment on lines +1 to +44
# E2E Test Dependencies

# Core testing
pytest>=7.4.0
pytest-asyncio>=0.21.0
pytest-timeout>=2.1.0
pytest-xdist>=3.3.0
pytest-html>=4.0.0
pytest-cov>=4.1.0
pytest-mock>=3.11.0

# HTTP clients
httpx>=0.24.0
aiohttp>=3.8.0

# Data generation
faker>=19.0.0

# Database clients
asyncpg>=0.28.0
psycopg2-binary>=2.9.0
redis>=4.6.0
clickhouse-driver>=0.2.6

# Utilities
tenacity>=8.2.0 # Retry logic
python-dotenv>=1.0.0 # Environment variables
pydantic>=2.0.0 # Data validation
pyyaml>=6.0 # YAML parsing

# Dapr SDK
dapr>=1.12.0

# Date/time utilities
python-dateutil>=2.8.0

# JSON utilities
orjson>=3.9.0

# Reporting
pytest-json-report>=1.5.0

# Development
ipdb>=0.13.0 # Debugging
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The dependencies in this file are not pinned to specific versions (e.g., pytest>=7.4.0). This can lead to non-reproducible builds and test environments, as pip install might pull newer, potentially breaking versions of these packages. It is a best practice to pin dependencies to exact versions (e.g., pytest==7.4.0). Consider using a tool like pip-compile from pip-tools to manage your dependencies and generate a fully pinned requirements.txt file.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +113 to +117
environment:
APP_NAME: budapp
NAMESPACE: e2e
LOG_LEVEL: DEBUG
APP_PORT: "9081"

Choose a reason for hiding this comment

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

P1 Badge Docker-compose E2E env still enforces auth rate limits

The new RATE_LIMIT_ENABLED flag is only wired into the Helm E2E values; the Docker Compose E2E stack leaves the budapp container with rate limiting enabled. The auth suite registers and logs in many users (e.g., multiple uses of registered_user across the P0 auth tests), so the 3 registrations/10 minutes and 10 logins/minute decorators will start returning 429s long before the suite finishes when running against the compose setup. To keep the compose workflow usable for the advertised “lightweight” E2E run, the compose service needs RATE_LIMIT_ENABLED=false (or an equivalent override) the same way the Helm values do.

Useful? React with 👍 / 👎.

Add comprehensive E2E tests for model registry workflows:
- Cloud model onboarding workflow (multi-step)
- Local model onboarding workflow (async with polling)
- Model edit operations (name, description, tags, URLs)
- Model delete operations (soft delete)
- Model listing and search
- Provider listing and filtering

Test infrastructure:
- ModelHelper class with workflow management
- Model fixtures and data generators
- Proper handling of permission errors (MODEL_VIEW, MODEL_MANAGE)
- Correct modality values (text_input/text_output)
- Added 'models' marker for test filtering

Test results: 89 passed, 35 skipped
- Skipped tests due to permission requirements (expected for regular users)
- Tests will pass with users having MODEL_MANAGE/MODEL_VIEW permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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