-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MutinyWallet/tony-updates
- Loading branch information
Showing
16 changed files
with
514 additions
and
206 deletions.
There are no files selected for viewing
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 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,188 @@ | ||
base: 'https://vss-staging.fly.dev' | ||
concurrency: 125 | ||
iterations: 2000 | ||
|
||
plan: | ||
- name: Health Check | ||
request: | ||
method: GET | ||
url: /health-check | ||
|
||
# Generate a random UUID and assign it to the test_key variable | ||
- name: Generate unique test key | ||
exec: | ||
command: "echo \"drill_test_$(uuidgen)\"" | ||
assign: test_key | ||
|
||
# Get the Object to fetch the initial version | ||
- name: Get Object Initial (1) - '{{ test_key }}' | ||
request: | ||
method: POST | ||
url: /getObject | ||
body: '{"key": "{{ test_key }}"}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
assign: initial_get_object_response | ||
|
||
- name: Extract and increment version (1) - '{{ test_key }}' | ||
exec: | ||
command: "input='{{ initial_get_object_response.body }}'; [ -z \"$input\" ] && echo 0 || echo \"$input\" | jq '.version? // empty | if type == \"number\" then . + 1 else 0 end'" | ||
assign: version | ||
|
||
- name: Put Objects (1) - '{{ test_key }}' | ||
request: | ||
method: PUT | ||
url: /putObjects | ||
body: '{"transaction_items": [{"key": "{{ test_key }}", "value": [0, 1, 2], "version": {{ version }} }]}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
|
||
- name: Get Object after Put (1) - '{{ test_key }}' | ||
request: | ||
method: POST | ||
url: /getObject | ||
body: '{"key": "{{ test_key }}"}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
assign: get_object_response | ||
|
||
# Basic assertion to make sure we got a good response with the right key | ||
- name: Extract key from response - '{{ test_key }}' | ||
exec: | ||
command: "echo '{{ get_object_response.body }}' | jq '.key'" | ||
assign: retrieved_key | ||
|
||
- name: Compare test_key and retrieved_key - '{{ test_key }}' | ||
exec: | ||
command: "if [ \"{{ test_key }}\" = \"{{ retrieved_key }}\" ]; then echo 'true'; else echo 'false'; fi" | ||
assign: key_comparison_result | ||
|
||
- name: Assert keys match - '{{ test_key }}' | ||
assert: | ||
key: key_comparison_result | ||
value: "true" | ||
|
||
# Compare the version from "Get Object response" with the assigned version | ||
- name: Compare versions with external command (1) - '{{ test_key }}' | ||
exec: | ||
command: "echo '{{ get_object_response.body }}' | jq --arg version '{{ version }}' '.version == ($version | tonumber)'" | ||
assign: version_match_result | ||
|
||
# Assert that the result from the comparison is true | ||
- name: Assert versions match (1) - '{{ test_key }}' | ||
assert: | ||
key: version_match_result | ||
value: "true" | ||
|
||
# | ||
## Do this a 2nd time with a bigger version | ||
# | ||
- name: Extract and increment version (2) - '{{ test_key }}' | ||
exec: | ||
command: "echo $(({{ version }} + 1))" | ||
assign: version | ||
|
||
- name: Put Objects (2) - '{{ test_key }}' | ||
request: | ||
method: PUT | ||
url: /putObjects | ||
body: '{"transaction_items": [{"key": "{{ test_key }}", "value": [0, 1, 2], "version": {{ version }} }]}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
|
||
- name: Get Object after Put (2) - '{{ test_key }}' | ||
request: | ||
method: POST | ||
url: /getObject | ||
body: '{"key": "{{ test_key }}"}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
assign: get_object_response | ||
|
||
# Compare the version from "Get Object response" with the assigned version | ||
- name: Compare versions with external command (2) - '{{ test_key }}' | ||
exec: | ||
command: "echo '{{ get_object_response.body }}' | jq --arg version '{{ version }}' '.version == ($version | tonumber)'" | ||
assign: version_match_result | ||
|
||
# Basic assertion to make sure we got a good response with the right key | ||
- name: Extract key from response - '{{ test_key }}' | ||
exec: | ||
command: "echo '{{ get_object_response.body }}' | jq '.key'" | ||
assign: retrieved_key | ||
|
||
- name: Compare test_key and retrieved_key - '{{ test_key }}' | ||
exec: | ||
command: "if [ \"{{ test_key }}\" = \"{{ retrieved_key }}\" ]; then echo 'true'; else echo 'false'; fi" | ||
assign: key_comparison_result | ||
|
||
- name: Assert keys match - '{{ test_key }}' | ||
assert: | ||
key: key_comparison_result | ||
value: "true" | ||
|
||
# Assert that the result from the comparison is true | ||
- name: Assert versions match (2) - '{{ test_key }}' | ||
assert: | ||
key: version_match_result | ||
value: "true" | ||
|
||
# | ||
## Do this a third time with a bigger version | ||
# | ||
- name: Extract and increment version (3) - '{{ test_key }}' | ||
exec: | ||
command: "echo $(({{ version }} + 1))" | ||
assign: version | ||
|
||
- name: Put Objects (3) - '{{ test_key }}' | ||
request: | ||
method: PUT | ||
url: /putObjects | ||
body: '{"transaction_items": [{"key": "{{ test_key }}", "value": [0, 1, 2], "version": {{ version }} }]}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
|
||
- name: Get Object after Put (3) - '{{ test_key }}' | ||
request: | ||
method: POST | ||
url: /getObject | ||
body: '{"key": "{{ test_key }}"}' | ||
headers: | ||
Content-Type: 'application/json' | ||
Authorization: Bearer {{ AUTH_TOKEN }} | ||
assign: get_object_response | ||
|
||
# Basic assertion to make sure we got a good response with the right key | ||
- name: Extract key from response - '{{ test_key }}' | ||
exec: | ||
command: "echo '{{ get_object_response.body }}' | jq '.key'" | ||
assign: retrieved_key | ||
|
||
- name: Compare test_key and retrieved_key - '{{ test_key }}' | ||
exec: | ||
command: "if [ \"{{ test_key }}\" = \"{{ retrieved_key }}\" ]; then echo 'true'; else echo 'false'; fi" | ||
assign: key_comparison_result | ||
|
||
- name: Assert keys match - '{{ test_key }}' | ||
assert: | ||
key: key_comparison_result | ||
value: "true" | ||
|
||
# Compare the version from "Get Object response" with the assigned version | ||
- name: Compare versions with external command (3) - '{{ test_key }}' | ||
exec: | ||
command: "echo '{{ get_object_response.body }}' | jq --arg version '{{ version }}' '.version == ($version | tonumber)'" | ||
assign: version_match_result | ||
|
||
# Assert that the result from the comparison is true | ||
- name: Assert versions match (3) - '{{ test_key }}' | ||
assert: | ||
key: version_match_result | ||
value: "true" |
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
migrations/2023-09-20-043550_change-default-timestamp/down.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.