-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
476 lines (407 loc) · 14.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Emender — test automation framework</title>
<meta name="description" content="A test presentation framework for testing product documentation">
<meta name="author" content="Jaromir Hradilek, Bara Ancincova">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section data-markdown>
<script type="text/template">
# Emender
### Test your docs like a pro
![Emender logo](images/emender_logo_small.png) <!-- .element: style="border: 0px; background: none;" -->
Bára Ančincová and Jaromír Hradílek
</script>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Test Automation
</script>
</section>
<section data-markdown>
<script type="text/template">
## Why Test Documentation
* Saves a lot of time <!-- .element: class="fragment" data-fragment-index="1" -->
* Ensures better accuracy <!-- .element: class="fragment" data-fragment-index="2" -->
* Prevents regression <!-- .element: class="fragment" data-fragment-index="3" -->
</script>
</section>
<section data-markdown>
<script type="text/template">
## What Can Be Tested
* Broken links <!-- .element: class="fragment" data-fragment-index="1" -->
* Invalid packages <!-- .element: class="fragment" data-fragment-index="2" -->
* Missing manual pages <!-- .element: class="fragment" data-fragment-index="3" -->
* Completeness <!-- .element: class="fragment" data-fragment-index="4" -->
* Release readiness <!-- .element: class="fragment" data-fragment-index="5" -->
* Style guide violations <!-- .element: class="fragment" data-fragment-index="6" -->
* … <!-- .element: class="fragment" data-fragment-index="7" -->
</script>
</section>
<section>
<h2>Example Implementation</h2>
<pre><code data-trim>
#!/bin/bash
for link in `sed -ne 's/.*ulink url="\([^"]\+".*/\1/p' "$1"`; do
curl -4ILfks "$link"
done
</code></pre>
<pre class="fragment" data-fragment-index="1"><code data-trim>
$ ./testLinks.sh Managing_Services_with_systemd.xml
sed: -e expression #1, char 32: Unmatched ( or \(
</code></pre>
</section>
<section>
<h2>2 Minutes Later</h2>
<pre><code data-trim>
#!/bin/bash
for link in `sed -ne 's/.*ulink url="\([^"]\+\)".*/\1/p' "$1"`; do
curl -4ILfks "$link"
done
</code></pre>
<pre class="fragment" data-fragment-index="1"><code data-trim>
$ ./testLinks.sh Managing_Services_with_systemd.xml
HTTP/1.1 200 OK
Server: Apache
Last-Modified: Tue, 01 Sep 2015 07:53:09 GMT
ETag: "70b4f4-1a550-51eaad74d6340"
X-Cnection: close
Content-Type: text/html; charset=UTF-8
Date: Sun, 08 Nov 2015 02:52:44 GMT
Connection: keep-alive
</code></pre>
</section>
<section>
<h2>5 Minutes Later</h2>
<pre><code data-trim>
#!/bin/bash
for link in `sed -ne 's/.*ulink url="\([^"]\+\)".*/\1/p' "$1"`; do
echo -n "$link "
curl -4ILfks "$link" &&gt;/dev/null \
&& echo '[ OK ]' \
|| echo '[ FAIL ]'
done
</code></pre>
<pre class="fragment" data-fragment-index="1"><code data-trim>
$ ./testLinks.sh Managing_Services_with_systemd.xml
https://access.redhat.com/ [ OK ]
https://acces.redhat.com/ [ FAIL ]
https://access.redhat.com/ [ OK ]
https://access.redhat.com/ [ OK ]
https://docs.fedoraproject.org/ [ OK ]
</code></pre>
</section>
<section>
<h2>10 Minutes Later</h2>
<pre><code data-trim>
#!/bin/bash
for link in `xmlstarlet sel -t -v '//ulink/@url' 2>/dev/null "$1"`; do
echo -n "$link "
curl -4ILfks "$link" &&gt;/dev/null \
&& echo '[ OK ]' \
|| echo '[ FAIL ]'
done
</code></pre>
<pre class="fragment" data-fragment-index="1"><code data-trim>
$ ./testLinks.sh Managing_Services_with_systemd.xml
https://access.redhat.com/ [ OK ]
https://acces.redhat.com/ [ FAIL ]
https://access.redhat.com/ [ OK ]
https://access.redhat.com/ [ OK ]
</code></pre>
</section>
<section>
<h2>15 Minutes Later</h2>
<pre><code data-trim>
#!/bin/bash
function print_links {
xmlstarlet sel -t -v '//ulink/@url' 2>/dev/null "$1" | \
sort -u | sed '/^$/d'
}
function check_link {
curl --connect-timeout 5 --retry 3 \
-4ILfks "$1" &>/dev/null
}
function print_status {
if check_link "$1"; then
echo "[ PASS ] $1"
else
echo "[ FAIL ] $1"
fi
}
export -f print_status check_link
print_links "$1" | \
xargs -n 1 -P 0 bash -c 'print_status "$@"' --
</code></pre>
</section>
<section data-markdown>
<script type="text/template">
## Few Hours Later...
![Script output](images/check-links.png)
```
$ wc -l check-links
387 check-links
```
<!-- .element: class="fragment" data-fragment-index="1" -->
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
![Emender Logo](images/emender_logo_green.png) <!-- .element: style="border: 0px; background: none;" -->
</script>
</section>
<section data-markdown>
<script type="text/template">
## What Is Emender?
##### emend (verb) <!-- .element: class="fragment" data-fragment-index="1" -->
* to revise and correct a piece of writing before it is printed <!-- .element: class="fragment" data-fragment-index="2" -->
##### emender (noun) <!-- .element: class="fragment" data-fragment-index="1" -->
* one who emends <!-- .element: class="fragment" data-fragment-index="2" -->
test automation framework designed specifically for product documentation <!-- .element: class="fragment" data-fragment-index="3" -->
</script>
</section>
<section data-markdown>
<script type="text/template">
### What's in It for Me?
All you need to do is to write a test and Emender does the rest: <!-- .element: class="fragment" data-fragment-index="1" -->
* parses the source code <!-- .element: class="fragment" data-fragment-index="2" -->
* handles return values <!-- .element: class="fragment" data-fragment-index="3" -->
* handles the output (HTML, XML, or plain text) <!-- .element: class="fragment" data-fragment-index="4" -->
* and makes the implematation much easier <!-- .element: class="fragment" data-fragment-index="5" -->
</script>
</section>
<section data-background="images/chuck.gif">
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## How to Use It?
![Baby](images/baby.jpg)
</script>
</section>
<section data-markdown>
<script type="text/template">
### Command-line Interface
```
$ emend [options] [-o output_file] [test_file]
```
```
--Xparam=value
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## Time for Practical Examples!
![fran_work](images/fran_work.gif)
</script>
</section>
<section data-markdown>
<script type="text/template">
### Useful Options
| Option | Description |
|-------------|--------------------------------|
| -c, --color | enables colored output |
| -l, --list | lists available tests and exit |
| -D, --debug | enables debugging information |
| -h, --help | prints help |
For more, see the **emend**(1) manual page.
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Writing a Test
</script>
</section>
<section data-markdown>
<script type="text/template">
## Getting Started
* Tests are written in Lua <!-- .element: class="fragment" data-fragment-index="1" -->
* Tests are implemented as Lua classes <!-- .element: class="fragment" data-fragment-index="2" -->
* Tests are typically stored in the "test" directory <!-- .element: class="fragment" data-fragment-index="3" -->
</script>
</section>
<section data-markdown>
<script type="text/template">
## A Typical Test Consists Of
* A class definition <!-- .element: class="fragment" data-fragment-index="1" -->
* Metadata (description, authors, tags) <!--.element: class="fragment" data-fragment-index="2" -->
* List of dependencies <!--.element: class="fragment" data-fragment-index="3" -->
* A setup method <!-- .element: class="fragment" data-fragment-index="4" -->
* A clean-up method <!-- .element: class="fragment" data-fragment-index="5" -->
* One or more test methods <!-- .element: class="fragment" data-fragment-index="6" -->
* Any other methods <!-- .element: class="fragment" data-fragment-index="7" -->
</script>
</section>
<section data-markdown>
<script type="text/template">
## A Class Definition
```
TestLinks = {
metadata = {
description = "Verify that external links work.",
authors = "Jaromir Hradilek",
emails = "[email protected]",
changed = "2015-11-07",
tags = {"DocBook", "Sanity"},
},
requires = {"curl", "xmlstarlet"}
}
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## A Setup Method
```
function TestLinks.setUp()
local file = "en-US/Managing_Services_with_systemd.xml"
local command = "xmlstarlet sel -t -v '//ulink/@url' 2>/dev/null " ..
file .. " | sort -u | sed '/^$/d'"
TestLinks.links = execCaptureOutputAsTable(command)
end
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## A Clean-Up Method
```
function TestLinks.tearDown()
-- Nothing to do here
end
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## A Test Method
```
function TestLinks.testExternalLinks()
for _, link in ipairs(TestLinks.links) do
is_true(TestLinks.isWorking(link), link)
end
end
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## Other Methods
```
function TestLinks.isWorking(link)
local command = "curl --connect-timeout 5 --retry 3 " ..
"-4ILfks " .. link .. " &>/dev/null;" ..
"echo $?"
local result = execCaptureOutputAsString(command)
if result == "0" then
return true
else
return false
end
end
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## Example Output
![Test Results](images/TestLinks.png)
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Continuous Integration with Jenkins
![Jenkins Logo](images/jenkins_logo.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
### Continuous Integration
> "Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies to a shared mainline several times a day." ([Wikipedia]("https://en.wikipedia.org/wiki/Continuous_integration"))
<blockquote class="fragment" data-fragment-index="1">"Later elaborations of the concept introduced build servers, which automatically ran the unit tests periodically or even after every commit and report the results to the developers." ([Wikipedia]("https://en.wikipedia.org/wiki/Continuous_integration"))</blockquote>
</script>
</section>
<section data-markdown>
<script type="text/template">
### Jenkins — Integration Server
![Jenkins](images/jenkins_output.png)
</script>
</section>
</section>
<section data-markdown>
<script type="text/template">
## What Did We Learn?
</script>
</section>
<section>
<section data-markdown>
<script type="text/template">
![Thank You](images/thank_you.jpg)
</script>
</section>
<section data-markdown>
<script type="text/tempalte">
## Get in Touch:
Join the [Emender]("https://github.com/emender/") project on GitHub
Contact us: [[email protected]](mailto:[email protected]) or [[email protected]](mailto:[email protected])
</script>
</section>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>