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 failure due to changes done on ScaleWorkload replicas type #236

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

SupriyaKasten
Copy link
Contributor

@SupriyaKasten SupriyaKasten commented Aug 26, 2019

Change Overview

This PR fixes the e2e test failure:

 Invalid arg type int64 for Arg replicas

Pull request type

Please check the type of change your PR introduces:

  • Work in Progress
  • Refactoring (no functional changes, no api changes)
  • Trival/Minor
  • Bugfix
  • Feature
  • Documentation

Test Plan

  • Manual
  • Unit test
  • E2E

@SupriyaKasten SupriyaKasten changed the title Fix failure due to ScaleWorkload replicas type Fix failure due to changes done on ScaleWorkload replicas type Aug 26, 2019
case int32:
val = int(rep.(int32))
case int64:
val = int(rep.(int64))
Copy link
Contributor

Choose a reason for hiding this comment

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

@SupriyaKasten Quick question. Was the failure caused by going into the default statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Invalid arg type int64 for Arg replicas

@@ -269,7 +269,7 @@ func (s *ScaleSuite) TestGetArgs(c *C) {
},
},
args: map[string]interface{}{
ScaleWorkloadReplicas: "2",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is removing the case for when the input is specified as a string, no? Shouldn't another test case be added instead? or where is this covered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we do have one unit test that covers string input as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I see it above, got it. Thanks.

Copy link
Contributor

@tdmanv tdmanv left a comment

Choose a reason for hiding this comment

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

let's use the assignment option in the typeswitch. that we you don't need to re-typecast in each case: https://tour.golang.org/methods/16

@julio-lopez
Copy link
Contributor

let's use the assignment option in the typeswitch. that we you don't need to re-typecast in each case: https://tour.golang.org/methods/16

Should we merge and refactor in a followup?

@SupriyaKasten
Copy link
Contributor Author

Sure!

@SupriyaKasten SupriyaKasten merged commit 088ab18 into master Aug 26, 2019
@SupriyaKasten SupriyaKasten deleted the fix-scale-workload branch August 26, 2019 18:11
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.

None yet

3 participants