Merge lp://qastaging/~fgimenez/snappy/api-packages-test into lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github
Status: | Rejected |
---|---|
Rejected by: | Federico Gimenez |
Proposed branch: | lp://qastaging/~fgimenez/snappy/api-packages-test |
Merge into: | lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github |
Diff against target: |
1021 lines (+689/-152) 9 files modified
_integration-tests/tests/build_test.go (+41/-48) _integration-tests/tests/snapd_1_0_packages_test.go (+97/-0) _integration-tests/tests/snapd_1_0_test.go (+41/-0) _integration-tests/tests/snapd_root_test.go (+41/-0) _integration-tests/tests/snapd_test.go (+183/-32) _integration-tests/testutils/build/snap.go (+71/-0) _integration-tests/testutils/build/snap_test.go (+82/-0) _integration-tests/testutils/wait/wait.go (+23/-8) _integration-tests/testutils/wait/wait_test.go (+110/-64) |
To merge this branch: | bzr merge lp://qastaging/~fgimenez/snappy/api-packages-test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leo Arias (community) | Needs Fixing | ||
Review via email:
|
Commit message
API 1.0/packages test
Description of the change
API 1.0/packages test
Besides the tests themselves these are the main things going on with the changes:
* The apiExerciser interface has been added, the suites for testing API resources should implement this interface and just call exerciseApi(). There are other interfaces for each http verb, depending on which ones are implemented the tests are executed differently.
* The apiInteraction type allows to describe how to test one api resource, when implementing an http verb interface the suites just need to return an array of those, each element has fields like responsePattern, responseObject (this is populated via json.Unmarshal if present), payload if needed (as a generic io.Reader), and, when there's an async call involved, waitResponsePattern and waitFunction
* A wait.ForFunction has been added to the wait package, for the previous functionality to work. The wait.ForCommand has been updated to use under covers ForFunction and the unit tests have been modified to prevent a delay that we were having.
* The functions used to build snaps have been moved to the build package.
Unmerged revisions
- 682. By Federico Gimenez
-
Removed setup and teardown from the apiExerciser interface, using SetUpTest and TearDownTest fixtures from check; comments
- 681. By Federico Gimenez
-
testing methods not allowed; payload as string
- 680. By Federico Gimenez
-
reverted image changes
- 679. By Federico Gimenez
-
doing the 404 check for each resource
- 678. By Federico Gimenez
-
some comments
- 677. By Federico Gimenez
-
moved package related types to the test file
- 676. By Federico Gimenez
-
/1.0/packages resource complete
- 675. By Federico Gimenez
-
/1.0 resource complete
- 674. By Federico Gimenez
-
interfaces definition; root and 404 complete
- 673. By Federico Gimenez
-
removed extra line
you are getting all fancy with interfaces and stuff in the tests :)
nice work.
I'm leaving some comments in the diff. The only big thing, in which maybe I am wrong, is the setUp and tearDown. We can talk about it tomorrow.