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

acceptance tests #220

Merged
merged 15 commits into from Feb 16, 2017
Merged

Conversation

bboozzoo
Copy link
Contributor

@bboozzoo bboozzoo commented Feb 10, 2017

It's a WIP, don't merge yet.

@maciejmrowiec @mendersoftware/rndity

@bboozzoo bboozzoo force-pushed the bboozzoo/acceptance-tests branch 3 times, most recently from ecba66b to 067f9e9 Compare February 10, 2017 14:20
@codecov-io
Copy link

codecov-io commented Feb 13, 2017

Codecov Report

Merging #220 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #220   +/-   ##
=======================================
  Coverage   72.66%   72.66%           
=======================================
  Files          35       35           
  Lines        1950     1950           
=======================================
  Hits         1417     1417           
  Misses        477      477           
  Partials       56       56

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 31833c7...1c6acff. Read the comment docs.

@bboozzoo bboozzoo force-pushed the bboozzoo/acceptance-tests branch 2 times, most recently from d6a07e9 to cf5c027 Compare February 14, 2017 07:51
@bboozzoo bboozzoo changed the title [DO NOT MERGE] acceptance tests acceptance tests Feb 14, 2017
@bboozzoo
Copy link
Contributor Author

ready for review & merging

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Introduce some refactoring to Client wrappers. Make it explicit that some are
based on swagger spec while others are not. Have tests classes call
setup_swagger() explicitly (cannot do it in constructors because Pytest would
ignore those tests).

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
…ent tests

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Add 'aborted' to enum of device deployment statuses. The status is assigned to
device deployment when a deployment gets aborted.

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
If device token canot be interpreted, the API can return 400 Bad Request.

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
@bboozzoo
Copy link
Contributor Author

FWIW integration jobs are failing due to unrelated reasons, acceptance tests are green

@maciejmrowiec
Copy link
Contributor

@GregorioDiStefano can you have a peek ?

@GregorioDiStefano
Copy link
Contributor

@bboozzoo can you add a test to verify that a deployment status correctly reports the valid state at this end point: https://docs.mender.io/1.0/APIs/Management-APIs/Deployments#get-the-details-of-a-selected-deployment

@GregorioDiStefano
Copy link
Contributor

damn github UI doesn't load the entire changes unless you do some clicking...

@bboozzoo
Copy link
Contributor Author

BTW. a number of observations (as it's the 3rd service to get acceptance tests):

  • bravado is a so-so library, lacks DELETE support, method names are awkwardly long
    ** there's bravado-core (?!), but I can't tell what is the relation between the two
  • it would be nice if our services provided api spec at one of the endpoints (yes, just like we did with WSDL in the past), this way we could avoid copying the spec files around, at least we'd be sure that the spec you get is the one that was used during the build

@GregorioDiStefano
Copy link
Contributor

are you sure about the lacking delete support? I'm pretty sure it supports DELETE

@bboozzoo
Copy link
Contributor Author

Last time I used delete was when writing deviceauth acceptance tests and you could call a method but there was no associated HTTP request going out (and no exception either).

@bboozzoo
Copy link
Contributor Author

Any more changes needed here?

@bboozzoo
Copy link
Contributor Author

@GregorioDiStefano replaced artifact deletion with this:

diff --git a/tests/tests/client.py b/tests/tests/client.py
index a857189..50f0319 100644
--- a/tests/tests/client.py
+++ b/tests/tests/client.py
@@ -121,11 +121,8 @@ class ArtifactsClient(SwaggerApiClient):
     def delete_artifact(self, artid=''):
         # delete it now (NOTE: not using bravado as bravado does not support
         # DELETE)
-        rsp = requests.delete(self.make_api_url('/artifacts/{}'.format(artid)), verify=False)
-        try:
-            assert rsp.status_code == 204
-        except AssertionError:
-            raise ArtifactsClientError('delete failed', rsp)
+
+        self.client.artifacts.delete_artifacts_id(Authorization='foo', id=artid)

and artifacts are no longer removed, there's no delete request to the backend at all ;)

@bboozzoo
Copy link
Contributor Author

merge?

@bboozzoo bboozzoo merged commit 4b633f4 into mendersoftware:master Feb 16, 2017
@bboozzoo bboozzoo deleted the bboozzoo/acceptance-tests branch February 16, 2017 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants