Skip to content
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

Fix rad group show and rad group list #6252

Merged
merged 7 commits into from
Oct 5, 2023
Merged

Conversation

AaronCrawfis
Copy link
Contributor

@AaronCrawfis AaronCrawfis commented Sep 11, 2023

Description

This PR updates the JSONPath mappings for resource groups. Fixes a regression introduced by #6191

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).

Fixes: #6249

Auto-generated summary

🤖 Generated by Copilot at 47c16a4

Summary

🐛🧪📦

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)
  • Import the objectformats and to packages to use the GetResourceGroupTableFormat function and the to.Ptr helper function in the group list command test (link)
  • Create a mock API response with a slice of ResourceGroupResource objects in the group list command test (link)
  • 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)
  • Compare the expected output with the actual output from the outputSink in the group list command test (link)

@AaronCrawfis AaronCrawfis requested a review from a team as a code owner September 11, 2023 19:48
@github-actions
Copy link

github-actions bot commented Sep 11, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref refs/pull/6252/merge
Unique ID d9ec01f0c5
Image tag pr-d9ec01f0c5
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.11.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location radiusdev.azurecr.io/test/functional/shared/recipes/<name>:pr-d9ec01f0c5
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-d9ec01f0c5
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-d9ec01f0c5
  • deployment-engine test image location: radius.azurecr.io/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp functional tests...
⌛ Starting shared functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting ucp functional tests...
✅ datastoresrp functional tests succeeded
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ msgrp functional tests succeeded
✅ daprrp functional tests succeeded
✅ shared functional tests succeeded

@github-actions
Copy link

github-actions bot commented Sep 11, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref refs/pull/6252/merge
Unique ID cad8f344a1
Image tag pr-cad8f344a1
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.11.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location radiusdev.azurecr.io/test/functional/shared/recipes/<name>:pr-cad8f344a1
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-cad8f344a1
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-cad8f344a1
  • deployment-engine test image location: radius.azurecr.io/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp functional tests...
⌛ Starting shared functional tests...
⌛ Starting ucp functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting daprrp functional tests...
✅ datastoresrp functional tests succeeded
✅ ucp functional tests succeeded
✅ msgrp functional tests succeeded
✅ samples functional tests succeeded
✅ daprrp functional tests succeeded
✅ shared functional tests succeeded

@github-actions
Copy link

github-actions bot commented Sep 11, 2023

Test Results

2 984 tests  ±0   2 975 ✔️ ±0   2m 19s ⏱️ +19s
   255 suites ±0          9 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit 42801c2. ± Comparison against base commit 33c51ed.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
github.com/radius-project/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/39565413-a661-4522-a886-9eea8f59b50b
github.com/radius-project/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/39565413-a661-4522-a886-9eea8f59b50b#01
github.com/radius-project/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/e3bb8807-537f-4342-8148-92fc008a66bb
github.com/radius-project/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/e3bb8807-537f-4342-8148-92fc008a66bb#01

♻️ This comment has been updated with latest results.

@github-actions
Copy link

66.3

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 66.3 %
  • main branch coverage: 66.3 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

Heading: "Name",
JSONPath: "{ .name }",
Heading: "NAME",
JSONPath: "{ .Name }",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about why this fixes the issue. If this is based on JSON then the previous code was correct:

func (r ResourceGroupResource) MarshalJSON() ([]byte, error) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to delay merging this until we figure it out? Or can we merge this in to fix the bug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fired this up in the debugger and understood what's going on.

My expectation was that the JSONPointer library would operate on the JSON representation of the data. It turns out that it doesn't. It operates on the Go structs. So the behavior and the fix makes sense, it's not just not what I would have designed 😆

@AaronCrawfis AaronCrawfis requested review from a team as code owners October 4, 2023 20:03
@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref refs/pull/6252/merge
Unique ID c5489ee2e0
Image tag pr-c5489ee2e0
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.11.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location radiusdev.azurecr.io/test/functional/shared/recipes/<name>:pr-c5489ee2e0
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-c5489ee2e0
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-c5489ee2e0
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-c5489ee2e0
  • deployment-engine test image location: radius.azurecr.io/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting shared functional tests...
✅ datastoresrp functional tests succeeded
✅ ucp functional tests succeeded
✅ samples functional tests succeeded
✅ msgrp functional tests succeeded
✅ daprrp functional tests succeeded
✅ shared functional tests succeeded

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref refs/pull/6252/merge
Unique ID 09241fba69
Image tag pr-09241fba69
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.11.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location radiusdev.azurecr.io/test/functional/shared/recipes/<name>:pr-09241fba69
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-09241fba69
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-09241fba69
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-09241fba69
  • deployment-engine test image location: radius.azurecr.io/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting daprrp functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting samples functional tests...
⌛ Starting datastoresrp functional tests...
✅ datastoresrp functional tests succeeded
✅ ucp functional tests succeeded
✅ msgrp functional tests succeeded
✅ samples functional tests succeeded
✅ daprrp functional tests succeeded
✅ shared functional tests succeeded

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

66.2

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 66.2 %
  • main branch coverage: 66.2 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

@AaronCrawfis AaronCrawfis requested a review from rynowak October 4, 2023 22:31
@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref refs/pull/6252/merge
Unique ID 607c1d999c
Image tag pr-607c1d999c
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.11.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location radiusdev.azurecr.io/test/functional/shared/recipes/<name>:pr-607c1d999c
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-607c1d999c
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-607c1d999c
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-607c1d999c
  • deployment-engine test image location: radius.azurecr.io/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting shared functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting datastoresrp functional tests...
✅ ucp functional tests succeeded
✅ msgrp functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ daprrp functional tests succeeded
✅ shared functional tests succeeded

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

66.2

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 66.2 %
  • main branch coverage: 66.2 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref refs/pull/6252/merge
Unique ID 9c26ecd1c7
Image tag pr-9c26ecd1c7
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.11.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location radiusdev.azurecr.io/test/functional/shared/recipes/<name>:pr-9c26ecd1c7
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-9c26ecd1c7
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-9c26ecd1c7
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-9c26ecd1c7
  • deployment-engine test image location: radius.azurecr.io/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting daprrp functional tests...
⌛ Starting datastoresrp functional tests...
⌛ Starting shared functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
✅ ucp functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ daprrp functional tests succeeded
✅ msgrp functional tests succeeded
✅ samples functional tests succeeded
✅ shared functional tests succeeded

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

66.2

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 66.2 %
  • main branch coverage: 66.2 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

@AaronCrawfis AaronCrawfis merged commit 6932c11 into main Oct 5, 2023
26 checks passed
@AaronCrawfis AaronCrawfis deleted the aacrawfi/group-fix branch October 5, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rad group show and rad group list not outputting any information
4 participants