Skip to content

Commit 30e4534

Browse files
committed
fix: Repository for Surface Tests
Picks the repository from where the PR branch exists.
1 parent 8021633 commit 30e4534

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.github/workflows/ci.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
26+
# extract repo name
27+
- run: echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
28+
2529
# extract branch name
2630
- if: github.event_name == 'pull_request'
2731
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
32+
2833
- if: github.event_name != 'pull_request'
2934
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
3035

36+
# print repository
37+
- name: Get repository name
38+
run: echo 'The repository name is' $REPO_NAME
39+
3140
# print branch name
3241
- name: Get branch name
3342
run: echo 'The branch name is' $BRANCH_NAME
@@ -45,7 +54,7 @@ jobs:
4554
- run: npm pack .
4655
- run: npm install -g solid-server-*.tgz
4756
# Run the Solid test-suite
48-
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME
57+
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME $REPO_NAME
4958

5059
# TODO: The pipeline should automate publication to npm, so that the docker build gets the correct version
5160
# This job will only dockerize solid-server@latest / solid-server@<tag-name> from npmjs.com!

test/surface/docker/server/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM node:latest
22
ARG BRANCH=main
3+
ARG REPO=nodeSolidServer/node-solid-server
34
RUN echo Testing branch ${BRANCH} of NSS
4-
RUN git clone https://github.com/nodeSolidServer/node-solid-server
5+
RUN git clone https://github.com/${REPO}
56
WORKDIR node-solid-server
67
RUN git checkout ${BRANCH}
78
RUN git status

test/surface/run-solid-test-suite.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ set -e
33

44
function setup {
55
echo Branch name: $1
6+
echo Repoitory: $2
67
docker network create testnet
7-
docker build -t server --build-arg BRANCH=$1 test/surface/docker/server
8+
docker build -t server --build-arg BRANCH=$1 REPO=$2 test/surface/docker/server
89
docker build -t cookie test/surface/docker/cookie
910
docker run -d --env-file test/surface/server-env.list --name server --network=testnet -v `pwd`:/travis -w /node-solid-server server /travis/bin/solid-test start --config-file /node-solid-server/config.json
1011
docker run -d --env-file test/surface/thirdparty-env.list --name thirdparty --network=testnet -v `pwd`/test/surface:/surface server /node-solid-server/bin/solid-test start --config-file /surface/thirdparty-config.json
@@ -32,7 +33,7 @@ function waitForNss {
3233

3334
function runTests {
3435
docker pull solidtestsuite/$1:$2
35-
36+
3637
echo "Running $1 against server with cookie $COOKIE_server"
3738
docker run --rm --network=testnet \
3839
--env COOKIE="$COOKIE_server" \
@@ -72,4 +73,3 @@ teardown
7273
# --env COOKIE_BOB="$COOKIE_thirdparty" \
7374
# --env-file test/surface/web-access-control-tests-env.list \
7475
# solidtestsuite/web-access-control-tests:latest /bin/bash
75-

0 commit comments

Comments
 (0)