Repository navigation
test: improve coverage for auth and resource commands - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are we changing this?
The CLI had very low automated coverage in the auth/config/resource command layers, which made it hard to trust behavior without rerunning manual checks. While raising that baseline, a real issue also surfaced:
omni doctorwas routed incorrectly and printed usage instead of executing.What has changed?
doctor,folders,user-attributes,users, andscim.Executerouting soomni doctorruns without requiring a fake subcommand.How to test it and expected results?
Run
go test ./....Expected: all test packages pass.
Run
go test ./... -coverprofile=/tmp/omni-cover.outandgo tool cover -func=/tmp/omni-cover.out | tail -n 1.Expected: overall statement coverage reports
8.1%.Run
./bin/omni --json doctoragainst a configured org-auth profile.Expected: the command executes and returns a health summary instead of printing usage.
Run
./bin/omni --json folders list,./bin/omni --json user-attributes list,./bin/omni --json users list-email-only --page-size 20, and./bin/omni --json scim users list --count 20against the sandbox.Expected: each command returns valid JSON responses.
Checklist: