23 Commits

Author SHA1 Message Date
Felipe Monteiro
38c1d7a1a3 fix: Pin down Deckhand package requirements
This patch set pins down package requirements for the following
reasons:

* Inconsistencies between ranges and direct pins
* Deckhand isn't gated against requirements repo so changes to
  some packages isn't actively tested
* Other Airship components use pins, so Deckhand might break them
  when package requirements go out of sync between components
* Deckhand as of yet has no stable release so Airship relies on
  master for stability so it is better to ensure stability over
  anything else

Change-Id: I20ef4be3e01cd267771098d33447ccb61aee20b4
2018-10-18 02:36:35 +01:00
Felipe Monteiro
3353833dba Update Deckhand test-/requirements.txt
This simply updates Deckhand's package versions in
test-requirements.txt and requirements.txt using `pur -r` command
line tool.

Change-Id: If4bbd85190502c52a7f10adf6af750172b54c234
2018-06-16 18:18:28 -04:00
Charles Short
aadf9ae938 Remove mox3 dependency
mox3 is not being used so remove it, apart of the community
goal for Rocky.

Change-Id: I4fd687391d83fd11665b287d1853a35fcdc1f9f9
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-06-07 09:35:10 -04:00
Felipe Monteiro
3d53d53712 Add uwsgi functional test check to .zuul.yaml
This adds a uwsgi functional test check to .zuul.yaml so that
deploying Deckhand via uwsgi (in a more standalone fashion,
sans containerization) works as intended.

Change-Id: I931ab4d11719daca7665d3a25b00e353c707237e
2018-05-29 20:25:15 +00:00
Felipe Monteiro
5c078ce81c Update releasenotes/docs tox jobs
This is to update releasenotes/docs tox jobs to remove need
to defined build_sphinx in setup.cfg and to ensure that they
both clean up prior to running via appropraite rm -rf commands
and to ensure all the requirements are being installed.

Change-Id: Iadd375dbb596151cb140fae03b82a728a64364a0
2018-04-24 22:34:49 +01:00
Felipe Monteiro
ff5c66046d Bump up package requirements versions
Change-Id: I6922a4dc8c542a3168de471b2abf529b7a11cb12
2018-02-13 22:54:44 -05:00
Felipe Monteiro
2f0d5796e3 Revert fix pifpaf run postgresql failing
This reverts https://review.gerrithub.io/#/c/393980/ which was
a temporary workaround to unblock the Deckhand gate. pifpaf should
be used to run unit tests as having to install Docker just to kick
off unit tests is excessive.

However, the unit-tests.sh script is maintained in tools/ directory
as a fallback.

Change-Id: I24a10d4b3ea00006004f27d0086719fb0bf86dd9
2018-01-12 11:57:44 -04:00
Felipe Monteiro
2bfb16e44d [Gate fix] Fix pifpaf run postgresql failing.
This PS unblocks the gate by replacing pifpaf to run postgresql
for unit tests with docker, as a workaround. This is because
"pifpaf run postgresql" is failing with pifpaf not being able
to find the command "pifpaf run". Steps to reproduce:

python3 -m virtualenv -p python3 /tmp/venv
source /tmp/venv/bin/activate
pip install -U pip wheel devpi-client setuptools
pip install pifpaf

$pifpaf run postgresql
>> pifpaf: 'run' is not a pifpaf command. See 'pifpaf --help'.
>> Did you mean one of these?
     help

The unit test script for spinning up the docker postgresql container
and then running unit tests is very similar to the pre-existing
script for running functional tests located in tools/ directory.

Change-Id: Ib0f414ff58007037ac12161876dcd7a10e91f48c
2018-01-08 17:28:01 -04:00
Tin Lam
4dbcf5ba38 Create doc/requirements.txt
This change migrates the docs building requirements as outlined in
the Project Testing Interface[0]. One benefit of this that we no longer
load all the doc-generating modules when we run tox unittest. See [1] for
more details.

[0] https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation
[1] http://lists.openstack.org/pipermail/openstack-dev/2017-November/124815.html

Change-Id: If5ac500e9e0fc99e75b98f3d55858dfc56dee6ff
Signed-off-by: Tin Lam <tin@irrational.io>
2017-12-29 00:26:33 -06:00
Felipe Monteiro
c26ad42e9f Fix readthedocs document build job for Deckhand
Currently readthedocs build is failing for DH because it runs
pip install -rtest-requirements.txt [0] when test-requirements.txt
doesn't include oslo.policy. And readthedocs can't run tox -e docs
which is what is intended to be run for documentation generation.

[0] https://readthedocs.org/projects/deckhand/builds/6351568/

Change-Id: I4ad93e41b0410c547c9fec7d6d38f3b7e7f6829f
2017-12-02 16:40:04 +00:00
Felipe Monteiro
bead00e23e HTML test report for Deckhand functional tests
This PS leverages pytest-html to generate an HTML report for
Deckhand functional tests. The test_gabbi.py file was updated to
use pytest as the test runner as it is compatible with pytest-html.
The report is saved in results/index.html. Test docs were updated.

Change-Id: I0b611bf124bf87d801ab93dd2a5d16f136e4801d
2017-10-25 18:18:15 -04:00
Tin Lam
2a0a8452a5 Add releasenote management
This patch set adds reno releasenote management to Deckhand.

