Commit Graph

8 Commits

Author SHA1 Message Date
Ian H. Pittwood 4480ab5574 Restructure usage of test fixtures
Pytest includes a fixture that can be used to generate temporary
directories. Previously Pegleg had implemented a hombrewed version of a
temporary directory fixture. This change removes the homebrewed version
and replaces it with the tmpdir fixture.

Implement tmpdir fixture in tests

Upgrade all testing packages to use the latest features

Removes unused imports and organizes import lists

Removes mock package requirement and uses unittest.mock, included in
python >3.3

Implements a slightly cleaner method to get proxy info

Change-Id: If66e1cfba858d5fb8948529deb8fb2d32345f630
2019-07-29 11:37:36 -05:00
Alexander Hughes 1c8d92ef6b Standardize Pegleg code with YAPF
This patch addresses inconsistent code style and enforces it with a
gate for future submissions.

Separate work will be done in the future to address several of the
PEP8 ignores for docstrings, and attempt to bring the tests directory
to PEP8 compliance.

This patch:
1. Updates .style.yapf to set the knobs desired for YAPF.
2. Updates tox.ini to allow one of the knobs to work.
3. Removes unused code from several __init__.py files.
4. Updates the YAPF version in test-requirements.txt to latest (this
   is needed for several knobs to work).
5. Stylistic changes to the python codebase in Pegleg.
6. Updates to tox.ini to run YAPF during PEP8 check.

Change-Id: Ieaa0fdef2b601d01c875d64b840986e54df73abf
2019-07-25 17:28:18 +00:00
Felipe Monteiro b28788325f tests: Improve unit tests runtime performance
This patch set does 2 things:

1) Improves unit test runtime peformance via pytest-xdist [0]
2) Reduces finnicky nature of `is_connected` helpers which
   sometimes skip even when there is access to the internet;
   logic has been added to make these checks more accurate
   to avoid skipping tests

Note that while there are newer alternatives to pytest-xdist they
are only compatible with much newer versions of Python.

[0] https://pypi.org/project/pytest-xdist/

Change-Id: Ib04b48ebabca0551058e5e1065056f4e559fbfe6
2019-04-04 14:21:43 +00:00
Felipe Monteiro 40da373023 tests: Increase test coverage for lint checks
This patch set expands on the unit test coverage for lint checks
in test_selectable_linting which only covers a small subset of
the lint checks handled by Pegleg. This logic should be properly
tested as linting is fundamental to Pegleg functionality.

Change-Id: I6a59295982abd22bba8036827cefd4186b68e2fb
2019-01-01 19:17:11 +00:00
Tin Lam 2a0e1ac1d4 Fix URLs
This patch set sanitizes and changes the default proxy URLs.

Change-Id: Ibaeb501b59eeea8427fa812078236cfc4fe39623
Signed-off-by: Tin Lam <tin@irrational.io>
2018-11-09 10:25:39 -06:00
Felipe Monteiro ed5251e0e4 fix: Enable Pegleg to support manifest repos like AIAB
This patch set enables Pegleg to support repos like Airship in a
Bottle -- those that have site/ type/ global/ folders nested
under deployment_files/. Very particular logic is needed in order
to handle that. CLI unit tests included for validation/regression.

Change-Id: I9f13f59738599f07329ad3e3274eb4590e8638f9
2018-10-18 19:07:31 +01:00
Felipe Monteiro c05f0ea5d9 trivial: change prefix in test_utils helper to 'pegleg'
Addresses trivial copy/paste issue from Armada: Rename 'armada'
to 'pegleg' in test_utils helper funciton.

Change-Id: I5412f36d23fca73cd684ac570893e89c12d780e6
2018-10-16 20:41:17 -04:00
Felipe Monteiro 893ea9f4bb Standardize Pegleg directory structure
This patch set standardizes the Pegleg directory
structure because of the following reasons:

1) src/bin/pegleg is not necessary and only makes
building (e.g. documentation building) and running
of tox targets unnecessarily difficult.
2) src/bin/pegleg is a Java-like standard that
bears no relevance to Python.

Change-Id: I37d39d3d6186b92f8fbfe234221c9e44da48cf10
2018-09-23 10:33:40 -04:00