Fixing 'sign-build' integration tests. #839

Merged
merged 1 commit into from Sep 29, 2016

Conversation

Projects
None yet
2 participants
Contributor

cprov commented Sep 29, 2016

Even for building the local assertion, the command actually checks if the
account logged in has upload permission on the targeted snap (resolving
name to snap-id via account-info).

The test now builds an random snap, register the name in the store and
only then signs the snap. The fake server was extended to record registered
names and return them in the account-info endpoint.

Looks like a nice improvement. I do however suspect these tests have not run.

@@ -26,6 +26,8 @@
Not,
)
+import integration_tests
@sergiusens

sergiusens Sep 29, 2016

Collaborator

Thanks for doing the right thing 😃

- self.assertThat(self.snap_build_path, FileExists())
- self.assertThat(self.snap_build_path,
+
+ snap_build_path = '{}-build'.format(snap_path)
@sergiusens

sergiusens Sep 29, 2016

Collaborator

Was this even not in existence before?

@cprov

cprov Sep 29, 2016

Contributor

It was, the test works if the account logged in was the publisher of 'basic' name, but this is impossible in staging SCA. See https://travis-ci.org/snapcore/snapcraft/builds/163606844

snapcraft/tests/fake_servers.py
self.send_response(201)
self.send_header('Content-Type', 'application/json')
self.end_headers()
response = {'snap_id': 'test-snap-id'}
+ self.server.regitered_name
@sergiusens

sergiusens Sep 29, 2016

Collaborator

Typo

@sergiusens

sergiusens Sep 29, 2016

Collaborator

Also what is the intention of this line?

@cprov

cprov Sep 29, 2016

Contributor

The intention was to leave no doubts this was a 2am PR ;-) typo removed.

Fixing 'sign-build' integration tests.
Even for building the local assertion, the command actually checks if the
account logged in has upload permission on the targeted snap (resolving
name to snap-id via account-info).

The test now builds an random snap, register the name in the store and
only then signs the snap. The fake server was extended to record registered
names and return them in the account-info endpoint.

@sergiusens sergiusens merged commit b67a60d into snapcore:master Sep 29, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 98.145%
Details

@cprov cprov deleted the cprov:test-skipping branch Sep 29, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Fixing 'sign-build' integration tests. (#839)
Even for building the local assertion, the command actually checks if the
account logged in has upload permission on the targeted snap (resolving
name to snap-id via account-info).

The test now builds an random snap, register the name in the store and
only then signs the snap. The fake server was extended to record registered
names and return them in the account-info endpoint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment