From e145b66c14906d40681d6d21f7161e5bb2327739 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 22 Feb 2024 15:52:18 +0000 Subject: [PATCH] chore: detect musl in lib downloader for shasum check, should probably just be an alpine check --- build/download-native-libs.sh | 20 ++++- .../pacts/Fulfilment API-Orders API.json | 84 ++++++++++++++++++- .../data/v2-consumer-integration.json | 2 +- .../data/v3-consumer-integration.json | 2 +- .../data/v3-message-consumer-integration.json | 2 +- .../data/v3-message-integration.json | 2 +- .../data/v3-server-integration.json | 2 +- .../data/v4-combined-integration.json | 2 +- .../data/v4-consumer-integration.json | 2 +- .../data/v4-message-consumer-integration.json | 2 +- 10 files changed, 109 insertions(+), 11 deletions(-) diff --git a/build/download-native-libs.sh b/build/download-native-libs.sh index 081d1207..bb275ad2 100755 --- a/build/download-native-libs.sh +++ b/build/download-native-libs.sh @@ -46,8 +46,24 @@ download_native() { shasum -a 256 --check --quiet "$path/$dest_file.sha256" else sed -Ei "s|../release_artifacts/.+$|$path/$dest_file|" "$path/$dest_file.sha256" - # sha256sum -c -s "$path/$dest_file.sha256" - sha256sum --check --quiet "$path/$dest_file.sha256" + if [[ "$OSTYPE" == "linux"* ]]; then + if ldd /bin/ls >/dev/null 2>&1; then + ldd_output=$(ldd /bin/ls) + case "$ldd_output" in + *musl*) + sha256sum -c -s "$path/$dest_file.sha256" + ;; + *) + sha256sum --check --quiet "$path/$dest_file.sha256" + ;; + esac + else + sha256sum --check --quiet "$path/$dest_file.sha256" + fi + else + sha256sum --check --quiet "$path/$dest_file.sha256" + fi + fi rm "$path/$dest_file.sha256" diff --git a/samples/OrdersApi/Consumer.Tests/pacts/Fulfilment API-Orders API.json b/samples/OrdersApi/Consumer.Tests/pacts/Fulfilment API-Orders API.json index 6f9f4dd6..a1174dd5 100644 --- a/samples/OrdersApi/Consumer.Tests/pacts/Fulfilment API-Orders API.json +++ b/samples/OrdersApi/Consumer.Tests/pacts/Fulfilment API-Orders API.json @@ -88,6 +88,40 @@ }, "type": "Synchronous/HTTP" }, + { + "description": "a request for an order with an unknown ID", + "pending": false, + "request": { + "headers": { + "Accept": [ + "application/json" + ] + }, + "method": "GET", + "path": "/api/orders/404" + }, + "response": { + "status": 404 + }, + "type": "Synchronous/HTTP" + }, + { + "description": "a request for an order with an unknown ID", + "pending": false, + "request": { + "headers": { + "Accept": [ + "application/json" + ] + }, + "method": "GET", + "path": "/api/orders/404" + }, + "response": { + "status": 404 + }, + "type": "Synchronous/HTTP" + }, { "description": "a request to update the status of an order", "pending": false, @@ -131,6 +165,54 @@ }, "type": "Synchronous/HTTP" }, + { + "contents": { + "content": { + "id": 1 + }, + "contentType": "application/json", + "encoded": false + }, + "description": "an event indicating that an order has been created", + "matchingRules": { + "body": { + "$.id": { + "combine": "AND", + "matchers": [ + { + "match": "integer" + } + ] + } + } + }, + "pending": false, + "type": "Asynchronous/Messages" + }, + { + "contents": { + "content": { + "id": 1 + }, + "contentType": "application/json", + "encoded": false + }, + "description": "an event indicating that an order has been created", + "matchingRules": { + "body": { + "$.id": { + "combine": "AND", + "matchers": [ + { + "match": "integer" + } + ] + } + } + }, + "pending": false, + "type": "Asynchronous/Messages" + }, { "contents": { "content": { @@ -158,7 +240,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.17", + "ffi": "0.4.16", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v2-consumer-integration.json b/tests/PactNet.Tests/data/v2-consumer-integration.json index 9f76184a..5e9fef1e 100644 --- a/tests/PactNet.Tests/data/v2-consumer-integration.json +++ b/tests/PactNet.Tests/data/v2-consumer-integration.json @@ -74,7 +74,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v3-consumer-integration.json b/tests/PactNet.Tests/data/v3-consumer-integration.json index fa2df241..d45fd9ac 100644 --- a/tests/PactNet.Tests/data/v3-consumer-integration.json +++ b/tests/PactNet.Tests/data/v3-consumer-integration.json @@ -132,7 +132,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v3-message-consumer-integration.json b/tests/PactNet.Tests/data/v3-message-consumer-integration.json index 0c02ff57..50834bda 100644 --- a/tests/PactNet.Tests/data/v3-message-consumer-integration.json +++ b/tests/PactNet.Tests/data/v3-message-consumer-integration.json @@ -36,7 +36,7 @@ "language": "C#" }, "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v3-message-integration.json b/tests/PactNet.Tests/data/v3-message-integration.json index 85ba4363..e5293499 100644 --- a/tests/PactNet.Tests/data/v3-message-integration.json +++ b/tests/PactNet.Tests/data/v3-message-integration.json @@ -16,7 +16,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v3-server-integration.json b/tests/PactNet.Tests/data/v3-server-integration.json index c9b869c0..98c45635 100644 --- a/tests/PactNet.Tests/data/v3-server-integration.json +++ b/tests/PactNet.Tests/data/v3-server-integration.json @@ -46,7 +46,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v4-combined-integration.json b/tests/PactNet.Tests/data/v4-combined-integration.json index d42e3ff5..60952d55 100644 --- a/tests/PactNet.Tests/data/v4-combined-integration.json +++ b/tests/PactNet.Tests/data/v4-combined-integration.json @@ -187,7 +187,7 @@ "language": "C#" }, "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v4-consumer-integration.json b/tests/PactNet.Tests/data/v4-consumer-integration.json index 11d15825..870b3659 100644 --- a/tests/PactNet.Tests/data/v4-consumer-integration.json +++ b/tests/PactNet.Tests/data/v4-consumer-integration.json @@ -152,7 +152,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": { diff --git a/tests/PactNet.Tests/data/v4-message-consumer-integration.json b/tests/PactNet.Tests/data/v4-message-consumer-integration.json index f5124e0e..687d72a6 100644 --- a/tests/PactNet.Tests/data/v4-message-consumer-integration.json +++ b/tests/PactNet.Tests/data/v4-message-consumer-integration.json @@ -41,7 +41,7 @@ "language": "C#" }, "pactRust": { - "ffi": "0.4.16", + "ffi": "0.4.17", "models": "1.1.19" }, "pactSpecification": {