Skip to content

Commit

Permalink
issue: libpact_ffi 0.4.20 pact_ffi_mock_server_logs returns null in p…
Browse files Browse the repository at this point in the history
…act-net
  • Loading branch information
YOU54F committed May 30, 2024
1 parent 0996c4e commit 390be96
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 24 deletions.
29 changes: 24 additions & 5 deletions build/download-native-libs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

FFI_VERSION="0.4.16"
FFI_VERSION="0.4.20"
FFI_BASE_URL="https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v$FFI_VERSION"

GREEN="\e[32m"
Expand Down Expand Up @@ -42,11 +42,27 @@ download_native() {

if [[ "$OSTYPE" == "darwin"* ]]; then
# OSX requires an empty arg passed to -i, but this doesn't work on Lin/Win
sed -Ei '' "s|../release_artifacts/.+$|$path/$dest_file|" "$path/$dest_file.sha256"
sed -Ei '' "s|\*(.*)$|\*$path/$dest_file|" "$path/$dest_file.sha256"
shasum -a 256 --check --quiet "$path/$dest_file.sha256"
else
sed -Ei "s|../release_artifacts/.+$|$path/$dest_file|" "$path/$dest_file.sha256"
sha256sum --check --quiet "$path/$dest_file.sha256"
sed -Ei "s|\*(.*)$|\*$path/$dest_file|" "$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"
Expand All @@ -60,5 +76,8 @@ download_native() {

download_native "pact_ffi" "windows" "x86_64" "dll"
download_native "libpact_ffi" "linux" "x86_64" "so"
download_native "libpact_ffi" "linux" "aarch64" "so"
download_native "libpact_ffi" "linux" "x86_64-musl" "so"
download_native "libpact_ffi" "linux" "aarch64-musl" "so"
download_native "libpact_ffi" "osx" "x86_64" "dylib"
download_native "libpact_ffi" "osx" "aarch64-apple-darwin" "dylib"
download_native "libpact_ffi" "osx" "aarch64-apple-darwin" "dylib"
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "4.0"
Expand Down
5 changes: 4 additions & 1 deletion tests/PactNet.Tests/Drivers/FfiIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ public async Task HttpInteraction_v3_CreatesPactFile()
content.Should().Be(@"{""foo"":42}");

mockServer.MockServerMismatches().Should().Be("[]");

string logs = mockServer.MockServerLogs();
// Issue:- libpact_ffi 0.4.20 pact_ffi_mock_server_logs returns null
// Issue not present in 0.4.19
// https://github.com/pact-foundation/pact-reference/compare/libpact_ffi-v0.4.19...libpact_ffi-v0.4.20
logs.Should().NotBeEmpty();

this.output.WriteLine("Mock Server Logs");
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v2-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-message-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"language": "C#"
},
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-message-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-server-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v4-combined-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
"language": "C#"
},
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "4.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v4-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "4.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v4-message-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"language": "C#"
},
"pactRust": {
"ffi": "0.4.16",
"models": "1.1.19"
"ffi": "0.4.20",
"models": "1.2.0"
},
"pactSpecification": {
"version": "4.0"
Expand Down

0 comments on commit 390be96

Please sign in to comment.