Skip to content

Commit a7056bd

Browse files
committed
More concessions to try and get things working in CI
1 parent b47d2ac commit a7056bd

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

transcripts/share-apis/notifications/check-delivery-methods.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
{
1212
"config": {
1313
"id": "NW-<UUID>",
14-
"url": "http://localhost:9999"
14+
"url": "http://<HOST>:9999/good-webhook"
1515
},
1616
"kind": "webhook"
1717
},
1818
{
1919
"config": {
2020
"id": "NW-<UUID>",
21-
"url": "http://localhost:9999/invalid?x-set-response-status-code=500"
21+
"url": "http://<HOST>:9999/invalid?x-set-response-status-code=500"
2222
},
2323
"kind": "webhook"
2424
}

transcripts/share-apis/notifications/run.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ subscription_id=$(fetch_data_jq "$test_user" POST create-subscription-for-projec
1818
}" )
1919

2020
webhook_id=$(fetch_data_jq "$test_user" POST create-webhook '/users/test/notifications/delivery-methods/webhooks' '.webhookId' "{
21-
\"url\": \"http://http-echo:${echo_server_port}\"
21+
\"url\": \"${echo_server}/good-webhook\"
2222
}" )
2323

2424
failing_webhook_id=$(fetch_data_jq "$test_user" POST create-webhook '/users/test/notifications/delivery-methods/webhooks' '.webhookId' "{
25-
\"url\": \"http://http-echo:${echo_server_port}/invalid?x-set-response-status-code=500\"
25+
\"url\": \"${echo_server}/invalid?x-set-response-status-code=500\"
2626
}" )
2727

2828
fetch "$test_user" POST add-webhook-to-subscription "/users/test/notifications/subscriptions/${subscription_id}/delivery-methods/add" "{

transcripts/transcript_helpers.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ ucm_credentials_file="${ucm_xdg_data_dir}/unisonlanguage/credentials.json"
1010
# Executable to use when running unison transcripts
1111
export UCM_PATH="${1:-"$(which ucm)"}"
1212
export echo_server_port=9999
13+
export echo_server="http://localhost:${echo_server_port}"
14+
# if CI=true, change the echo server url to a url from the docker network.
15+
if [ "${CI:-false}" = "true" ]; then
16+
export echo_server="http://echo-server:${echo_server_port}"
17+
fi
1318

1419
# UCM to use within transcripts
1520
transcript_ucm() {
@@ -111,7 +116,10 @@ clean_for_transcript() {
111116
# Replace all cursors in stdin with the string "<CURSOR>"
112117
sed -E 's/"cursor": ?"[^"]+"/"cursor": "<CURSOR>"/g' | \
113118
# Replace all JWTs in stdin with the string "<JWT>"
114-
sed -E 's/eyJ([[:alnum:]_.-]+)/<JWT>/g'
119+
sed -E 's/eyJ([[:alnum:]_.-]+)/<JWT>/g' | \
120+
# In docker we network things together with host names, but locally we just use localhost; so
121+
# this normalizes everything in transcripts.
122+
sed -E 's/(localhost|http-echo):/<HOST>:/g'
115123
}
116124

117125
fetch() {

0 commit comments

Comments
 (0)