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

test: Improved device unit test cases and fixed issue #340

Closed
wants to merge 3 commits into from

Conversation

codinja1188
Copy link
Contributor

Description:

We improved the device unit cases

Issue fixed?

#257

@codinja1188 codinja1188 temporarily deployed to external August 31, 2023 17:52 — with GitHub Actions Inactive
@@ -74,6 +74,29 @@ func IsDeviceStateActive(deviceId string) (bool, error) {
return false, err
}

func IsDeviceStateInActive(deviceId string) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than create a separate function, the existing helper could be updated to accept a state as an argument; that way we can avoid creating a new function if we find a third or fourth state we need to wait for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

// Sleep for the specified interval
time.Sleep(retryInterval)
}
return false, err
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that this is going to return a nil error; instead we should return an error that describes what happened. #339 shows how we could do that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@codinja1188 codinja1188 temporarily deployed to external September 4, 2023 14:22 — with GitHub Actions Inactive
@cprivitere cprivitere temporarily deployed to external October 9, 2023 19:29 — with GitHub Actions Inactive
@cprivitere cprivitere changed the title Improved device unit test cases and fixed issue test: Improved device unit test cases and fixed issue Oct 9, 2023
test/helper/helper.go Outdated Show resolved Hide resolved
test/helper/helper.go Outdated Show resolved Hide resolved
@cprivitere cprivitere temporarily deployed to external October 9, 2023 19:36 — with GitHub Actions Inactive
@cprivitere
Copy link
Contributor

Was looking at this, seems like the state shouldn't be a string but instead some type defined in the generated API files.

@@ -125,8 +125,13 @@ func (c *Client) Create() *cobra.Command {
if billingCycle != "" {
facilityDeviceRequest.DeviceCreateInFacilityInput.SetBillingCycle(*validBillingCycle)
}
if alwaysPXE {
facilityDeviceRequest.DeviceCreateInFacilityInput.SetAlwaysPxe(alwaysPXE)
if alwaysPXE != "" {
Copy link
Member

@displague displague Dec 18, 2023

Choose a reason for hiding this comment

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

Copy link
Member

@displague displague left a comment

Choose a reason for hiding this comment

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

Is anything left in this PR that hasn't been addressed in another PR? Anything that this PR aimed to do that it hasn't done?

Should we close this?

@ctreatma
Copy link
Contributor

ctreatma commented Jan 9, 2024

Closing this since everything in here appears to have been addressed in other PRs.

@ctreatma ctreatma closed this Jan 9, 2024
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.

4 participants