-
Notifications
You must be signed in to change notification settings - Fork 8
fix: validate scope checks ran and report overall test status #80
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
base: main
Are you sure you want to change the base?
Conversation
- Add FAILURE checks to scope scenarios when authorization flow doesn't complete (ScopeFromWwwAuthenticateScenario, ScopeFromScopesSupportedScenario, ScopeOmittedWhenUndefinedScenario) - Report client timeout and exit errors in test results - Add OVERALL: PASSED/FAILED summary at end of test output - Exit with code 1 on any failure (check failures, client timeout, or exit error) Previously, if the OAuth authorization flow didn't complete, the scope checks were never triggered and the test would incorrectly report success. Now these scenarios emit a FAILURE if the expected scope check wasn't recorded. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
commit: |
Warnings now contribute to the overall failure status, causing the test to exit with code 1 when any warnings are present. Also displays warning checks in the output summary, similar to how failures are displayed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Update the suite summary to show ✗ for scenarios with warnings, and exit with code 1 if any warnings are present across the suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
felixweinberger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me parece bien
| (c) => c.id === 'scope-from-www-authenticate' | ||
| ); | ||
| if (!hasScopeCheck) { | ||
| this.checks.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: mutations in a getSomething might be slightly weird, but I deduplication above makes it idempotent at least.
| const { overallFailure } = printClientResults( | ||
| result.checks, | ||
| verbose, | ||
| result.clientOutput |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more of a suggestion: IIUC we're only showing these output summaries for single scenarios, could consider doing that for test suites as well.
Summary
Problem
Previously, if the OAuth authorization flow didn't complete (e.g., client timed out or exited with an error before the authorization request reached the server), the scope checks were never triggered and the test would incorrectly report success like "Passed: 6/6, 0 failed".
Solution
The following scope scenarios now emit a FAILURE if their expected scope check wasn't recorded:
ScopeFromWwwAuthenticateScenarioScopeFromScopesSupportedScenarioScopeOmittedWhenUndefinedScenarioAdditionally,
printClientResultsnow:clientOutputto check for timeout/exit errorsoverallFailureboolean for proper exit codeExample output (failure case)
🤖 Generated with Claude Code