README.md

Thu, 23 Mar 2023 15:12:30 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Mar 2023 15:12:30 +0000
changeset 174
662bd8c5ae28
parent 167
8b322a7eca1e
permissions
-rw-r--r--

Serialize XML in a consistent order by default

This overrides all XML serialization to emit attributes in an ordered form, so
the XML will match across multiple runs. This can be useful for comparing
different runs, or even two stanzas printed in the same run (e.g. if there is
a mismatch).

143
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 # Scansion - XMPP testing tool
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 Scansion executes simple scripts containing XMPP stanzas. It sends stanzas
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 in the script, and awaits the response, and verifies it matches what the
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 script expects.
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 You can find some example scripts in the `scripts/` directory.
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8
167
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
9 Scansion is used by the Prosody XMPP server project to provide integration tests, and
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
10 has a large number of [Scansion scripts](https://hg.prosody.im/trunk/file/tip/spec/scansion).
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
11 While many of the scripts there may test for Prosody-specific behaviour, Scansion itself can
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
12 be used with any XMPP server.
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
13
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
14 ## Links
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
15
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
16 - Documentation can be found at https://matthewwild.co.uk/projects/scansion
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
17 - Source code at https://code.matthewwild.co.uk/scansion
8b322a7eca1e README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents: 143
diff changeset
18
143
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 ## Setup
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 ### Requirements
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 Scansion requires:
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25 - Lua 5.2
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26 - Verse
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 - LuaExpat
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28 - LuaCJSON
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 - LuaSec
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30 - LuaSocket
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 - LuaFileSystem (optional)
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 If these are present, a simple 'make' and 'sudo make install' should suffice to install scansion to `/usr/local/bin/`.
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 ### Docker
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 A Dockerfile is also provided, to allow you to build and run scansion inside a clean environment with all dependencies
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 installed already.
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 First, build the image:
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 ```
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 docker build -t scansion .
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 ```
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 To run it with a directory of test scripts in ./spec/scansion:
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 ```
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 docker run -v$PWD/spec/scansion:/scripts scansion
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 ```
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 To run it as a web server:
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 ```
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55 docker run -p 8007:8007 -v$PWD/spec/scansion:/scripts scansion --serve
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57 ```
28b92d201120 README: Add initial version
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58

mercurial