Merge lp:~sharan-monikantan/drizzle/drizzletest-1 into lp:drizzle

Proposed by Sharan Kumar
Status: Merged
Approved by: Brian Aker
Approved revision: 2591
Merged at revision: 2591
Proposed branch: lp:~sharan-monikantan/drizzle/drizzletest-1
Merge into: lp:drizzle
Diff against target: 199 lines (+139/-9)
1 file modified
docs/testing/drizzletest_commands.rst (+139/-9)
To merge this branch: bzr merge lp:~sharan-monikantan/drizzle/drizzletest-1
Reviewer Review Type Date Requested Status
Patrick Crews Approve
Henrik Ingo Pending
Review via email: mp+124557@code.launchpad.net

Description of the change

The following commands of drizzletest commands are documented:
1. append_file
2. cat_file
3. while
4. write_file

Clear explanations with examples and output are documented.

To post a comment you must log in.
Revision history for this message
Henrik Ingo (hingo) wrote :

I reviewed this mainly from a the point of view that proper "clean room engineering" procedures have been followed. As far as I can tell, the answer is yes. Looks ok to me!

Revision history for this message
Sharan Kumar (sharan-monikantan) wrote :

> I reviewed this mainly from a the point of view that proper "clean room
> engineering" procedures have been followed. As far as I can tell, the answer
> is yes. Looks ok to me!

So I ll continue with this work. But since it will take quite a lot of time to complete the entire documentation, can I propose for merge every time I complete about 5 - 10 commands? And will this branch go into the trunk or does it need some more commands to be documented?

Revision history for this message
Henrik Ingo (hingo) wrote :

On Sun, Sep 16, 2012 at 9:15 PM, M.Sharan Kumar
<email address hidden> wrote:
>> I reviewed this mainly from a the point of view that proper "clean room
>> engineering" procedures have been followed. As far as I can tell, the answer
>> is yes. Looks ok to me!
>
> So I ll continue with this work. But since it will take quite a lot of time to complete the entire documentation, can I propose for merge every time I complete about 5 - 10 commands? And will this branch go into the trunk or does it need some more commands to be documented?

Merging immediately when you have something useful is of course a good
idea. Those commands can be useful to someone already, while waiting
for the rest.

henrik

--
<email address hidden>
+358-40-8211286 skype: henrik.ingo irc: hingo
www.openlife.cc

My LinkedIn profile: http://www.linkedin.com/profile/view?id=9522559

Revision history for this message
Patrick Crews (patrick-crews) wrote :

