Surface tests for CRUD and Websockets-pubsub functionality of a pod server
There are two ways to run these tests:
First, add 'https://tester' as a trusted app. Assuming the server has Solid OS as its web interface, the steps are as follows:
Now, get a cookie that will allow this user to silently authenticate. You can use a curl command, for instance for node-solid-server it would POST 'username' and 'password' to /login/password and run the tests, as follows:
npm ci
# The SERVER_ROOT will be used both for webid-oidc discovery and as the base container to run the tests against.
# To use a different base container set STORAGE_ROOT.
export SERVER_ROOT=https://solid-crud-tests-example-1.solidcommunity.net
export USERNAME=solid-crud-tests-example-1
export PASSWORD=123
# This curl command is specific to node-solid-server:
export CURL_RESULT=`curl -i $SERVER_ROOT/login/password -d"username=$USERNAME&password=$PASSWORD" | grep Set-Cookie`
# The COOKIE will be used when going through the webid-oidc flow:
export COOKIE=`expr "$CURL_RESULT" : '^Set-Cookie:\ \(.*\).'`
echo Server root is $SERVER_ROOT
echo Cookie is $COOKIE
npm run jest
# Or: ./node_modules/.bin/jest --timeout=60000
You should see something like:
Tests: 17 failed, 55 passed, 62 total
You can also harvest the cookie using your web browser's developer tools instead of curl.
Or for instance for programmatically getting a cookie for Nextcloud, our test suites use Puppeteer.
Set it into the COOKIE env var, set the SERVER_ROOT, and run npm run jest.
If you run against a container with public read/write access, then it's not necessary to add https://tester as a trusted app. Instead (assuming the server has Solid OS as its web interface):
Now you can run without a COOKIE environment variable:
npm install
export SERVER_ROOT=https://solid-crud-tests-example-2.solidcommunity.net/test-folder/
npm run jest
Start your server with a self-signed cert on port 443 of localhost and run with:
export NODE_TLS_REJECT_UNAUTHORIZED=0
export SERVER_ROOT=https://localhost
By specifying the SKIP_WPS environment variable you can make
all websockets-pubsub related tests be skipped. This means you
don't get distracted by failing tests if you simply did not implement
that part of the Solid spec yet, and only want to test the https part of
your server's behaviour.
Content type
Image
Digest
Size
437.3 MB
Last updated
over 5 years ago
docker pull solidtestsuite/solid-crud-tests