Skip to content

Commit

Permalink
Integrate the LDP test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
acoburn committed Dec 14, 2018
1 parent 8407884 commit 18dbaff
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ services:
jobs:
include:
- name: "Trellis - Triplestore"
before_install:
- docker-compose --version
- docker-compose -f trellis-compose.yml up -d
before_install: docker-compose -f trellis-compose.yml up -d
script:
- python verify_running.py --baseurl http://localhost/
- python setup.py test -a "--baseurl=http://localhost/"

- name: "Trellis - PostgreSQL"
before_install:
- docker-compose --version
- docker-compose -f trellis-ext-db-compose.yml up -d

script:
- docker ps -a
- python verify_running.py --baseurl http://localhost/
- python setup.py test -a "--baseurl=http://localhost/"
before_install: docker-compose -f trellis-ext-db-compose.yml up -d
script:
- python verify_running.py --baseurl http://localhost/
- python setup.py test -a "--baseurl=http://localhost/"
- docker ps -a
- sh run_ldp_testsuite.sh
- aws s3 cp --include "*.html" --recursive ./report s3://$AWS_BUCKET/ldp/report

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
awscli
requests
backoff
5 changes: 5 additions & 0 deletions resources/basic.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX dc: <http://purl.org/dc/terms/>

<> a ldp:BasicContainer ;
dc:title "Basic Container" .
7 changes: 7 additions & 0 deletions resources/direct.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX dc: <http://purl.org/dc/terms/>

<> a ldp:DirectContainer ;
dc:title "Direct Container" ;
ldp:membershipResource </member_dc> ;
ldp:hasMemberRelation ldp:member .
9 changes: 9 additions & 0 deletions resources/indirect.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX dc: <http://purl.org/dc/terms/>

<> a ldp:IndirectContainer ;
dcterms:title "Indirect Container" ;
ldp:membershipResource </member_ic> ;
ldp:hasMemberRelation ldp:member ;
ldp:insertedContentRelation foaf:primaryTopic .
5 changes: 5 additions & 0 deletions resources/member.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX dc: <http://purl.org/dc/terms/>

<> a ldp:RDFSource ;
dc:title "RDF Resource" .
22 changes: 22 additions & 0 deletions run_ldp_testsuite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Download ldp testsuite
wget --quiet https://www.trellisldp.org/ldp/ldp-testsuite.jar

# Create a basic container
curl -s http://127.0.0.1/ -XPOST -H"Slug: basic" -H"Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel=\"type\"" -H"Content-Type: text/turtle" --data-binary @resources/basic.ttl
java -jar ldp-testsuite.jar --server http://127.0.0.1/basic --basic | grep -v DEBUG
mv report/ldp-testsuite-execution-report.html report/basic.html

# Create a direct container
curl -s http://127.0.0.1/ -XPOST -H"Slug: member_dc" -H"Link: <http://www.w3.org/ns/ldp#RDFSource>; rel=\"type\"" -H"Content-Type: text/turtle" --data-binary @resources/member.ttl
curl -s http://127.0.0.1/ -XPOST -H"Slug: direct" -H"Link: <http://www.w3.org/ns/ldp#DirectContainer>; rel=\"type\"" -H"Content-Type: text/turtle" --data-binary @resources/direct.ttl
java -jar ldp-testsuite.jar --server http://127.0.0.1/direct --direct | grep -v DEBUG
mv report/ldp-testsuite-execution-report.html report/direct.html

# Create an indirect container
curl -i http://127.0.0.1/ -XPOST -H"Slug: member_ic" -H"Link: <http://www.w3.org/ns/ldp#RDFSource>; rel=\"type\"" -H"Content-Type: text/turtle" --data-binary @resources/member.ttl
curl -i http://127.0.0.1/ -XPOST -H"Slug: indirect" -H"Link: <http://www.w3.org/ns/ldp#IndirectContainer>; rel=\"type\"" -H"Content-Type: text/turtle" --data-binary @resources/indirect.ttl
java -jar ldp-testsuite.jar --server http://127.0.0.1/indirect --indirect | grep -v DEBUG
mv report/ldp-testsuite-execution-report.html report/indirect.html

1 change: 1 addition & 0 deletions trellis-ext-db-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
TRELLIS_DB_USERNAME: trellis
TRELLIS_DB_PASSWORD: trellis
TRELLIS_DB_URL: jdbc:postgresql://db/trellis
JAVA_OPTS: "-Dtrellis.http.weak.etag=false -Dtrellis.http.memento.headerdates=false"
ports:
- 80:8080
depends_on:
Expand Down

0 comments on commit 18dbaff

Please sign in to comment.