create a test for the last commit in this branch
- User
create a test for the last commit in this branch
Assistant
Let me first look at the last commit to understand what was changed.
Assistant
Now let me check for existing tests in this package.
Assistant
Now let me look at the YAML config types to understand
ToServerConfigbetter.Assistant
Good, now I have a clear picture. The commit adds
ContinueOnConnectorFailure: truein two places:NewProvider(direct config) - line 106buildDexConfig(YAML-based config) - line 264
Let me write the test.
Assistant
Now I need to add the
"log/slog"import sinceTestBuildDexConfig_ContinueOnConnectorFailureusesslogdirectly.Assistant
Now let me run the new tests to make sure they pass.
Assistant
Both tests pass. Here's what I added to
idp/dex/provider_test.go:TestNewProvider_ContinueOnConnectorFailure— Verifies thatNewProvider(direct config path) creates a functional provider. This exercises the code path whereContinueOnConnectorFailure: truewas added at line 106.TestBuildDexConfig_ContinueOnConnectorFailure— Directly tests thebuildDexConfigfunction (YAML config path) and asserts thatcfg.ContinueOnConnectorFailureistrue. This covers the change at line 264 and is the key assertion: management should start even when an external IdP is down.- User
generate a short PR description for this fix
Assistant
Here's a short PR description:
Summary
- Set
ContinueOnConnectorFailure: truein the embedded Dex config so that the Management server starts successfully even when an external IdP connector is unreachable at boot time.
Test plan
- Added
TestNewProvider_ContinueOnConnectorFailure— verifies the direct config path creates a working provider - Added
TestBuildDexConfig_ContinueOnConnectorFailure— asserts the YAML config path sets the flag totrue
- Set