Experimental extension of the activitypub-testsuite for testing onepage.pub.
This repository contains onepage.pub-specific code and configuration. The test framework starts a Node.js subprocess at the beginning of a test session. Before each test, a custom test reset API is called to reset the onepage.pub database.
- 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 onepage-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
onepage-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/onepage-aptesting
Note
The onepage.pub submodule is currently a test-related branch of my onepage.pub
fork. This branch contains several patches to fix issues and add some test-related endpoint (which are subject to change). This project will eventually be using the primary, authoritative repository.
At this point, the directory structure should look similar to the following one.
testing
├── activitypub-testsuite
├── onepage-aptesting
- Change to the
onepage-aptesting
directory and install it. This will do the Python (Poetry) install and runnpm init
in theonepage.pub
submodule (the code being tested).
cd onepage-aptesting
sh install.sh
Run the tests from onepage-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