Experimental extension of the activitypub-testsuite for testing activitypub-express.
This repository contains activitypub-express test support code and configuration. The activitypub-express
software is a library for building AP servers. For testing, the library is used to create a small AP server with some test control endpoints and additional diagnostic output. It also installs a custom in-memory IApexStore
implementation instead of using the MongoDB store. The test server code is in the apex_aptesting/app
subdirectory.
- MacOS or Linux
- Python 3.11+
- Node.js 16+
The project is currently configured to expect the activitypub-testsuite
repository in a sibling directory. In the future, this may be modified to include activitypub-testsuite
as a git submodule in the apex-aptesting
testing repository.
-
Create a directory to hold the repositories,
testing
, for example, but the name doesn't matter. -
Clone the
activitypub-testsuite
into that directory and install it.
git clone https://github.com/steve-bate/activitypub-testsuite.git
cd activitypub-testsuite/
poetry install
cd -
- Clone the
apex-aptesting
repository into thetesting
directory (a sibling of the previous repository). Note the special submodule-related argument to clone.
git clone --recurse-submodules https://github.com/steve-bate/apex-aptesting
At this point, the directory structure should look similar to the following one.
testing
├── activitypub-testsuite
├── apex-aptesting
- Change to the
apex-aptesting
directory and install it. This will do the Python (Poetry) install and runnpm init
in theactivitypub-express
submodule (the code being tested).
cd apex-aptesting
sh install.sh
Run the tests from apex-aptesting
directory. The tests will run in a Python virtual environment created by Poetry. You will need to run them using
poetry run pytest
or
poetry shell # creates a shell configured with the virtual environment
pytest