README.md

Thu, 23 Mar 2023 12:14:53 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Mar 2023 12:14:53 +0000
changeset 172
2c17151ed21b
parent 167
8b322a7eca1e
permissions
-rw-r--r--

client: Fix timeout handling

Previously, the timeout handler would fire an error that would get caught and
logged by the timer code. However that error never reached the upper levels of
scansion, leading to the whole thing just hanging.

Now we just trigger resumption of the async runner, and throw the error from
there if we haven't received the stanza yet.

With this change, timeouts are now correctly handled and reported as failures.

# Scansion - XMPP testing tool

Scansion executes simple scripts containing XMPP stanzas. It sends stanzas
in the script, and awaits the response, and verifies it matches what the
script expects.

You can find some example scripts in the `scripts/` directory.

Scansion is used by the Prosody XMPP server project to provide integration tests, and
has a large number of [Scansion scripts](https://hg.prosody.im/trunk/file/tip/spec/scansion).
While many of the scripts there may test for Prosody-specific behaviour, Scansion itself can
be used with any XMPP server.

## Links

- Documentation can be found at https://matthewwild.co.uk/projects/scansion
- Source code at https://code.matthewwild.co.uk/scansion

## Setup

### Requirements

Scansion requires:

- Lua 5.2
- Verse
- LuaExpat
- LuaCJSON
- LuaSec
- LuaSocket
- LuaFileSystem (optional)

If these are present, a simple 'make' and 'sudo make install' should suffice to install scansion to `/usr/local/bin/`.

### Docker

A Dockerfile is also provided, to allow you to build and run scansion inside a clean environment with all dependencies
installed already.

First, build the image:

```
docker build -t scansion .
```

To run it with a directory of test scripts in ./spec/scansion:

```
docker run -v$PWD/spec/scansion:/scripts scansion
```

To run it as a web server:

```
docker run -p 8007:8007 -v$PWD/spec/scansion:/scripts scansion --serve

```

mercurial