LGTM!
Thanks for taking this on, Shar :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/testing/drizzletest_commands.rst'
2--- docs/testing/drizzletest_commands.rst 2012-07-07 05:20:06 +0000
3+++ docs/testing/drizzletest_commands.rst 2012-09-15 17:21:18 +0000
4@@ -1,9 +1,11 @@
5 Drizzletest Commands
6 ====================
7
8-The commands that are endorsed in Drizzletest are delineated in the following documentation. Examples are given for the commands. Browse **tests/t** for more examples.
9+The commands that are endorsed in Drizzletest are delineated in the following documentation. Examples are given for the commands. Browse **tests/t** for more examples.
10
11-.. note:: The commands are not case sensitive
12+.. note::
13+ The commands are not case sensitive.
14+ All commands must end with semi-colon.
15
16 List of commands
17 ----------------
18@@ -92,10 +94,40 @@
19 :Syntax:
20
21 :program:`append_file file_name [terminator]`
22+
23+:program:`append_file` command is used to append / add data to the end of an existing file. It is similar to :ref:`write_file`. In case, the specified file does not exist, it is created and the data is written on it. The end of data, that is to be appended, is marked by the terminator.
24+
25+.. note:: The default terminator is EOF
26+
27+The ``file_name`` can be substituted via variables.
28
29 :Example:
30
31-.. code-block:: python
32+::
33+
34+ let $MY_FILE = ~/foo/bar.txt;
35+
36+ append_file $MY_FILE;
37+ writing text...
38+ EOF
39+
40+ append_file $MY_FILE;
41+ appending text with default terminator...
42+ EOF
43+
44+ append_file $MY_FILE stop
45+ appending text with `stop` terminator...
46+ stop
47+
48+:Output:
49+
50+::
51+
52+ ~/foo/bar.txt:
53+ writing text...
54+ appending text with default terminator...
55+ appending text with `stop` terminator...
56+
57
58 .. _cat_file:
59
60@@ -105,10 +137,34 @@
61 :Syntax:
62
63 :program:`cat_file file_name`
64+
65+:program:`cat_file` is similar to the unix ``cat`` command. cat_file expects only one argument. The ``cat_file`` command reads the file given as its argument and writes its contents to the `test_name`.result file.
66
67+.. note:: If extra argument is passed to cat_file command, the following error is displayed. testname: At line N: Extra argument '/path/to/file/file_name' passed to 'cat_file'
68+
69 :Example:
70
71-.. code-block:: python
72+::
73+
74+ /foo/log.txt:
75+ The test produced the following results:
76+
77+ /tests/t/test_name.test:
78+ let $LOG_RESULT = /foo;
79+ cat_file $LOG_RESULT/log.txt
80+ SELECT 1;
81+
82+:Output:
83+
84+::
85+
86+ /tests/r/test_name.result:
87+ The test produced the following results:
88+ SELECT 1;
89+ 1
90+ 1
91+
92+.. note:: The file_name can be specified via variables. In the example above, we have used LOG_RESULT as variable. We can also specify it as "let $LOG_RESULT = /foo/log.txt" and use it as "cat_file $LOG_RESULT".
93
94 .. _change_user:
95
96@@ -119,6 +175,8 @@
97
98 :program:`change_user [user_name], [password], [db_name]`
99
100+
101+
102 :Example:
103
104 .. code-block:: python
105@@ -1005,9 +1063,44 @@
106
107 :program:`while(expr)`
108
109+:program:`while()` defines an action block which gets executed over a loop. The while command expects a value / variable (expr) which decides whether or not the next iteration has to be carried out. If the value is 0, it is considered as ``false`` and the loop terminates. The body of the while block, which contains the set of statements to be executed repeatedly, should be enclosed within curly braces ``{`` and ``}``.
110+
111+.. note:: Any non-zero value, positive / negative is treated as a true, and the loop gets executed. The expression expr does not support boolean expressions.
112+
113 :Example:
114
115-.. code-block:: python
116+::
117+
118+ /tests/t/testname.test:
119+ let $test=3;
120+ let $iteration=1;
121+ while($test)
122+ {
123+ echo test iteration $iteration;
124+ SELECT 1;
125+ dec $test;
126+ inc $iteration;
127+ }
128+
129+:Output:
130+
131+::
132+
133+ /tests/r/testname.result:
134+ test iteration 1
135+ SELECT 1;
136+ 1
137+ 1
138+ test iteration 2
139+ SELECT 1;
140+ 1
141+ 1
142+ test iteration 3
143+ SELECT 1;
144+ 1
145+ 1
146+
147+.. note:: Ensure that, the expr value becomes zero at some point of time. Else, the loop gets executed infinitely and the test gets stalled.
148
149 .. _write_file:
150
151@@ -1018,8 +1111,45 @@
152
153 :program:`write_file file_name [terminator]`
154
155-:Example:
156-
157-.. code-block:: python
158-
159+:program:`write_file` command is write data to the file specified by ``file_name``. When this command is issued, a file with the name as ``file_name`` is created and data is written to it. The end of the data, that is to be written, is marked by the terminator.
160+
161+.. note:: If the file exists, it is not considered as error / the test will not fail. Instead, the contents of the file will be replaced by the data that is to be written.
162+
163+The ``file_name`` can be substituted via variables.
164+
165+:Example:
166+
167+::
168+
169+ let $MY_FILE = ~/foo/bar.txt
170+
171+ write_file $MY_FILE;
172+ testing...
173+ EOF
174+
175+:Output:
176+
177+::
178+
179+ ~/foo/bar.txt:
180+ testing...
181+
182+:Example:
183+
184+::
185+
186+ let $MY_FILE = ~/foo/bar.txt
187+
188+ write_file $MY_FILE stop;
189+ testing with test-run...
190+ stop
191+
192+:Output:
193+
194+::
195+
196+ ~/foo/bar.txt:
197+ testing with test-run...
198+
199+.. note:: In the above example, the contents present previously in bar.txt are overwritten
200

Subscribers

People subscribed via source and target branches

to all changes: