Fix test isolation issues. #414

Merged
merged 1 commit into from Apr 1, 2016

Conversation

Projects
None yet
5 participants
Contributor

vilagithub commented Mar 30, 2016

LP: 1563965

Two root causes:

  • missing patch() leaving dirty 'badarch' in snapcraft.common.target_machine,
  • pydoc.pager automatic detection failing for wrong reasons.

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Member

elopio commented Mar 30, 2016

OK to test

Member

elopio commented Mar 30, 2016

thanks for this @vilagithub. 👍

Member

elopio commented Mar 30, 2016

retest this please

Member

elopio commented Mar 31, 2016

retest this please

snapcraft/tests/test_common.py
+ self.addCleanup(ph.stop)
+ pt = patch('snapcraft.common.target_machine', new=common.host_machine)
+ pt.start()
+ self.addCleanup(pt.stop)
@kyrofa

kyrofa Mar 31, 2016

Member

Should we actually protect these with get/set functions in common and then take care of this issue similar to how we've done the other stuff in common?

@sergiusens

sergiusens Mar 31, 2016

Collaborator

My searching on common patterns for these singletons (antipatterns really) showed that this is the most accepted way of doing it.

Ideally I want it to be just one class though and not many disparate attributes

snapcraft/tests/test_common.py
- common.host_machine = platform.machine()
- common.target_machine = common.host_machine
+ # tests will override host_machine, protect it first
+ ph = patch('snapcraft.common.host_machine', new=common.host_machine)
@sergiusens

sergiusens Mar 31, 2016

Collaborator

thanks to @elopio 😉 we've called this ph patcher everywhere, mind changing it to keep consistency and for readability?

@vilagithub

vilagithub Mar 31, 2016

Contributor

Done.

Contributor

vilagithub commented Mar 31, 2016

From http://162.213.35.179:8080/job/github-snapcraft-autopkgtest-cloud/334/console

DEBUG (shell:1082) Quota exceeded for instances: Requested 1, but already used 10 of 10 instances (HTTP 413) (Request-ID: req-d76e009d-a077-401b-aa0f-fd38f085dbe4)

Someone needs to fix that and re-run the tests ?

Collaborator

sergiusens commented Mar 31, 2016

retest this please

Member

elopio commented Apr 1, 2016

retest this please

Collaborator

sergiusens commented Apr 1, 2016

@vilagithub mind rebasing please?

Fix test isolation issues.
LP: 1563965

Two root causes:
- missing patch() leaving dirty 'badarch' in snapcraft.common.target_machine,
- pydoc.pager automatic detection failing for wrong reasons.
Contributor

vilagithub commented Apr 1, 2016

rebased

Contributor

vilagithub commented Apr 1, 2016

From http://162.213.35.179:8080/job/github-snapcraft-autopkgtest-cloud/344/console

adt-run [14:36:57]: ERROR: testbed failure: unexpected eof from the testbed

Sounds like a spurious infra failure.

Member

elopio commented Apr 1, 2016

retest this please

@sergiusens sergiusens merged commit 85d1394 into snapcore:master Apr 1, 2016

2 of 4 checks passed

autopkgtest No test results found.
Details
Examples tests Started
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.005%) to 95.642%
Details
Contributor

vilagithub commented Apr 1, 2016

\o/

Thanks ;)

smoser pushed a commit to smoser/snapcraft that referenced this pull request Sep 14, 2016

Merge pull request #414 from hglkrijger/gh387
Exclude current version from latest

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment