-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(services): add aggregations #268
Conversation
When("Getting Services with Aggregations", Label("GetServicesWithAggregations"), func() { | ||
BeforeEach(func() { | ||
_ = seeder.SeedDbWithNFakeData(10) | ||
}) | ||
Context("and and we have 10 elements in the database", func() { | ||
It("returns the services with componentInstance count", func() { | ||
entriesWithAggregations, err := db.GetServicesWithComponentInstanceCount(nil) | ||
|
||
By("throwing no error", func() { | ||
Expect(err).To(BeNil()) | ||
}) | ||
|
||
By("returning some aggregations", func() { | ||
for _, entryWithAggregations := range entriesWithAggregations { | ||
Expect(entryWithAggregations).NotTo( | ||
BeEquivalentTo(entity.ServiceAggregations{})) | ||
} | ||
}) | ||
}) | ||
It("returns correct aggregation values", func() { | ||
//Should be filled with a check for each aggregation value, | ||
// this is currently skipped due to the complexity of the test implementation | ||
// as we would need to implement for each of the aggregations a manual aggregation | ||
// based on the seederCollection. | ||
// | ||
// This tests should therefore only get implemented in case we encourage errors in this area to test against | ||
// possible regressions | ||
}) | ||
}) | ||
Context("and and we have 10 elements in the database", func() { | ||
It("returns the services with issueMatch count", func() { | ||
entriesWithAggregations, err := db.GetServicesWithIssueMatchCount(nil) | ||
|
||
By("throwing no error", func() { | ||
Expect(err).To(BeNil()) | ||
}) | ||
|
||
By("returning some aggregations", func() { | ||
for _, entryWithAggregations := range entriesWithAggregations { | ||
Expect(entryWithAggregations).NotTo( | ||
BeEquivalentTo(entity.ServiceAggregations{})) | ||
} | ||
}) | ||
}) | ||
It("returns correct aggregation values", func() { | ||
//Should be filled with a check for each aggregation value, | ||
// this is currently skipped due to the complexity of the test implementation | ||
// as we would need to implement for each of the aggregations a manual aggregation | ||
// based on the seederCollection. | ||
// | ||
// This tests should therefore only get implemented in case we encourage errors in this area to test against | ||
// possible regressions | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a test then here that is checking that for 0 counts the service is still listed?
So I'm expecting 10 services even though they might not all have a count > 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we might can create 2 services (without anything) and we would expect them to come back no?
@MR2011 Am I missing something? I think its just about calling: seeder.SeedServices(10) in a test and check then if also the 0 count services are returned (if no filter is applied) |
|
Description
This PR adds the following two aggregations for services:
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
Tests:
Added to documentation?
Checklist