Skip to content

Commit b880f05

Browse files
committed
Fix SSO compose and add database Hurl flows
1 parent 84e0ace commit b880f05

6 files changed

Lines changed: 111 additions & 10 deletions

File tree

examples/handle-404/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/handle-404/test.hurl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
GET http://localhost:8080/api/
2+
HTTP 200
3+
[Asserts]
4+
body contains "Welcome to the API"
5+
body contains "Back home"
6+
body not contains "An error occurred"
7+
8+
GET http://localhost:8080/api/does/not/actually/exist
9+
HTTP 200
10+
[Asserts]
11+
body htmlUnescape contains "\"serving_file\":\"api/404.sql\""
12+
body htmlUnescape contains "\"request_path\":\"/api/does/not/actually/exist\""
13+
body contains "Back home"
14+
body not contains "An error occurred"

examples/mysql json handling/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
GET http://localhost:8080
2+
HTTP 200
3+
[Asserts]
4+
header "Content-Type" contains "text/html"
5+
xpath "//html" exists
6+
xpath "//body" exists
7+
body not contains "An error occurred"
8+
9+
POST http://localhost:8080/
10+
Content-Type: application/x-www-form-urlencoded
11+
[FormParams]
12+
Name: Hurl Analysts
13+
HTTP 200
14+
[Asserts]
15+
body contains "Hurl Analysts"
16+
body not contains "An error occurred"
17+
18+
POST http://localhost:8080/
19+
Content-Type: application/x-www-form-urlencoded
20+
[FormParams]
21+
Name: Hurl Reviewers
22+
HTTP 200
23+
[Captures]
24+
analysts_id: xpath "string(//select[@name='Memberships[]']/option[normalize-space(.)='Hurl Analysts']/@value)"
25+
reviewers_id: xpath "string(//select[@name='Memberships[]']/option[normalize-space(.)='Hurl Reviewers']/@value)"
26+
[Asserts]
27+
body contains "Hurl Reviewers"
28+
body not contains "An error occurred"
29+
30+
POST http://localhost:8080/
31+
Content-Type: application/x-www-form-urlencoded
32+
`UserName=Hurl+User&Memberships%5B%5D={{analysts_id}}&Memberships%5B%5D={{reviewers_id}}`
33+
HTTP 200
34+
[Asserts]
35+
body contains "Hurl User"
36+
body htmlUnescape contains "Hurl Analysts,Hurl Reviewers"
37+
body not contains "An error occurred"

examples/single sign on/docker-compose.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ services:
3434
build:
3535
context: .
3636
dockerfile: keycloak.Dockerfile
37-
environment:
38-
- KEYCLOAK_ADMIN=admin
39-
- KEYCLOAK_ADMIN_PASSWORD=admin
4037
volumes:
4138
- ./keycloak-configuration.json:/opt/keycloak/data/import/realm.json
4239
network_mode: host

examples/single sign on/docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ services:
2828
build:
2929
context: .
3030
dockerfile: keycloak.Dockerfile
31-
environment:
32-
- KEYCLOAK_ADMIN=admin
33-
- KEYCLOAK_ADMIN_PASSWORD=admin
3431
volumes:
3532
- ./keycloak-configuration.json:/opt/keycloak/data/import/realm.json
3633
network_mode: host

examples/todo application (PostgreSQL)/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
GET http://localhost:8080/
2+
HTTP 200
3+
[Asserts]
4+
body contains "Todo"
5+
body contains "Add new todo"
6+
body not contains "An error occurred"
7+
8+
POST http://localhost:8080/todo_form.sql
9+
[FormParams]
10+
todo: Created by Hurl
11+
HTTP 302
12+
[Asserts]
13+
header "Location" == "/"
14+
15+
GET http://localhost:8080/
16+
HTTP 200
17+
[Captures]
18+
todo_id: xpath "substring-after(string((//a[contains(@href, 'todo_form.sql?todo_id=')])[last()]/@href), 'todo_id=')"
19+
[Asserts]
20+
body contains "Created by Hurl"
21+
body htmlUnescape contains "todo_form.sql?todo_id={{todo_id}}"
22+
body htmlUnescape contains "delete.sql?todo_id={{todo_id}}"
23+
body not contains "An error occurred"
24+
25+
POST http://localhost:8080/todo_form.sql?todo_id={{todo_id}}
26+
[FormParams]
27+
todo: Edited by Hurl
28+
HTTP 302
29+
[Asserts]
30+
header "Location" == "/"
31+
32+
GET http://localhost:8080/delete.sql?todo_id={{todo_id}}
33+
HTTP 200
34+
[Asserts]
35+
body contains "Confirm deletion"
36+
body contains "Edited by Hurl"
37+
body htmlUnescape contains "?todo_id={{todo_id}}&confirm=yes"
38+
body not contains "An error occurred"
39+
40+
GET http://localhost:8080/delete.sql?todo_id={{todo_id}}&confirm=yes
41+
HTTP 302
42+
[Asserts]
43+
header "Location" == "/"
44+
45+
GET http://localhost:8080/
46+
HTTP 200
47+
[Asserts]
48+
body not contains "Edited by Hurl"
49+
body not contains "An error occurred"

scripts/test-examples-hurl.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ while IFS= read -r -d "" test_file; do
3939
current_compose="$dir/docker-compose.yml"
4040

4141
echo "::group::Testing $rel_dir"
42-
docker compose -p "$current_project" -f "$current_compose" up -d --quiet-pull --build
42+
if ! docker compose -p "$current_project" -f "$current_compose" up -d --quiet-pull --build; then
43+
echo "::error file=$rel_dir/docker-compose.yml,title=Example compose startup failed::$rel_dir failed to start"
44+
echo "::group::docker compose ps for $rel_dir"
45+
docker compose -p "$current_project" -f "$current_compose" ps -a
46+
echo "::endgroup::"
47+
echo "::group::docker compose logs for $rel_dir"
48+
docker compose -p "$current_project" -f "$current_compose" logs
49+
echo "::endgroup::"
50+
echo "::endgroup::"
51+
exit 1
52+
fi
4353
if ! hurl --test \
4454
--retry 60 \
4555
--retry-interval 1s \

0 commit comments

Comments
 (0)