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

Add integration tests #190

Merged
merged 1 commit into from
Nov 13, 2018
Merged

Add integration tests #190

merged 1 commit into from
Nov 13, 2018

Conversation

zhouzhuojie
Copy link
Collaborator

@zhouzhuojie zhouzhuojie commented Nov 12, 2018

Description

Add integration tests so that we can test flagr against multiple environments or multiple DBs.

Motivation and Context

To cover DB discrepancies.

How Has This Been Tested?

Will add more endpoints covered by the swagger API definition.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-io
Copy link

codecov-io commented Nov 12, 2018

Codecov Report

Merging #190 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #190      +/-   ##
==========================================
- Coverage   90.85%   90.83%   -0.02%     
==========================================
  Files          25       25              
  Lines        1410     1408       -2     
==========================================
- Hits         1281     1279       -2     
  Misses         96       96              
  Partials       33       33
Impacted Files Coverage Δ
pkg/mapper/entity_restapi/r2e/r2e.go 91.66% <ø> (-0.34%) ⬇️
pkg/mapper/entity_restapi/e2r/e2r.go 100% <ø> (ø) ⬆️
pkg/handler/crud.go 92.63% <100%> (ø) ⬆️
pkg/handler/eval.go 84.47% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b83965...956d52f. Read the comment docs.

@zhouzhuojie zhouzhuojie force-pushed the zz/add-integration-test branch 2 times, most recently from e3b49ad to 930eccb Compare November 12, 2018 22:26
@@ -986,7 +986,6 @@ definitions:
type: object
required:
- key
- attachment
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no need to be required, tested with integration tests

@@ -1060,9 +1059,6 @@ definitions:
format: int64
minimum: 0
maximum: 100
bitmap:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not needed now, tested with integration tests

@@ -89,7 +89,7 @@ func (c *crud) FindFlags(params flag.FindFlagsParams) middleware.Responder {
q = q.Offset(int(*params.Offset))
}

err := q.All(&fs)
err := q.OrderAscByID().All(&fs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to explicitly sort by ID for postgres, caught by integration tests

@@ -213,7 +213,7 @@ var evalSegment = func(
Msg: fmt.Sprintf("constraints are present in the segment_id %v, but got invalid entity_context: %s.", segment.ID, spew.Sdump(evalContext.EntityContext)),
SegmentID: int64(segment.ID),
}
return nil, log, false
return nil, log, true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Caught by integration tests. We need to continue if evalContext.EntityContext if nil or invalid, because there may be some segments below that has no constraints.

@zhouzhuojie zhouzhuojie merged commit 4b64006 into master Nov 13, 2018
@zhouzhuojie zhouzhuojie deleted the zz/add-integration-test branch November 13, 2018 22:01
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.

3 participants