Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
remove docker from tests
Browse files Browse the repository at this point in the history
Signed-off-by: MohammadReza vahedi <[email protected]>
  • Loading branch information
mrvahedi68 committed Sep 2, 2023
1 parent e4644f7 commit c8c1f47
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 156 deletions.
1 change: 0 additions & 1 deletion test/surface/docker/cookie/.dockerignore

This file was deleted.

6 changes: 0 additions & 6 deletions test/surface/docker/cookie/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions test/surface/docker/cookie/app/index.js

This file was deleted.

13 changes: 0 additions & 13 deletions test/surface/docker/cookie/app/package-lock.json

This file was deleted.

14 changes: 0 additions & 14 deletions test/surface/docker/cookie/app/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions test/surface/docker/solid-crud/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion test/surface/docker/web-access-control/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion test/surface/docker/webid-provider/Dockerfile

This file was deleted.

74 changes: 30 additions & 44 deletions test/surface/run-solid-test-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,48 @@
set -e

function setup {
echo Branch name: $1
docker network create testnet
docker build -t server .
docker build -t cookie test/surface/docker/cookie
docker run -d --env-file test/surface/server-env.list --name server --network=testnet server
docker run -d --env-file test/surface/thirdparty-env.list --name thirdparty --network=testnet server
}
function teardown {
docker stop `docker ps --filter network=testnet -q`
docker rm `docker ps --filter network=testnet -qa`
docker network remove testnet
npm ci
npm start &> '/dev/null' &
git clone https://github.com/solid-contrib/solid-crud-tests.git
cd solid-crud-tests
git fetch origin
git checkout nss-skips
git pull
npm ci
cd ..
git clone https://github.com/solid-contrib/web-access-control-tests.git
cd web-access-control-tests
#git fetch origin
#git checkout run-against-css
git pull
npm ci
cd ..
}

function waitForNss {
docker pull solidtestsuite/webid-provider-tests
until docker run --rm --network=testnet solidtestsuite/webid-provider-tests curl -kI http://$1:3000 2> /dev/null > /dev/null
function waitForCss {
until curl -kI http://localhost:3000 2> /dev/null
do
echo Waiting for $1 to start, this can take up to a minute ...
docker ps -a
docker logs $1
echo Waiting for CSS to start, this can take up to a minute ...
sleep 1
done
}

docker logs $1
echo Getting cookie for $1...
export COOKIE_$1="`docker run --cap-add=SYS_ADMIN --network=testnet --env-file test/surface/$1-env.list cookie`"
function teardown {
kill $(lsof -t -i :3000)
rm -rf solid-crud-tests web-access-control-tests
}

function runTests {
docker pull solidtestsuite/$1:$2

echo "Running $1 against server with cookie $COOKIE_server"
docker run --rm --network=testnet \
--env COOKIE="$COOKIE_server" \
--env COOKIE_ALICE="$COOKIE_server" \
--env COOKIE_BOB="$COOKIE_thirdparty" \
--env-file test/surface/$1-env.list solidtestsuite/$1:$2
cd $1
./run-against-css.sh
cd ..
}

# ...
teardown || true
setup $1
waitForNss server
#runTests webid-provider-tests v2.0.3
runTests solid-crud-tests v6.0.0
#waitForNss thirdparty
#runTests web-access-control-tests v7.1.0
setup
waitForCss
runTests solid-crud-tests
runTests web-access-control-tests
teardown

# To debug, e.g. running web-access-control-tests jest interactively,
# comment out `teardown` and uncomment this instead:
# env
# docker run -it --network=testnet \
# --env COOKIE="$COOKIE_server" \
# --env COOKIE_ALICE="$COOKIE_server" \
# --env COOKIE_BOB="$COOKIE_thirdparty" \
# --env-file test/surface/web-access-control-tests-env.list \
# solidtestsuite/web-access-control-tests:latest /bin/bash

5 changes: 0 additions & 5 deletions test/surface/server-env.list

This file was deleted.

5 changes: 0 additions & 5 deletions test/surface/solid-crud-tests-env.list

This file was deleted.

23 changes: 0 additions & 23 deletions test/surface/thirdparty-config.json

This file was deleted.

6 changes: 0 additions & 6 deletions test/surface/thirdparty-env.list

This file was deleted.

4 changes: 0 additions & 4 deletions test/surface/webid-provider-tests-env.list

This file was deleted.

0 comments on commit c8c1f47

Please sign in to comment.