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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mocks for TestInstanceStats_Get and TestObjectStorage_Cancel tests #427

Merged

Conversation

amisiorek-akamai
Copy link
Contributor

馃摑 Description

Makes mocks for TestInstanceStats_Get and TestObjectStorage_Cancel such that we no longer have to skip those tests.

鉁旓笍 How to Test

make test SKIP_LINT=1 ARGS="-run TestInstanceStats_Get"

make test SKIP_LINT=1 ARGS="-run TestObjectStorage_Cancel"

@amisiorek-akamai amisiorek-akamai requested a review from a team as a code owner November 15, 2023 21:12
@amisiorek-akamai amisiorek-akamai requested review from lgarber-akamai and zliang-akamai and removed request for a team November 15, 2023 21:12
@zliang-akamai
Copy link
Contributor

Can we create a unit test directory to hold all mocked tests or maybe making a xxxx_test.go file in the root directory of the repo (like this one)?

@amisiorek-akamai
Copy link
Contributor Author

amisiorek-akamai commented Nov 16, 2023

I think we should make a new ticket for that, and maybe get Youjung's opinion on restructuring the test suite because I think mocks are scattered throughout the codebase at the moment. Thoughts? @zliang-akamai

@zliang-akamai
Copy link
Contributor

@amisiorek-akamai Ah yes, your are right, didn't realize that, lol

Copy link
Contributor

@zliang-akamai zliang-akamai left a comment

Choose a reason for hiding this comment

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

Tested locally and passed!

Comment on lines 19 to 36
CPU: [][]float64{},
IO: linodego.StatsIO{
IO: [][]float64{},
Swap: [][]float64{},
},
NetV4: linodego.StatsNet{
In: [][]float64{},
Out: [][]float64{},
PrivateIn: [][]float64{},
PrivateOut: [][]float64{},
},
NetV6: linodego.StatsNet{
In: [][]float64{},
Out: [][]float64{},
PrivateIn: [][]float64{},
PrivateOut: [][]float64{},
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be populated with some arbitrary data just to make sure everything unmarshals correctly?

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Looks good and tests pass locally, great work!

@amisiorek-akamai amisiorek-akamai merged commit 2b09f09 into linode:main Nov 17, 2023
3 checks passed
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