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

chore: refactor tests #96

Merged
merged 2 commits into from
Oct 5, 2023
Merged

chore: refactor tests #96

merged 2 commits into from
Oct 5, 2023

Conversation

pivotal-marcela-campo
Copy link
Member

  • Simplify tests while keeping all scenarios under test
  • Modify tests to have a consistent style
  • Move log lines tests to the logger tests instead of the upgrader tests

#185853346

Checklist:

* [ ] Have you added Release Notes in the docs respositories?

- Simplify tests while keeping all scenarios under test
- Modify tests to have a consistent style
- Move log lines tests to the logger tests instead of the upgrader tests

[#185853346](https://www.pivotaltracker.com/story/show/185853346)
State: "failed",
},
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: thank you very much. It is easier to understand the obtained data when something fails

}

func fullInstance(name, guid string, upgradeAvailable bool, lastOperationType, lastOperationState string) ccapi.ServiceInstance {
func indexedInstance(index int, upgradeAvailable bool) ccapi.ServiceInstance {
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: very readable

fakeInstanceCreateFailed ccapi.ServiceInstance
fakeInstanceDestroyFailed ccapi.ServiceInstance
fakeServiceInstances []ccapi.ServiceInstance
fakeServiceInstancesNoUpgrade []ccapi.ServiceInstance
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: great contribution

fakeCFClient.GetServicePlansReturns([]ccapi.Plan{}, nil)

err := upgrader.Upgrade(fakeCFClient, fakeBrokerName, 1, false, true, fakeLog)
Expect(err).To(MatchError(fmt.Sprintf("no service plans available for broker: %s", fakeBrokerName)))
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: fantastic!

@@ -108,28 +106,6 @@ func (l *Logger) FinalTotals() {
logRowFormatTotals(l)
}

//lint:ignore U1000 Ignore unused function temporarily for better code review
func logOldFormatTotals(l *Logger) {
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: great catch

@zucchinidev zucchinidev merged commit f3ac308 into main Oct 5, 2023
6 checks passed
@zucchinidev zucchinidev deleted the refactor-tests branch October 5, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants