Skip to content

Commit

Permalink
ci: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Feb 4, 2025
1 parent 175c538 commit ac238a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: fabasoad/setup-prolog-action@v1
- uses: lando/setup-lando@v3
with:
lando-version: 3.21.2
- uses: tpluscode/action-lando-start@v0.2.2
with:
healthcheck: https://read-the-plaque.lndo.site/plaque/newton-s-apple-tree-monash-university
timeout: 60000
ignore-errors: true

- run: curl https://read-the-plaque.lndo.site/plaque/newton-s-apple-tree-monash-university.html -Ifk
- run: docker compose up -d
- run: npm run -w example start &
- run: npx wait-on http://localhost:1429/ -t 30000

- run: lando logs
if: failure()
- run: npx api-tuner example/tests/*.n3 --base-iri http://localhost:1429/
26 changes: 26 additions & 0 deletions example/tests/html-served.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
base <http://localhost:1429/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX earl: <http://www.w3.org/ns/earl#>
PREFIX tuner: <https://api-tuner.described.at/>
prefix : <https://always-read-the-plaque.tests/html/>
prefix string: <http://www.w3.org/2000/10/swap/string#>

:fetchHTML
a earl:TestCase ;
rdfs:label "Check HTML is served" ;
.

:getPage
a tuner:Request ;
tuner:method "GET" ;
tuner:url <plaque/newton-s-apple-tree-monash-university.html> ;
.

{
:getPage tuner:response ?res .

?res tuner:http_code 200 .
?res tuner:header ( "content-type" "text/html.*" string:matches ) .
} => {
:fetchHTML earl:outcome earl:passed .
} .

0 comments on commit ac238a7

Please sign in to comment.