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

Remove double imports and some dead code #7445

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Conversation

ytimocin
Copy link
Contributor

@ytimocin ytimocin commented Apr 4, 2024

Description

  1. Removing all the double imports
  2. Removing some dead code

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

@ytimocin ytimocin requested review from a team as code owners April 4, 2024 04:38
Copy link

github-actions bot commented Apr 4, 2024

Test Results

3 136 tests  ±0   3 129 ✅ ±0   3m 26s ⏱️ -5s
  261 suites ±0       7 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 13aaefb. ± Comparison against base commit ea33bec.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 73.07692% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 63.83%. Comparing base (ea33bec) to head (13aaefb).

Files Patch % Lines
...d/controller/awsproxy/deleteawsresourcewithpost.go 50.00% 2 Missing ⚠️
...tend/controller/awsproxy/getawsoperationresults.go 33.33% 1 Missing and 1 partial ⚠️
...end/controller/awsproxy/getawsoperationstatuses.go 33.33% 1 Missing and 1 partial ⚠️
...tend/controller/awsproxy/getawsresourcewithpost.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7445      +/-   ##
==========================================
+ Coverage   63.79%   63.83%   +0.04%     
==========================================
  Files         416      416              
  Lines       23440    23434       -6     
==========================================
+ Hits        14954    14960       +6     
+ Misses       7225     7216       -9     
+ Partials     1261     1258       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Apr 4, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref a3b3202
Unique ID func593200bbcf
Image tag pr-func593200bbcf
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func593200bbcf
  • 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-func593200bbcf
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func593200bbcf
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func593200bbcf
  • deployment-engine test image location: ghcr.io/radius-project/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 cli functional tests...
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting shared functional tests...
✅ samples functional tests succeeded
✅ msgrp functional tests succeeded
✅ kubernetes functional tests succeeded
✅ daprrp functional tests succeeded
✅ ucp functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ cli functional tests succeeded
✅ shared functional tests succeeded

@radius-functional-tests
Copy link

radius-functional-tests bot commented Apr 4, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 66cac7f
Unique ID func8c84b4a8e7
Image tag pr-func8c84b4a8e7
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func8c84b4a8e7
  • 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-func8c84b4a8e7
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func8c84b4a8e7
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func8c84b4a8e7
  • deployment-engine test image location: ghcr.io/radius-project/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 cli functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting shared functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting datastoresrp functional tests...
✅ msgrp functional tests succeeded
✅ ucp functional tests succeeded
✅ kubernetes functional tests succeeded
✅ samples functional tests succeeded
✅ daprrp functional tests succeeded
✅ cli functional tests succeeded
✅ datastoresrp functional tests succeeded
❌ shared functional test failed. Please check the logs for more details
⌛ Starting shared functional tests...
✅ shared functional tests succeeded

@@ -179,18 +141,6 @@ func (cli *CLI) ApplicationShow(ctx context.Context, applicationName string) (st
return cli.RunCommand(ctx, args)
}

// ApplicationList runs a command to list applications and returns the output as a string. It returns an
// error if the command fails.
func (cli *CLI) ApplicationList(ctx context.Context) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these covered elsewhere in the tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These functions are not being referenced anywhere in the code. I am not sure if it is wise to keep these just in case if we need them one day. I believe that if we need, we can add them in future. As of now, it is showing up as deadcode when I run staticcheck. That is why I believe it is good to remove them.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was curious why don't we just use these functions to add test coverage unless they are being tested through other code paths, but doesn't look like we are testing these commands. I don't think it is in scope of this PR to add tests, but I have created this issue #7453, we can reference this PR if these functions need to be brought back.

Thanks for doing this cleanup!

Copy link
Contributor

Choose a reason for hiding this comment

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

I was curious why don't we just use these functions to add test coverage unless they are being tested through other code paths, but doesn't look like we are testing these commands. I don't think it is in scope of this PR to add tests, but I have created this issue #7453, we can reference this PR if these functions need to be brought back.

Thanks for doing this cleanup!

Our coverage results don't include functional tests. To do that we'd have to collect coverage from inside the containers where Radius is running.

Copy link
Contributor

@kachawla kachawla Apr 5, 2024

Choose a reason for hiding this comment

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

I'm meant tests, not coverage results, I know coverage results are for unit tests :). What I'm trying to understand is that why don't we have functional tests for these commands. Looks like a bunch of helper functions were added to be able to write functional tests but were never used.

I should have written "use these functions to add tests", sorry for the confusion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry. No idea why then :)

Signed-off-by: ytimocin <ytimocin@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Apr 4, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 13aaefb
Unique ID funcb488d9ed1e
Image tag pr-funcb488d9ed1e
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcb488d9ed1e
  • 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-funcb488d9ed1e
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb488d9ed1e
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb488d9ed1e
  • deployment-engine test image location: ghcr.io/radius-project/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 kubernetes functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting shared functional tests...
⌛ Starting samples functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting cli functional tests...
⌛ Starting datastoresrp functional tests...
✅ kubernetes functional tests succeeded
✅ samples functional tests succeeded
✅ msgrp functional tests succeeded
✅ ucp functional tests succeeded
✅ daprrp functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ cli functional tests succeeded
✅ shared functional tests succeeded

@ytimocin ytimocin merged commit 907c6b3 into main Apr 4, 2024
20 checks passed
@ytimocin ytimocin deleted the ytimocin/refactor/v1 branch April 4, 2024 22:37
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.

3 participants