Commit Graph

5 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 36b668020b fix(tests): fix OAuth integration tests failing due to Docker registry timeout
The mock_oauth_server session fixture tried to pull ghcr.io/navikt/mock-oauth2-server:2.1.1
from Docker, which times out in sandboxed CI, causing all 14 OAuth integration tests to ERROR.

Changes to tests/conftest_oauth.py:
- mock_oauth_server: catch container startup exceptions, attempt cleanup, yield None
  instead of propagating (static fallback config is used instead)
- oauth_config: add elif mock_oauth_server is None branch returning a static hardcoded
  config (mode="static") using module-level URL constants
- oauth_enabled_app: use authorize_url/access_token_url directly (no HTTP metadata
  discovery), clear/restore authlib _clients/_registry cache per test, add cleanup in teardown
- Extract _STATIC_OAUTH_* constants to avoid URL duplication

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 14:21:58 +00:00
copilot-swe-agent[bot] 43bc58770d refactor: consolidate linting tools into Ruff
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-13 09:10:52 +00:00
copilot-swe-agent[bot] 459e9fafc7 fix(test): fix OAuth integration tests and auth redirect status code
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 13:17:26 +00:00
copilot-swe-agent[bot] 604facf36f fix(test): fix task __wrapped__ calls, auth imports, mock chains, async markers, and rate limit mock
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 13:03:26 +00:00
copilot-swe-agent[bot] 94daf9b2fe test: implement mock OAuth2 server infrastructure for auth testing
- Add MockOAuth2ServerContainer using testcontainers
- Create conftest_oauth.py with OAuth test fixtures
- Add comprehensive OAuth integration tests
- Support both mock (default) and real (CI secrets) OAuth modes
- Add documentation for OAuth testing setup

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 11:09:37 +00:00