Merge "Fix substitution mapping assigned value to nodetemplate"
[parser.git] / docs / testing / testusage.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4
5 Parser tosca2heat test usage
6 ============================
7 1. run tox in tosca-parser sub project
8
9 .. code-block:: bash
10
11     # change directory to tosca-parser
12     cd parser/tosca2heat/tosca-parser
13
14     # run with pep8
15     tox -epep8
16
17     # run unit test
18     tox -epy27
19
20 or
21
22 .. code-block:: bash
23
24     # change directory to tosca-parser
25     cd parser/tosca2heat/tosca-parser
26
27     # run tox
28     tox
29
30
31 2. run tox in heat-translator sub project
32
33 .. code-block:: bash
34
35     # change directory to heat-translator
36     cd parser/tosca2heat/heat-translator
37
38     # run with pep8
39     tox -epep8
40
41     # run unit test
42     tox -epy27
43     tox -epy34
44
45 or
46
47 .. code-block:: bash
48
49     # change directory to heat-translator
50     cd parser/tosca2heat/heat-translator
51
52     # run tox
53     tox
54
55 Parser VeriGraph test usage
56 ===========================
57
58 VeriGraph is accessible via both a RESTfull API and a gRPC interface.
59
60 **RESTful API**
61 In order to run the automatic testing script, you need the
62 following dependencies installed on your python distribution:
63
64 - "requests" python package -> http://docs.python-requests.org/en/master/
65 - "jsonschema" python package -> https://pypi.python.org/pypi/jsonschema
66
67 1. Run the Python tester
68
69 .. code-block:: bash
70
71       cd parser/verigraph/tester
72       python test.py
73
74 2. Run many times (i.e. n-times) each test-case with ant script
75
76 .. code-block:: bash
77
78       cd parser/verigraph
79       ant -f build.xml run-test -Diteration=n
80
81 2. Run many times (i.e. n-times) each test-case by command line
82
83 .. code-block:: bash
84
85       cd parser/verigraph
86       python test.py -iteration n
87
88 **gRPC API**
89
90 1. Compile the code
91
92 .. code-block:: bash
93
94       cd parser/verigraph
95       ant -f buildVeriGraph_gRPC.xml build
96
97 2. Run both client and server
98
99 .. code-block:: bash
100
101       cd parser/verigraph
102       ant -f buildVeriGraph_gRPC.xml run
103
104 3. Run only the testing client
105
106 .. code-block:: bash
107
108       cd parser/verigraph
109       ant -f buildVeriGraph_gRPC.xml run-client
110
111 4. Run only the gRPC server
112
113 .. code-block:: bash
114
115       cd parser/verigraph
116       ant -f buildVeriGraph_gRPC.xml run-server
117
118 5. Run all tests and print out the partial results and global result
119
120 .. code-block:: bash
121
122       cd parser/verigraph
123       # This target has the needed dependencies to compile the code
124       # and run both client and server
125       ant -f buildVeriGraph_gRPC.xml run-test
126
127 Note that the execution of these tests may take up to 1-2 minutes when successful.