This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
366 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
docker build -t hurl-rocket:latest . | ||
docker-compose down | ||
docker-compose up -d | ||
hurl api_tests/implemented/healthz.hurl --retry 60 --variables-file api_tests/hurl.env.test --test | ||
hurl api_tests/implemented/*.hurl --variables-file api_tests/hurl.env.test --test | ||
docker-compose down | ||
lsof -t -i:8090 | xargs -r kill | ||
cargo run & 2>&1 | ||
hurl api_tests/implemented/healthz.hurl --retry 4 --delay 1000 --variables-file api_tests/variables --test | ||
hurl api_tests/implemented/*.hurl {{hurl_opts}} --variables-file api_tests/variables --test | ||
lsof -t -i:8090 | xargs -r kill | ||
echo "Verify done" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
|
||
hurl_opts := "--variables-file api_tests/variables --test" | ||
|
||
# --------------------------------------------------------------------------- | ||
|
||
# waits for healthy | ||
wait-for-api: | ||
hurl api_tests/implemented/healthz.hurl --retry 4 --delay 1000 {{hurl_opts}} | ||
|
||
# run acceptance tests against the running test stack | ||
api-test *args: wait-for-api | ||
hurl api_tests/implemented/*.hurl {{hurl_opts}} {{args}} | ||
|
||
# --------------------------------------------------------------------------- | ||
|
||
run-release: shutdown | ||
just run-q & | ||
|
||
# will run the server without the logs | ||
[no-exit-message] | ||
@run-q *args: | ||
cargo run {{args}} 2>&1 | ||
|
||
# shutdown whatever is running at the port | ||
shutdown: | ||
lsof -t -i:{{SERVER_PORT}} | xargs -r kill | ||
|
||
# --------------------------------------------------------------------------- | ||
# compose the api_test | ||
api_tests: | ||
#!/usr/bin/env bash | ||
just shutdown | ||
just run-release 2>&1 | ||
just api-test | ||
just shutdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
# try to get pokemons | ||
# try to get pokemons html | ||
GET {{target}} | ||
HTTP 200 | ||
|
||
[Asserts] | ||
xpath "string(/html/head/title)" contains "Pokédex" | ||
xpath "string(/html/head/title)" contains "Pokédex" | ||
|
||
# create a pokemon | ||
POST {{target}}/api/pokemons | ||
HTTP 200 | ||
|
||
# create another pokemon | ||
POST {{target}}/api/pokemons | ||
HTTP 200 | ||
|
||
|
||
# body should have 7 pokemon articles | ||
GET {{target}} | ||
HTTP 200 | ||
|
||
[Asserts] | ||
xpath "count(/html/body//div/*)" == 7.0 | ||
xpath "/html/body//div/*" count == 7.0 | ||
|
||
|
||
# create another pokemon | ||
POST {{target}}/api/pokemons | ||
HTTP 200 | ||
|
||
|
||
# should now have 8 pokemons | ||
GET {{target}} | ||
HTTP 200 | ||
|
||
[Asserts] | ||
xpath "/html/body//div/*" count == 8.0 |
2 changes: 1 addition & 1 deletion
2
showcases/rocket/api_tests/hurl.env.test → showcases/rocket/api_tests/variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
target=http://localhost:8002 | ||
target=http://localhost:8090 | ||
token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6IjEyMDkxMDkyOTAifQ.eyJhdWQiOlsibG9jYWwubXlfZG9tYWluLmNvbSJdLCJhenAiOiJkMTlYcDhEWEkxQVE4ZUNjeDdweHM5bkZiUTRUMHUwdCIsImVtYWlsIjoiam9obi5kb2VAb3B0cmF2aXMuY29tIiwiZXhwIjozMjUwMzY3NjQwMCwiaWF0IjowLCJpc3MiOiJodHRwczovL2F1dGgubXlfZG9tYWluLmNvbS8iLCJteV9vdGhlcl9zcGVjaWFsX2NsYWltIjoiaGVsbG8gd29ybGQiLCJuYW1lIjoiSm9obiIsInN1YiI6IjcwZTQ5M2Q5LTg0ZDAtNDliMS05YjYzLWJkNTVmOTVhOTI3ZSJ9.NQQFnHJlL7xiKP-6tk3gYrKpYPW8eVga_u5x6t3-l8U |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
.pokemon { | ||
margin-bottom: 20px; | ||
padding: 15px; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
.pokemon:last-child { | ||
border-bottom: none; | ||
} | ||
|
||
.title{ | ||
margin-top: 8px; | ||
} | ||
|
||
.fixed-container{ | ||
height: 500px; | ||
padding-bottom: 3px; | ||
overflow-y: ; | ||
} | ||
|
||
:root { | ||
--pico-font-family-sans-serif: Inter, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, var(--pico-font-family-emoji); | ||
--pico-font-size: 87.5%; | ||
/* Original: 100% */ | ||
--pico-line-height: 1.25; | ||
/* Original: 1.5 */ | ||
--pico-form-element-spacing-vertical: 0.5rem; | ||
/* Original: 1rem */ | ||
--pico-form-element-spacing-horizontal: 1.0rem; | ||
/* Original: 1.25rem */ | ||
--pico-border-radius: 0.375rem; | ||
/* Original: 0.25rem */ | ||
} | ||
|
||
@media (min-width: 576px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 106.25% */ | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 112.5% */ | ||
} | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 118.75% */ | ||
} | ||
} | ||
|
||
@media (min-width: 1280px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 125% */ | ||
} | ||
} | ||
|
||
@media (min-width: 1536px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 131.25% */ | ||
} | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
--pico-font-weight: 600; | ||
/* Original: 700 */ | ||
} | ||
|
||
article { | ||
border: 1px solid var(--pico-muted-border-color); | ||
/* Original doesn't have a border */ | ||
border-radius: calc(var(--pico-border-radius) * 2); | ||
/* Original: var(--pico-border-radius) */ | ||
} | ||
|
||
article>footer { | ||
border-radius: calc(var(--pico-border-radius) * 2); | ||
/* Original: var(--pico-border-radius) */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
htmx.defineExtension('alpine-morph', { | ||
isInlineSwap: function(swapStyle) { | ||
return swapStyle === 'morph' | ||
}, | ||
handleSwap: function(swapStyle, target, fragment) { | ||
if (swapStyle === 'morph') { | ||
if (fragment.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { | ||
Alpine.morph(target, fragment.firstElementChild) | ||
return [target] | ||
} else { | ||
Alpine.morph(target, fragment.outerHTML) | ||
return [target] | ||
} | ||
} | ||
} | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use rocket::fs::{relative, FileServer, Options}; | ||
|
||
pub fn assets() -> FileServer { | ||
FileServer::new(relative!("/assets"), Options::default()) | ||
} |
Oops, something went wrong.