Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description This PR updates the JSONPath mappings for resource groups. Fixes a regression introduced by #6191 ## Type of change <!-- Please select **one** of the following options that describes your change and delete the others. Clearly identifying the type of change you are making will help us review your PR faster, and is used in authoring release notes. If you are making a bug fix or functionality change to Radius and do not have an associated issue link please create one now. --> - This pull request fixes a bug in Radius and has an approved issue (issue link required). <!-- Please update the following to link the associated issue. This is required for some kinds of changes (see above). --> Fixes: #6249 ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 47c16a4</samp> ### Summary 🐛🧪📦 <!-- 1. 🐛 - This emoji represents a bug fix, which is what the JSONPath corrections are. 2. 🧪 - This emoji represents a test, which is what the new test case for the `list` command is. 3. 📦 - This emoji represents a package, which is what the imported packages for the test setup and output formatting are. --> Added a CLI test for listing resource groups and fixed JSONPath expressions for the output format. > _To fix the JSONPath expressions_ > _They used the right capitalizations_ > _They also wrote a test_ > _For the CLI list_ > _With mocks and some table creations_ ### Walkthrough * Correct the JSONPath expressions for the `ResourceGroupResource` struct in the `table` format options ([link](https://github.com/radius-project/radius/pull/6252/files?diff=unified&w=0#diff-f2e80353ac2e49da41bc04958b9568c662162f7dbb52ada2c328851436925482L81-R85)) * Import the `objectformats` and `to` packages to use the `GetResourceGroupTableFormat` function and the `to.Ptr` helper function in the `group list` command test ([link](https://github.com/radius-project/radius/pull/6252/files?diff=unified&w=0#diff-b6f63f3ed2aaeada863bd788b630879282e34fce2ad6672636ea677a37748853L27-R30)) * Create a mock API response with a slice of `ResourceGroupResource` objects in the `group list` command test ([link](https://github.com/radius-project/radius/pull/6252/files?diff=unified&w=0#diff-b6f63f3ed2aaeada863bd788b630879282e34fce2ad6672636ea677a37748853R107-R118)) * Define the expected output as a slice of `FormattedOutput` objects with the `table` format and the `GetResourceGroupTableFormat` options in the `group list` command test ([link](https://github.com/radius-project/radius/pull/6252/files?diff=unified&w=0#diff-b6f63f3ed2aaeada863bd788b630879282e34fce2ad6672636ea677a37748853R130-R138)) * Compare the expected output with the actual output from the `outputSink` in the `group list` command test ([link](https://github.com/radius-project/radius/pull/6252/files?diff=unified&w=0#diff-b6f63f3ed2aaeada863bd788b630879282e34fce2ad6672636ea677a37748853R130-R138))
- Loading branch information