Files
nova/nova/tests/functional/api_sample_tests
Yikun Jiang 577cb4b2f4 ServerActionsSampleJsonTest refactor
Change the instance action sample to a real world action.

In Setup, we create an instance and then stop it. That would
be 2 actions(create and stop), and the stop action should have
a "compute_stop_instance" event. And then we do 2.1/2.21/2.51
test case based on these actions, like we have done in 2.58.

Change-Id: Iac23a574a05e62a99aab20ffce4265f4fb5a44d9
2018-04-26 09:26:35 +08:00
..
2015-12-03 22:43:26 +00:00
2018-03-09 14:30:10 -05:00
2016-06-30 19:56:14 +00:00
2018-03-09 14:30:10 -05:00
2017-12-12 09:22:21 -05:00
2017-12-12 09:22:21 -05:00
2017-12-12 09:22:21 -05:00
2016-09-23 09:42:39 +00:00

Api Samples

This part of the tree contains templates for API samples. The documentation in doc/api_samples is completely autogenerated from the tests in this directory.

To add a new api sample, add tests for the common passing and failing cases in this directory for your extension, and modify test_samples.py for your tests.

Then run the following command:

tox -e api-samples

Which will create the files on doc/api_samples.

If new tests are added or the .tpl files are changed due to bug fixes, the samples must be regenerated so they are in sync with the templates, as there is an additional test which reloads the documentation and ensures that it's in sync.

Debugging sample generation

If a .tpl is changed, its matching .json must be removed else the samples won't be generated. If an entirely new extension is added, a directory for it must be created before its samples will be generated.