Change-Id: I69bf6be2b2896e4b1ac917cdefac1c1c634b2ad7
2017-10-03 20:58:12 +01:00
Felipe Monteiro
8bf4f7407d Revamp document hashing
This PS revamps document hashing. Instead of relying on Python's
built-in hash function to hash the contents of a document (i.e.
metadata and data values), sha256 from hashlib is used instead,
mostly for security purposes.

Further, new parameters have been added to the document DB model:
data_hash and metadata_hash, and the old value hash has been
dropped. The data type for storing the hashes has been changed
to String from BigInt.

Finally, testing documentation was added.

Change-Id: I428ddcbce1007ea990ca0df1aa630072a050c722
2017-10-02 18:09:13 +01:00
Felipe Monteiro
0cd5d45706 Add sphinx job for auto-generating docs
Sphinx can be leveraged to auto-generate docs into feature-rich
HTML pages. Docstrings in modules and classes can be easily
auto-injected into documentation to produce high-level
documentation, yet with accompanying code blocks and
necessary docstrings.

This commit introduces the tox job for auto-generating docs,
as well as the foundational logic and documentation pages
(index, HACKING and glossary). While hacking rules are
introduced in HACKING.rst, they are not added in this
commit; that will be done in a follow-up patchset.

Additional documentation will also be included in a series
of future patchsets.

Change-Id: Iacd0e4542ebf481d66ab19dd43014b8d5bcc9e3f
2017-09-21 16:16:23 +01:00
Felipe Monteiro
8715fe3e02 [flake8] Enable extra, optional hacking checks
Update test-requirements.txt to use latest version of:
    * hacking

Enable the following off-by-default checks:
    * [H203] Use assertIs(Not)None to check for None.
    * [H204] Use assert(Not)Equal to check for equality.
    * [H205] Use assert(Greater|Less)(Equal) for comparison.
    * [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in
             mock.patch/mock.patch.object calls
    * [H904] Delay string interpolations at logging calls.

Made minimal code changes to comply with changes.

Change-Id: I3559ead76b5476650d7193e7023d349175234922
2017-09-21 10:43:21 -04:00
Felipe Monteiro
e62e9e9f40 DECKHAND-33: Add oslo.config options for keystone auth
This commit adds oslo.config options for keystone auth and
updates Deckhand's request context to use oslo_context for
facilitating integration with keystone auth options.

Change-Id: Ifd170e1a192402a970f8538f0c06bf017fe77f88
2017-08-24 20:12:05 +01:00
Felipe Monteiro
b5a7de448e Add bandit job to Deckhand
Added bandit job to Deckhand's tox.ini.

Change-Id: Iac57ee58e1eda7872091c53401c3d46d1737da78
2017-08-16 14:53:38 +01:00
Felipe Monteiro
6c70cbdbfe Add Deckhand coverage job
This commits adds a Deckhand coverage job for gauging the test
coverage of Deckhand to tox.ini.

Change-Id: If3cb7b31127dd5cd58c7a3f8dc87f1f7a4f74101
2017-08-15 16:11:35 -04:00
Felipe Monteiro
6e2238c3d8 Fix flake8 errors
This commit fixes flake8 errors and fixes a minor bug related to
a schema version being v1 rather than v1.0.

OpenStack hacking rules are used to pin down flake8 to sane
standards using [0].

[0] 06e676c461/test-requirements.txt (L5)

Change-Id: Ib236df6f5ec9505c0e635f0faa9877d3397a2e55
2017-08-14 20:48:14 +01:00
Felipe Monteiro
874026bb1a Add jsonschema validation to Deckhand
Previously Deckhand was using manual validation of YAML files.
However, schema validation is much cleaner, robust and thorough.
So, this commit adds jsonschema as a dependence in Deckhand.
Tempest already uses it as a dependence as well -- so a precedence
already exists.

This commit also updates unit tests as needed. Documentation
changes will be made in a follow-up patch.
2017-07-10 21:34:35 +01:00
Felipe Monteiro
a7d1f0e2f4 Initial engine framework
This commit adds the initial engine framework for Deckhand. Included
is the logic for parsing YAML files as well as validating them and
doing forward substitution as specified by the YAML file.

This commit also includes unit tests for the framework changes.
2017-07-10 19:47:24 +01:00
Felipe Monteiro
00bb92561d DECKHAND-2: Design core Deckhand API framework
This commit implements the core Deckhand API framework.
It does not implement any real API routes. The core
framework is modeled after Drydock's [0].

This commit specifically:

  - implements the core API framework which uses falcon
  - implements errors.py for preliminary errors
  - implements base resource class from which other API
    resources will inherit to build out the API itself
  - implements base API router
  - implements entry-point for kicking off deckhand
  - updates base README.rst with instructions on
  - running and installing -- similar to Drydock's
  - implements dummy API resource for secrets, to
    be fleshed out further in a follow-up commit

[0] https://github.com/att-comdev/drydock
2017-06-27 19:26:51 +01:00
Felipe Monteiro
eab524abd8 Oslo config integration (#1)
* DECKHAND-11: Add oslo.config integration to Deckhand

This commit adds oslo.config integration to Deckhand. It also
creates a lot of preliminary files/configuration settings
needed to run tox as well as lint and oslo-config-generator
jobs.

* Remove sample config file.
2017-06-26 16:57:50 -07:00