Commit Graph

32 Commits

Author SHA1 Message Date
Brian C. Lane
85f365bd73 Sort the list of supported output types 2018-06-11 16:54:59 -07:00
Brian C. Lane
1fc7cff52b Add some tests for error conditions. 2018-06-11 16:54:59 -07:00
Brian C. Lane
520439a7c4 Move status to /api/status
Also drops /api/v0/test, and redirects / to /api/docs/

db and schema are fixed at 0 since lorax-composer uses yum, not the bdcs
metadata.db
2018-06-11 16:54:59 -07:00
Brian C. Lane
8c65257a5a Update the tests for the recipe -> blueprint change 2018-06-11 16:54:59 -07:00
Brian C. Lane
c22d05032e Change the tests for /recipes/ routes to /blueprints/ 2018-06-11 16:54:59 -07:00
Brian C. Lane
47a3980b12 Fix some pylint warnings 2018-06-11 16:54:59 -07:00
Brian C. Lane
74326ba7a3 Fix a problem with diff/NEWEST/WORKSPACE
If there is no WORKSPACE yet it was not falling back to using NEWEST.
Also add a test for this.
2018-06-11 16:54:58 -07:00
Alexander Todorov
06648d415a Don't be overly strict when validating /api/docs/ response in tests
this avoids comparing against files on disk (and the huge diff the
test runner produces in case of failure). Instead we look for a
200 HTTP response with large enough size and some well known
strings inside the response data.
2018-06-11 16:54:58 -07:00
Alexander Todorov
af8c193b52 Remove calls to print() 2018-06-11 16:54:58 -07:00
Alexander Todorov
3dd5612732 Fix syntax error caused by conflict resolution 2018-06-11 16:54:58 -07:00
Brian C. Lane
fdecf13299 Add tests for /compose API
Because you cannot share data between test methods these have to all be
in one big function. This adds one series to test the failed compose
results, and a 2nd function to test for the successful compose.
2018-06-11 16:54:58 -07:00
Alexander Todorov
1c977b79ef Add tests for api/server.py
some of the new tests require that we first build the documentation
2018-06-11 16:54:58 -07:00
Brian C. Lane
d3a9ec3002 Return the commit id for the recipe being read
This adds returning the commit id from read_commit, and a new function
read_recipe_and_id() that returns the commit id and the recipe in a
tuple.

If the commit is passed in, it is used as is. If no commit is passed in
it finds the most recent commit for the file on the selected branch and
returns that.

Missing recipes now raise a RecipeError with an informative message.
eg. "No commits for missing-recipe.toml on the master branch."
2018-06-11 16:54:58 -07:00
Brian C. Lane
22c03ceba7 Fix yum config directory creation for projects and server tests 2018-06-11 16:54:58 -07:00
Brian C. Lane
916a001d73 Add support for other branches to the routes
Passing ?branch=<branch-name> will use the specified branch instead of
master.

The new branch will not exist until a /recipes/new?branch=new-branch
POST is made. At that time the branch will be created based on the
current master branch and the new commit will be added to it.
2018-06-11 16:54:58 -07:00
Martin Pitt
176b12dd8c Fix depsolving empty recipes
- Fix `projects_depsolve()` to not consider a successful empty response
   (rc == 0) as an error.
 - Fix recipe_from_dict() to default modules and packages to empty lists
   instead of `None`, to avoid a Python-ism in the API for consumers and
   stay compatible to the bdcs API.

Fixes #290
2018-06-11 16:54:58 -07:00
Brian C. Lane
bae551b7ab Add filtering and glob support to /modules/list route 2018-06-11 16:54:58 -07:00
Brian C. Lane
6b4bf92e7f Add /recipes/freeze route and tests. 2018-06-11 16:54:58 -07:00
Brian C. Lane
b8212358bc Add /recipes/depsolve route and test 2018-06-11 16:54:58 -07:00
Brian C. Lane
a85d0ced8b Add /projects and /modules API tests 2018-06-11 16:54:58 -07:00
Brian C. Lane
d701120d90 Add /recipes/diff route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
a76e95dcb5 Add POST /recipes/tag/ route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
3f4140d5d3 Add POST /recipes/undo route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
c294b7747d Add DELETE /recipes/delete/<recipe_name> route and tests
Also add numbering to the tests so that they are executed in the
expected order.
2018-06-11 16:54:57 -07:00
Brian C. Lane
6e453e70dc Add DELETE /recipes/workspace/<recipe_name> route and tests
This will delete the workspace copy of the recipe.
2018-06-11 16:54:57 -07:00
Brian C. Lane
83e13c4ca8 Add tests for POST /recipes/workspace for JSON and TOML
As a side-effect also tests reading workspace only changes from
/recipes/info
2018-06-11 16:54:57 -07:00
Brian C. Lane
711cdf53b3 Add /recipes/new route and tests
This handles json data when the mime type is "application/json" and toml
recipes when it is "text/x-toml"
2018-06-11 16:54:57 -07:00
Brian C. Lane
3c75711b30 Fix the recipe version bumping
Recipe should have its version bumped based on the version from the
previous commit, and not be bumped on the first commit. Fix the code and
the tests.
2018-06-11 16:54:57 -07:00
Brian C. Lane
02db2afb2b Add /recipes/changes route with tests. 2018-06-11 16:54:57 -07:00
Brian C. Lane
1e7335a506 Add /recipes/info route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
b6fb22133c Add /recipes/list route and tests
Includes adding a lock for access to the git repo from the API.
2018-06-11 16:54:57 -07:00
Brian C. Lane
5b0d662007 Add basic API Server testing framework 2018-06-11 16:54:57 -07:00