From c60074b9977c0169ab3a1fb3ab84fc41d3892159 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 26 Nov 2024 19:16:02 +0000 Subject: [PATCH] chore: remove stale impl examples and replace with client dsl links --- .github/workflows/release.yml | 11 - .gitignore | 17 - README.md | 19 +- javascript/README.md | 18 - javascript/lib/simple_pact.js | 90 --- javascript/lib/simple_pact_error.js | 167 ---- javascript/package.json | 17 - javascript/yarn.lock | 51 -- php/README.md | 15 - php/composer.json | 28 - ...tor-consumer-area-calculator-provider.json | 102 --- ...consumer-php-area-calculator-provider.json | 102 --- php/pacts/http-consumer-1-http-provider.json | 151 ---- php/pacts/http-consumer-2-http-provider.json | 39 - .../message-consumer-2-message-provider.json | 46 -- php/public/index.php | 34 - php/public/proxy.php | 52 -- php/src/consumer-1.php | 120 --- php/src/consumer-2.php | 86 --- php/src/consumer-plugin.php | 77 -- php/src/provider.php | 113 --- python/.gitignore | 1 - python/Makefile | 33 - python/hello_ffi.py | 7 - python/pact_http_create_mock_server.py | 94 --- .../pact_http_create_mock_server_for_pact.py | 132 ---- python/pact_http_dupe_test.py | 35 - python/pact_message_dupe_test.py | 26 - python/pact_message_v3.py | 85 -- python/pact_plugin_grpc_v4.py | 78 -- python/pact_xml.py | 104 --- python/pacts/Consumer-Alice Service.json | 38 - ...sumer-python-area-calculator-provider.json | 102 --- .../pacts/http-consumer-1-http-provider.json | 154 ---- .../pacts/http-consumer-2-http-provider.json | 42 - ...est-consumer-merge-test-provider-http.json | 106 --- ...-consumer-merge-test-provider-message.json | 86 --- .../message-consumer-2-message-provider.json | 46 -- python/register_ffi.py | 72 -- python/requires.txt | 2 - ruby/detect_os.rb | 89 --- ruby/example_consumer_spec/.rspec | 3 - ruby/example_consumer_spec/.ruby-version | 1 - ruby/example_consumer_spec/Gemfile | 7 - ruby/example_consumer_spec/Gemfile.lock | 45 -- ruby/example_consumer_spec/Rakefile | 5 - .../spec/simple_consumer_spec.rb | 152 ---- .../example_consumer_spec/spec/spec_helper.rb | 14 - ruby/pact_mockserver_mk2/.rspec | 3 - ruby/pact_mockserver_mk2/.ruby-version | 1 - ruby/pact_mockserver_mk2/.travis.yml | 5 - ruby/pact_mockserver_mk2/CODE_OF_CONDUCT.md | 74 -- ruby/pact_mockserver_mk2/Cargo.lock | 730 ------------------ ruby/pact_mockserver_mk2/Cargo.toml | 16 - ruby/pact_mockserver_mk2/Gemfile | 6 - ruby/pact_mockserver_mk2/Gemfile.lock | 42 - ruby/pact_mockserver_mk2/LICENSE.txt | 21 - ruby/pact_mockserver_mk2/README.md | 43 -- ruby/pact_mockserver_mk2/Rakefile | 10 - ruby/pact_mockserver_mk2/bin/console | 14 - ruby/pact_mockserver_mk2/bin/setup | 8 - .../lib/pact/mockserver/mk2.rb | 9 - .../lib/pact/mockserver/mk2/version.rb | 7 - .../lib/pact_mockserver_mk2.rb | 10 - .../pact_mockserver_mk2.gemspec | 37 - .../spec/pact/pact_mockserver_mk2_spec.rb | 7 - ruby/pact_mockserver_mk2/spec/spec_helper.rb | 14 - ruby/pact_mockserver_mk2/src/lib.rs | 60 -- ruby/smoke-test.sh | 24 - ruby/test_ffi.rb | 35 - 70 files changed, 15 insertions(+), 4075 deletions(-) delete mode 100644 javascript/README.md delete mode 100644 javascript/lib/simple_pact.js delete mode 100644 javascript/lib/simple_pact_error.js delete mode 100644 javascript/package.json delete mode 100644 javascript/yarn.lock delete mode 100644 php/README.md delete mode 100644 php/composer.json delete mode 100644 php/pacts/area-calculator-consumer-area-calculator-provider.json delete mode 100644 php/pacts/grpc-consumer-php-area-calculator-provider.json delete mode 100644 php/pacts/http-consumer-1-http-provider.json delete mode 100644 php/pacts/http-consumer-2-http-provider.json delete mode 100644 php/pacts/message-consumer-2-message-provider.json delete mode 100644 php/public/index.php delete mode 100644 php/public/proxy.php delete mode 100644 php/src/consumer-1.php delete mode 100644 php/src/consumer-2.php delete mode 100644 php/src/consumer-plugin.php delete mode 100644 php/src/provider.php delete mode 100644 python/.gitignore delete mode 100644 python/Makefile delete mode 100644 python/hello_ffi.py delete mode 100644 python/pact_http_create_mock_server.py delete mode 100644 python/pact_http_create_mock_server_for_pact.py delete mode 100644 python/pact_http_dupe_test.py delete mode 100644 python/pact_message_dupe_test.py delete mode 100644 python/pact_message_v3.py delete mode 100644 python/pact_plugin_grpc_v4.py delete mode 100644 python/pact_xml.py delete mode 100644 python/pacts/Consumer-Alice Service.json delete mode 100644 python/pacts/grpc-consumer-python-area-calculator-provider.json delete mode 100644 python/pacts/http-consumer-1-http-provider.json delete mode 100644 python/pacts/http-consumer-2-http-provider.json delete mode 100644 python/pacts/merge-test-consumer-merge-test-provider-http.json delete mode 100644 python/pacts/merge-test-consumer-merge-test-provider-message.json delete mode 100644 python/pacts/message-consumer-2-message-provider.json delete mode 100644 python/register_ffi.py delete mode 100644 python/requires.txt delete mode 100644 ruby/detect_os.rb delete mode 100644 ruby/example_consumer_spec/.rspec delete mode 100644 ruby/example_consumer_spec/.ruby-version delete mode 100644 ruby/example_consumer_spec/Gemfile delete mode 100644 ruby/example_consumer_spec/Gemfile.lock delete mode 100644 ruby/example_consumer_spec/Rakefile delete mode 100644 ruby/example_consumer_spec/spec/simple_consumer_spec.rb delete mode 100644 ruby/example_consumer_spec/spec/spec_helper.rb delete mode 100644 ruby/pact_mockserver_mk2/.rspec delete mode 100644 ruby/pact_mockserver_mk2/.ruby-version delete mode 100644 ruby/pact_mockserver_mk2/.travis.yml delete mode 100644 ruby/pact_mockserver_mk2/CODE_OF_CONDUCT.md delete mode 100644 ruby/pact_mockserver_mk2/Cargo.lock delete mode 100644 ruby/pact_mockserver_mk2/Cargo.toml delete mode 100644 ruby/pact_mockserver_mk2/Gemfile delete mode 100644 ruby/pact_mockserver_mk2/Gemfile.lock delete mode 100644 ruby/pact_mockserver_mk2/LICENSE.txt delete mode 100644 ruby/pact_mockserver_mk2/README.md delete mode 100644 ruby/pact_mockserver_mk2/Rakefile delete mode 100755 ruby/pact_mockserver_mk2/bin/console delete mode 100755 ruby/pact_mockserver_mk2/bin/setup delete mode 100644 ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2.rb delete mode 100644 ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2/version.rb delete mode 100644 ruby/pact_mockserver_mk2/lib/pact_mockserver_mk2.rb delete mode 100644 ruby/pact_mockserver_mk2/pact_mockserver_mk2.gemspec delete mode 100644 ruby/pact_mockserver_mk2/spec/pact/pact_mockserver_mk2_spec.rb delete mode 100644 ruby/pact_mockserver_mk2/spec/spec_helper.rb delete mode 100644 ruby/pact_mockserver_mk2/src/lib.rs delete mode 100755 ruby/smoke-test.sh delete mode 100644 ruby/test_ffi.rb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a56e9a27..e3d8c6cef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,17 +114,6 @@ jobs: ${{ steps.cargo-flags.outputs.flags }} working-directory: rust/pact_ffi - - name: Smoke Test FFI library - if: | - github.event_name == 'push' || - github.event_name == 'pull_request' || - github.event_name == 'workflow_dispatch' || - startsWith(github.ref, 'refs/tags/libpact_ffi') - shell: bash - run: | - ./smoke-test.sh ${{ matrix.targets }} - working-directory: ruby - - name: Upload the artifacts if: | startsWith(github.ref, 'refs/tags/libpact_ffi') || diff --git a/.gitignore b/.gitignore index 20636f559..3a8ab2db8 100644 --- a/.gitignore +++ b/.gitignore @@ -27,25 +27,8 @@ autom4te.cache/ .vscode/ tokamak.toml -ruby/*/.bundle/ -ruby/*/.yardoc -ruby/*/_yardoc/ -ruby/*/coverage/ -ruby/*/doc/ -ruby/*/pkg/ -ruby/*/spec/reports/ -ruby/*/tmp/ - -# rspec failure tracking -ruby/*/.rspec_status - build/ -php/vendor/ -php/composer.lock - pkg/ -python/venv/ -python/pacts compatibility-suite/Cargo.lock diff --git a/README.md b/README.md index 341d94888..25e30f49a 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,21 @@ readme](rust/README.md). Requires minimum Rust 1.71.0. This project contains dynamic libraries that expose the core functionality through FFI (Foreign Function Interface). For examples: -* [Javascript](javascript) -* [C](c/consumer-verification) -* [Ruby](ruby/example_consumer_spec) -* [PHP](php) + +* [C - Consumer](c/consumer-verification) +* [C - Provider](c/consumer-verification) +* [Various Languages](https://github.com/YOU54F/hello_ffi) + +For implementations: + +* [Javascript via pact-js-core](https://github.com/pact-foundation/pact-js-core) +* [Ruby via pact-ruby-ffi](https://github.com/YOU54F/pact-ruby-ffi) +* [PHP via pact-php](https://github.com/pact-foundation/pact-php) +* [GoLang via pact-go](https://github.com/pact-foundation/pact-go) +* [.NET via pact-net](https://github.com/pact-foundation/pact-net) +* [Swift via pact-swift](https://github.com/surpher/PactSwift) +* [Dart via pact-dart](https://github.com/matthewshirley/pact_dart) +* [C++ via pact-cplusplus](https://github.com/pact-foundation/pact-cplusplus) ## Building diff --git a/javascript/README.md b/javascript/README.md deleted file mode 100644 index 5e04cf4d0..000000000 --- a/javascript/README.md +++ /dev/null @@ -1,18 +0,0 @@ -To run the JavaScript examples, the pact_ffi Crate (which now also contains the -mock_server) first needs to be built using `cargo build` in the `rust/pact_ffi` -directory. - -This should result in the appropriate library file(s) being created for your OS, -i.e. `rust/target/debug/libpact_ffi.[dll|so|dylib]` - -1. run `npm install` -2. run `npm run simple_pact` - -**NOTE:** This example needs to run on Node 10. - -To change the log level, use the `RUST_LOG` environment variable. I.e., to set -debug level: `RUST_LOG=debug npm run simple_pact` - -To run the failing example: - - $ npm run simple_pact_error diff --git a/javascript/lib/simple_pact.js b/javascript/lib/simple_pact.js deleted file mode 100644 index cca18f9c4..000000000 --- a/javascript/lib/simple_pact.js +++ /dev/null @@ -1,90 +0,0 @@ -var ffi = require('ffi'); -var path = require('path'); -const http = require('http'); -const net = require('net'); -const url = require('url'); - -var dll = '../../rust/target/debug/libpact_ffi'; -var lib = ffi.Library(path.join(__dirname, dll), { - pactffi_create_mock_server: ['int32', ['string', 'string']], - pactffi_mock_server_matched: ['bool', ['int32']], - pactffi_cleanup_mock_server: ['bool', ['int32']] -}); - -var pact = `{ - "provider": { - "name": "Alice Service" - }, - "consumer": { - "name": "Consumer" - }, - "interactions": [ - { - "description": "a retrieve Mallory request", - "request": { - "method": "GET", - "path": "/mallory", - "query": "name=ron&status=good" - }, - "response": { - "status": 200, - "headers": { - "Content-Type": "text/html" - }, - "body": "That is some good Mallory." - } - } - ], - "metadata": { - "pact-specification": { - "version": "1.0.0" - }, - "pact-jvm": { - "version": "1.0.0" - } - } -}`; - -var port = lib.pactffi_create_mock_server(pact, '127.0.0.1:0'); -console.log('Mock server port=' + port); - -if (!lib.pactffi_mock_server_matched(port)) { - console.log("No requests yet, as expected"); -} else { - console.log("Hmm, something smells a bit off."); -} - -var options = { - hostname: 'localhost', - port: port, - path: '/mallory?name=ron&status=good', - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } -}; - -var req = http.request(options, (res) => { - console.log(`STATUS: ${res.statusCode}`); - console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - res.setEncoding('utf8'); - res.on('data', (chunk) => { - console.log(`BODY: ${chunk}`); - }); - res.on('end', () => { - console.log('No more data in response.'); - if (lib.pactffi_mock_server_matched(port)) { - console.log("Mock server matched all requests, Yay!"); - } else { - console.log("We got some mismatches, Boo!"); - } - - lib.pactffi_cleanup_mock_server(port); - }) -}); - -req.on('error', (e) => { - console.log(`problem with request: ${e.message}`); -}); - -req.end(); diff --git a/javascript/lib/simple_pact_error.js b/javascript/lib/simple_pact_error.js deleted file mode 100644 index f631317d2..000000000 --- a/javascript/lib/simple_pact_error.js +++ /dev/null @@ -1,167 +0,0 @@ -var ffi = require('ffi'); -var path = require('path'); -const http = require('http'); -const net = require('net'); -const url = require('url'); - -var dll = '../../rust/target/debug/libpact_ffi'; -var lib = ffi.Library(path.join(__dirname, dll), { - pactffi_create_mock_server: ['int32', ['string', 'string']], - pactffi_mock_server_matched: ['bool', ['int32']], - pactffi_mock_server_mismatches: ['string', ['int32']], - pactffi_cleanup_mock_server: ['bool', ['int32']] -}); - -var pact = `{ - "provider": { - "name": "test_provider" - }, - "consumer": { - "name": "test_consumer" - }, - "interactions": [ - { - "providerState": "test state", - "description": "test interaction", - "request": { - "method": "POST", - "path": "/", - "body": { - "complete": { - "certificateUri": "http://...", - "issues": { - "idNotFound": {} - }, - "nevdis": { - "body": null, - "colour": null, - "engine": null - }, - "body": 123456 - }, - "body": [ - 1, - 2, - 3 - ] - } - }, - "response": { - "status": 200 - } - } - ], - "metadata": { - "pact-specification": { - "version": "2.0.0" - }, - "pact-jvm": { - "version": "" - } - } -}`; - -var port = lib.pactffi_create_mock_server(pact, '127.0.0.1:0'); -console.log("Mock server port=" + port); - -if (!lib.pactffi_mock_server_matched(port)) { - console.log("No requests yet, as expected"); -} else { - console.log("Hmm, something smells a bit off."); -} - -var options = { - hostname: 'localhost', - port: port, - path: '/', - method: 'POST', - headers: { - 'Content-Type': 'application/json' - } -}; - -var request1_done = false; -var request2_done = false; - -var req1 = http.request(options, (res) => { - console.log(`STATUS: ${res.statusCode}`); - console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - res.setEncoding('utf8'); - res.on('data', (chunk) => { - console.log(`BODY: ${chunk}`); - }); - res.on('end', () => { - console.log('No more data in response.'); - request1_done = true; - }) -}); - -req1.on('error', (e) => { - console.log(`problem with request: ${e.message}`); - request1_done = true; -}); -req1.write(JSON.stringify({ - "complete": { - "certificateUri": "http://...", - "issues": {}, - "nevdis": { - "body": "red", - "colour": null, - "engine": null - }, - "body": "123456" - }, - "body": [1, 3] -})); -req1.end(); - -var options2 = { - hostname: 'localhost', - port: port, - path: '/mallory', - method: 'PUT', - headers: { - 'Content-Type': 'application/json' - } -}; - -var req2 = http.request(options2, (res) => { - console.log(`STATUS: ${res.statusCode}`); - console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - res.setEncoding('utf8'); - res.on('data', (chunk) => { - console.log(`BODY: ${chunk}`); - }); - res.on('end', () => { - console.log('No more data in response.'); - request2_done = true; - }) -}); - -req2.on('error', (e) => { - console.log(`problem with request: ${e.message}`); - request2_done = true; -}); -req2.write(JSON.stringify({})); -req2.end(); - -var waitForResult; -waitForResult = function () { - console.log('.'); - if (!request1_done || !request2_done) { - setTimeout(waitForResult, 1000); - } else { - console.log("-----------------------------------------------"); - if (lib.pactffi_mock_server_matched(port)) { - console.log("Mock server matched all requests, That Is Not Good (tm)"); - } else { - console.log("We got some mismatches, as expected."); - var mismatch_json = lib.pactffi_mock_server_mismatches(port); - console.log(mismatch_json); - console.log(); - console.log(JSON.stringify(JSON.parse(mismatch_json), null, 4)); - } - lib.pactffi_cleanup_mock_server(port); - } -}; -setTimeout(waitForResult, 1000); diff --git a/javascript/package.json b/javascript/package.json deleted file mode 100644 index d473475a4..000000000 --- a/javascript/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "pact-reference-js", - "version": "1.0.0", - "description": "Reference implementation of calling pact mock server from JS", - "main": "index.js", - "dependencies": { - "ffi": "^2.3.0" - }, - "devDependencies": {}, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "simple_pact": "node lib/simple_pact.js", - "simple_pact_error": "node lib/simple_pact_error.js" - }, - "author": "", - "license": "ISC" -} diff --git a/javascript/yarn.lock b/javascript/yarn.lock deleted file mode 100644 index 538d7d5ab..000000000 --- a/javascript/yarn.lock +++ /dev/null @@ -1,51 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -bindings@1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" - -bindings@~1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11" - -debug@2: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -ffi@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/ffi/-/ffi-2.3.0.tgz#fa1a7b3d85c0fa8c83d96947a64b5192bc47f858" - integrity sha512-vkPA9Hf9CVuQ5HeMZykYvrZF2QNJ/iKGLkyDkisBnoOOFeFXZQhUPxBARPBIZMJVulvBI2R+jgofW03gyPpJcQ== - dependencies: - bindings "~1.2.0" - debug "2" - nan "2" - ref "1" - ref-struct "1" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -nan@2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - -ref-struct@1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ref-struct/-/ref-struct-1.1.0.tgz#5d5ee65ad41cefc3a5c5feb40587261e479edc13" - dependencies: - debug "2" - ref "1" - -ref@1: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ref/-/ref-1.3.5.tgz#0e33f080cdb94a3d95312b2b3b1fd0f82044ca0f" - dependencies: - bindings "1" - debug "2" - nan "2" diff --git a/php/README.md b/php/README.md deleted file mode 100644 index 56e62c484..000000000 --- a/php/README.md +++ /dev/null @@ -1,15 +0,0 @@ -To run the php examples, the mock server DLL needs to be built using `cargo build` in the `rust/libpact_ffi` directory. - -1. run `composer install` -2. run consumers - 1. `composer consumer-1-matches` - 2. `composer consumer-1-mismatches` - 3. `composer consumer-2-matches` - 4. `composer consumer-2-mismatches` -3. run provider - 1. `composer provider` - -**NOTE:** This example needs to run on PHP >= 7.4. - -To change the log level, use the `LOG_LEVEL` environment variable. I.e., to set -debug level: `LOG_LEVEL=debug composer consumer-1-matches` diff --git a/php/composer.json b/php/composer.json deleted file mode 100644 index f1887ffbc..000000000 --- a/php/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "pact-reference/php", - "description": "Reference implementation of calling pact mock server from PHP", - "license": "MIT", - "authors": [ - { - "name": "Tien Vo", - "email": "tien.xuan.vo@gmail.com" - } - ], - "require": { - "php": ">=7.4", - "ext-ffi": "*", - "ext-json": "*", - "symfony/http-client": "^5.3", - "slim/slim": "^4.8", - "slim/psr7": "^1.4", - "symfony/process": "^5.3" - }, - "scripts": { - "consumer-1-matches": "MATCHING=1 php src/consumer-1.php", - "consumer-1-mismatches": "MATCHING=0 php src/consumer-1.php", - "consumer-2-matches": "MATCHING=1 php src/consumer-2.php", - "consumer-2-mismatches": "MATCHING=0 php src/consumer-2.php", - "consumer-plugin": "MATCHING=1 php src/consumer-plugin.php", - "provider": "php src/provider.php" - } -} diff --git a/php/pacts/area-calculator-consumer-area-calculator-provider.json b/php/pacts/area-calculator-consumer-area-calculator-provider.json deleted file mode 100644 index 7807ac937..000000000 --- a/php/pacts/area-calculator-consumer-area-calculator-provider.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "consumer": { - "name": "area-calculator-consumer" - }, - "interactions": [ - { - "description": "A gRPC calculateOne request", - "interactionMarkup": { - "markup": "```protobuf\nmessage AreaResponse {\n repeated float value = 1;\n}\n```\n", - "markupType": "COMMON_MARK" - }, - "key": "ab98c08a2562ef2e", - "pending": false, - "pluginConfiguration": { - "protobuf": { - "descriptorKey": "a85dff8f82655a9681aad113575dcfbb", - "service": "Calculator/calculateOne" - } - }, - "transport": "grpc", - "request": { - "contents": { - "content": "EgoNAABAQBUAAIBA", - "contentType": "application/protobuf;message=ShapeMessage", - "contentTypeHint": "BINARY", - "encoded": "base64" - }, - "matchingRules": { - "body": { - "$.rectangle.length": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - }, - "$.rectangle.width": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - } - } - } - }, - "response": [ - { - "contents": { - "content": "CgQAAEBB", - "contentType": "application/protobuf;message=AreaResponse", - "contentTypeHint": "BINARY", - "encoded": "base64" - }, - "matchingRules": { - "body": { - "$.value[0].*": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - } - } - } - } - ], - "type": "Synchronous/Messages" - } - ], - "metadata": { - "pact-deno-ffi": { - "ffi": "0.3.15" - }, - "pactRust": { - "ffi": "0.3.15", - "mockserver": "0.9.6", - "models": "1.0.1" - }, - "pactSpecification": { - "version": "4.0" - }, - "plugins": [ - { - "configuration": { - "a85dff8f82655a9681aad113575dcfbb": { - "protoDescriptors": "CsoHChVhcmVhX2NhbGN1bGF0b3IucHJvdG8SD2FyZWFfY2FsY3VsYXRvciK6AgoMU2hhcGVNZXNzYWdlEjEKBnNxdWFyZRgBIAEoCzIXLmFyZWFfY2FsY3VsYXRvci5TcXVhcmVIAFIGc3F1YXJlEjoKCXJlY3RhbmdsZRgCIAEoCzIaLmFyZWFfY2FsY3VsYXRvci5SZWN0YW5nbGVIAFIJcmVjdGFuZ2xlEjEKBmNpcmNsZRgDIAEoCzIXLmFyZWFfY2FsY3VsYXRvci5DaXJjbGVIAFIGY2lyY2xlEjcKCHRyaWFuZ2xlGAQgASgLMhkuYXJlYV9jYWxjdWxhdG9yLlRyaWFuZ2xlSABSCHRyaWFuZ2xlEkYKDXBhcmFsbGVsb2dyYW0YBSABKAsyHi5hcmVhX2NhbGN1bGF0b3IuUGFyYWxsZWxvZ3JhbUgAUg1wYXJhbGxlbG9ncmFtQgcKBXNoYXBlIikKBlNxdWFyZRIfCgtlZGdlX2xlbmd0aBgBIAEoAlIKZWRnZUxlbmd0aCI5CglSZWN0YW5nbGUSFgoGbGVuZ3RoGAEgASgCUgZsZW5ndGgSFAoFd2lkdGgYAiABKAJSBXdpZHRoIiAKBkNpcmNsZRIWCgZyYWRpdXMYASABKAJSBnJhZGl1cyJPCghUcmlhbmdsZRIVCgZlZGdlX2EYASABKAJSBWVkZ2VBEhUKBmVkZ2VfYhgCIAEoAlIFZWRnZUISFQoGZWRnZV9jGAMgASgCUgVlZGdlQyJICg1QYXJhbGxlbG9ncmFtEh8KC2Jhc2VfbGVuZ3RoGAEgASgCUgpiYXNlTGVuZ3RoEhYKBmhlaWdodBgCIAEoAlIGaGVpZ2h0IkQKC0FyZWFSZXF1ZXN0EjUKBnNoYXBlcxgBIAMoCzIdLmFyZWFfY2FsY3VsYXRvci5TaGFwZU1lc3NhZ2VSBnNoYXBlcyIkCgxBcmVhUmVzcG9uc2USFAoFdmFsdWUYASADKAJSBXZhbHVlMq0BCgpDYWxjdWxhdG9yEk4KDGNhbGN1bGF0ZU9uZRIdLmFyZWFfY2FsY3VsYXRvci5TaGFwZU1lc3NhZ2UaHS5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlc3BvbnNlIgASTwoOY2FsY3VsYXRlTXVsdGkSHC5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlcXVlc3QaHS5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlc3BvbnNlIgBCHFoXaW8ucGFjdC9hcmVhX2NhbGN1bGF0b3LQAgFiBnByb3RvMw==", - "protoFile": "syntax = \"proto3\";\n\npackage area_calculator;\n\noption php_generic_services = true;\noption go_package = \"io.pact/area_calculator\";\n\nservice Calculator {\n rpc calculateOne (ShapeMessage) returns (AreaResponse) {}\n rpc calculateMulti (AreaRequest) returns (AreaResponse) {}\n}\n\nmessage ShapeMessage {\n oneof shape {\n Square square = 1;\n Rectangle rectangle = 2;\n Circle circle = 3;\n Triangle triangle = 4;\n Parallelogram parallelogram = 5;\n }\n}\n\nmessage Square {\n float edge_length = 1;\n}\n\nmessage Rectangle {\n float length = 1;\n float width = 2;\n}\n\nmessage Circle {\n float radius = 1;\n}\n\nmessage Triangle {\n float edge_a = 1;\n float edge_b = 2;\n float edge_c = 3;\n}\n\nmessage Parallelogram {\n float base_length = 1;\n float height = 2;\n}\n\nmessage AreaRequest {\n repeated ShapeMessage shapes = 1;\n}\n\nmessage AreaResponse {\n repeated float value = 1;\n}\n" - } - }, - "name": "protobuf", - "version": "0.2.0" - } - ] - }, - "provider": { - "name": "area-calculator-provider" - } -} \ No newline at end of file diff --git a/php/pacts/grpc-consumer-php-area-calculator-provider.json b/php/pacts/grpc-consumer-php-area-calculator-provider.json deleted file mode 100644 index 475995071..000000000 --- a/php/pacts/grpc-consumer-php-area-calculator-provider.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "consumer": { - "name": "grpc-consumer-php" - }, - "interactions": [ - { - "description": "A gRPC calculateOne request", - "interactionMarkup": { - "markup": "```protobuf\nmessage AreaResponse {\n repeated float value = 1;\n}\n```\n", - "markupType": "COMMON_MARK" - }, - "key": "ab98c08a2562ef2e", - "pending": false, - "pluginConfiguration": { - "protobuf": { - "descriptorKey": "a85dff8f82655a9681aad113575dcfbb", - "service": "Calculator/calculateOne" - } - }, - "request": { - "contents": { - "content": "EgoNAABAQBUAAIBA", - "contentType": "application/protobuf;message=ShapeMessage", - "contentTypeHint": "BINARY", - "encoded": "base64" - }, - "matchingRules": { - "body": { - "$.rectangle.length": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - }, - "$.rectangle.width": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - } - } - } - }, - "response": [ - { - "contents": { - "content": "CgQAAEBB", - "contentType": "application/protobuf;message=AreaResponse", - "contentTypeHint": "BINARY", - "encoded": "base64" - }, - "matchingRules": { - "body": { - "$.value[0].*": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - } - } - } - } - ], - "transport": "grpc", - "type": "Synchronous/Messages" - } - ], - "metadata": { - "pact-php": { - "ffi": "0.3.14" - }, - "pactRust": { - "ffi": "0.3.14", - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "4.0" - }, - "plugins": [ - { - "configuration": { - "a85dff8f82655a9681aad113575dcfbb": { - "protoDescriptors": "CsoHChVhcmVhX2NhbGN1bGF0b3IucHJvdG8SD2FyZWFfY2FsY3VsYXRvciK6AgoMU2hhcGVNZXNzYWdlEjEKBnNxdWFyZRgBIAEoCzIXLmFyZWFfY2FsY3VsYXRvci5TcXVhcmVIAFIGc3F1YXJlEjoKCXJlY3RhbmdsZRgCIAEoCzIaLmFyZWFfY2FsY3VsYXRvci5SZWN0YW5nbGVIAFIJcmVjdGFuZ2xlEjEKBmNpcmNsZRgDIAEoCzIXLmFyZWFfY2FsY3VsYXRvci5DaXJjbGVIAFIGY2lyY2xlEjcKCHRyaWFuZ2xlGAQgASgLMhkuYXJlYV9jYWxjdWxhdG9yLlRyaWFuZ2xlSABSCHRyaWFuZ2xlEkYKDXBhcmFsbGVsb2dyYW0YBSABKAsyHi5hcmVhX2NhbGN1bGF0b3IuUGFyYWxsZWxvZ3JhbUgAUg1wYXJhbGxlbG9ncmFtQgcKBXNoYXBlIikKBlNxdWFyZRIfCgtlZGdlX2xlbmd0aBgBIAEoAlIKZWRnZUxlbmd0aCI5CglSZWN0YW5nbGUSFgoGbGVuZ3RoGAEgASgCUgZsZW5ndGgSFAoFd2lkdGgYAiABKAJSBXdpZHRoIiAKBkNpcmNsZRIWCgZyYWRpdXMYASABKAJSBnJhZGl1cyJPCghUcmlhbmdsZRIVCgZlZGdlX2EYASABKAJSBWVkZ2VBEhUKBmVkZ2VfYhgCIAEoAlIFZWRnZUISFQoGZWRnZV9jGAMgASgCUgVlZGdlQyJICg1QYXJhbGxlbG9ncmFtEh8KC2Jhc2VfbGVuZ3RoGAEgASgCUgpiYXNlTGVuZ3RoEhYKBmhlaWdodBgCIAEoAlIGaGVpZ2h0IkQKC0FyZWFSZXF1ZXN0EjUKBnNoYXBlcxgBIAMoCzIdLmFyZWFfY2FsY3VsYXRvci5TaGFwZU1lc3NhZ2VSBnNoYXBlcyIkCgxBcmVhUmVzcG9uc2USFAoFdmFsdWUYASADKAJSBXZhbHVlMq0BCgpDYWxjdWxhdG9yEk4KDGNhbGN1bGF0ZU9uZRIdLmFyZWFfY2FsY3VsYXRvci5TaGFwZU1lc3NhZ2UaHS5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlc3BvbnNlIgASTwoOY2FsY3VsYXRlTXVsdGkSHC5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlcXVlc3QaHS5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlc3BvbnNlIgBCHFoXaW8ucGFjdC9hcmVhX2NhbGN1bGF0b3LQAgFiBnByb3RvMw==", - "protoFile": "syntax = \"proto3\";\n\npackage area_calculator;\n\noption php_generic_services = true;\noption go_package = \"io.pact/area_calculator\";\n\nservice Calculator {\n rpc calculateOne (ShapeMessage) returns (AreaResponse) {}\n rpc calculateMulti (AreaRequest) returns (AreaResponse) {}\n}\n\nmessage ShapeMessage {\n oneof shape {\n Square square = 1;\n Rectangle rectangle = 2;\n Circle circle = 3;\n Triangle triangle = 4;\n Parallelogram parallelogram = 5;\n }\n}\n\nmessage Square {\n float edge_length = 1;\n}\n\nmessage Rectangle {\n float length = 1;\n float width = 2;\n}\n\nmessage Circle {\n float radius = 1;\n}\n\nmessage Triangle {\n float edge_a = 1;\n float edge_b = 2;\n float edge_c = 3;\n}\n\nmessage Parallelogram {\n float base_length = 1;\n float height = 2;\n}\n\nmessage AreaRequest {\n repeated ShapeMessage shapes = 1;\n}\n\nmessage AreaResponse {\n repeated float value = 1;\n}" - } - }, - "name": "protobuf", - "version": "0.1.17" - } - ] - }, - "provider": { - "name": "area-calculator-provider" - } -} \ No newline at end of file diff --git a/php/pacts/http-consumer-1-http-provider.json b/php/pacts/http-consumer-1-http-provider.json deleted file mode 100644 index 3c6187f16..000000000 --- a/php/pacts/http-consumer-1-http-provider.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "consumer": { - "name": "http-consumer-1" - }, - "interactions": [ - { - "description": "A POST request to create book", - "providerStates": [ - { - "name": "No book fixtures required" - } - ], - "request": { - "body": { - "author": "Margaret Atwood", - "description": "Brilliantly conceived and executed, this powerful evocation of twenty-first century America gives full rein to Margaret Atwood's devastating irony, wit and astute perception.", - "isbn": "0099740915", - "publicationDate": "1985-07-31T00:00:00+00:00", - "title": "The Handmaid's Tale" - }, - "headers": { - "Content-Type": "application/json" - }, - "matchingRules": { - "body": { - "$.author": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.description": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.isbn": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.publicationDate": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$" - } - ] - }, - "$.title": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - } - }, - "header": {} - }, - "method": "POST", - "path": "/api/books" - }, - "response": { - "body": { - "@context": "/api/contexts/Book", - "@id": "/api/books/0114b2a8-3347-49d8-ad99-0e792c5a30e6", - "@type": "Book", - "author": "Melisa Kassulke", - "description": "Quaerat odit quia nisi accusantium natus voluptatem. Explicabo corporis eligendi ut ut sapiente ut qui quidem. Optio amet velit aut delectus. Sed alias asperiores perspiciatis deserunt omnis. Mollitia unde id in.", - "publicationDate": "1999-02-13T00:00:00+07:00", - "reviews": [], - "title": "Voluptas et tempora repellat corporis excepturi." - }, - "headers": { - "Content-Type": "application/ld+json; charset=utf-8" - }, - "matchingRules": { - "body": { - "$.author": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.description": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.publicationDate": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$" - } - ] - }, - "$.title": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$['@id']": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^\\/api\\/books\\/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$" - } - ] - } - }, - "header": {} - }, - "status": 201 - } - } - ], - "metadata": { - "pactRust": { - "ffi": "0.3.14", - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "3.0.0" - } - }, - "provider": { - "name": "http-provider" - } -} \ No newline at end of file diff --git a/php/pacts/http-consumer-2-http-provider.json b/php/pacts/http-consumer-2-http-provider.json deleted file mode 100644 index 227a5e436..000000000 --- a/php/pacts/http-consumer-2-http-provider.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "consumer": { - "name": "http-consumer-2" - }, - "interactions": [ - { - "description": "A PUT request to generate book cover", - "providerStates": [ - { - "name": "A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required" - } - ], - "request": { - "body": [], - "headers": { - "Content-Type": "application/json" - }, - "method": "PUT", - "path": "/api/books/fb5a885f-f7e8-4a50-950f-c1a64a94d500/generate-cover" - }, - "response": { - "status": 204 - } - } - ], - "metadata": { - "pactRust": { - "ffi": "0.3.14", - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "3.0.0" - } - }, - "provider": { - "name": "http-provider" - } -} \ No newline at end of file diff --git a/php/pacts/message-consumer-2-message-provider.json b/php/pacts/message-consumer-2-message-provider.json deleted file mode 100644 index 27138795c..000000000 --- a/php/pacts/message-consumer-2-message-provider.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "consumer": { - "name": "message-consumer-2" - }, - "messages": [ - { - "contents": { - "uuid": "fb5a885f-f7e8-4a50-950f-c1a64a94d500" - }, - "description": "Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message", - "matchingRules": { - "body": { - "$.uuid": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$" - } - ] - } - } - }, - "metadata": { - "contentType": "application/json" - }, - "providerStates": [ - { - "name": "A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required" - } - ] - } - ], - "metadata": { - "pactRust": { - "ffi": "0.3.14", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "3.0.0" - } - }, - "provider": { - "name": "message-provider" - } -} \ No newline at end of file diff --git a/php/public/index.php b/php/public/index.php deleted file mode 100644 index c034ba6a9..000000000 --- a/php/public/index.php +++ /dev/null @@ -1,34 +0,0 @@ -post('/api/books', function (Request $request, Response $response, $args) { - $response->getBody()->write(json_encode([ - '@context' => '/api/contexts/Book', - '@id' => '/api/books/bb50b187-ff02-422c-886f-b58dc4e0adca', - '@type' => 'Book', - 'title' => 'Lorem ipsum dolor sit amet.', - 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris a neque erat. Donec laoreet justo.', - 'author' => 'Mrs. Samanta Gerhold', - 'publicationDate' => '2002-05-26T11:41:12+07:00', - 'reviews' => [], - ])); - - return $response - ->withHeader('Content-Type', 'application/ld+json; charset=utf-8') - ->withStatus(201); -}); - -$app->put('/api/books/{id}/generate-cover', function (Request $request, Response $response, $args) { - $response->getBody()->write('[]'); - - return $response->withStatus(204); -}); - -$app->run(); diff --git a/php/public/proxy.php b/php/public/proxy.php deleted file mode 100644 index ab389437b..000000000 --- a/php/public/proxy.php +++ /dev/null @@ -1,52 +0,0 @@ -addBodyParsingMiddleware(); - -$app->post('/', function(Request $request, Response $response) { - $body = $request->getParsedBody(); - switch ($body['description']) { - case 'Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message': - $response->getBody()->write(json_encode([ - 'uuid' => '90d0f930-b1c6-48b6-b351-88f6c2b5aa9e', - ])); - return $response->withHeader('Content-Type', 'application/json'); - - default: - break; - } - // What to do with $body['providerStates'] ? - - return $response; -}); - -$app->post('/change-state', function(Request $request, Response $response) { - $body = $request->getParsedBody(); - switch ($body['state']) { - case 'A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required': - if (($body['action'] ?? null) === 'teardown') { - error_log('Removing book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500...'); - } else { - error_log('Creating book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500...'); - } - break; - - default: - break; - } - - return $response; -}); - -try { - $app->run(); -} catch (HttpNotFoundException $exception) { - return false; -} diff --git a/php/src/consumer-1.php b/php/src/consumer-1.php deleted file mode 100644 index 8bc54b230..000000000 --- a/php/src/consumer-1.php +++ /dev/null @@ -1,120 +0,0 @@ - -// $code = file_get_contents(posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/pact.h'); -// $ffi = FFI::cdef($code, posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/osxaarch64/libpact_ffi.dylib'); - -$ffi->pactffi_init('LOG_LEVEL'); - -$pact = $ffi->pactffi_new_pact('http-consumer-1', 'http-provider'); -$ffi->pactffi_with_specification($pact, $ffi->PactSpecification_V3); - -$interaction = $ffi->pactffi_new_interaction($pact, 'A POST request to create book'); -$ffi->pactffi_upon_receiving($interaction, 'A POST request to create book'); -$ffi->pactffi_given($interaction, 'No book fixtures required'); -$ffi->pactffi_with_request($interaction, 'POST', '/api/books'); -$ffi->pactffi_with_header($interaction, $ffi->InteractionPart_Request, 'Content-Type', 0, 'application/json'); -$ffi->pactffi_with_body($interaction, $ffi->InteractionPart_Request, 'application/json', '{ - "isbn": { - "pact:matcher:type": "type", - "value": "0099740915" - }, - "title": { - "pact:matcher:type": "type", - "value": "The Handmaid\'s Tale" - }, - "description": { - "pact:matcher:type": "type", - "value": "Brilliantly conceived and executed, this powerful evocation of twenty-first century America gives full rein to Margaret Atwood\'s devastating irony, wit and astute perception." - }, - "author": { - "pact:matcher:type": "type", - "value": "Margaret Atwood" - }, - "publicationDate": { - "pact:matcher:type": "regex", - "regex": "^\\\\d{4}-[01]\\\\d-[0-3]\\\\dT[0-2]\\\\d:[0-5]\\\\d:[0-5]\\\\d([+-][0-2]\\\\d:[0-5]\\\\d|Z)$", - "value": "1985-07-31T00:00:00+00:00" - } - }'); -$ffi->pactffi_response_status($interaction, 201); -$ffi->pactffi_with_header($interaction, $ffi->InteractionPart_Response, 'Content-Type', 0, 'application/ld+json; charset=utf-8'); -$ffi->pactffi_with_body($interaction, $ffi->InteractionPart_Response, 'application/ld+json; charset=utf-8', '{ - "@context": "/api/contexts/Book", - "@id": { - "pact:matcher:type": "regex", - "regex": "^\\\\/api\\\\/books\\\\/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$", - "value": "/api/books/0114b2a8-3347-49d8-ad99-0e792c5a30e6" - }, - "@type": "Book", - "title": { - "pact:matcher:type": "type", - "value": "Voluptas et tempora repellat corporis excepturi." - }, - "description": { - "pact:matcher:type": "type", - "value": "Quaerat odit quia nisi accusantium natus voluptatem. Explicabo corporis eligendi ut ut sapiente ut qui quidem. Optio amet velit aut delectus. Sed alias asperiores perspiciatis deserunt omnis. Mollitia unde id in." - }, - "author": { - "pact:matcher:type": "type", - "value": "Melisa Kassulke" - }, - "publicationDate": { - "pact:matcher:type": "regex", - "regex": "^\\\\d{4}-[01]\\\\d-[0-3]\\\\dT[0-2]\\\\d:[0-5]\\\\d:[0-5]\\\\d([+-][0-2]\\\\d:[0-5]\\\\d|Z)$", - "value": "1999-02-13T00:00:00+07:00" - }, - "reviews": [ - - ] - }'); - -$port = $ffi->pactffi_create_mock_server_for_pact($pact, '127.0.0.1:0', false); -echo sprintf("Mock server port=%d\n", $port); - -$client = HttpClient::create(); - -$json = getenv('MATCHING') ? [ - 'isbn' => '0099740915', - 'title' => "The Handmaid's Tale", - 'description' => 'Brilliantly conceived and executed, this powerful evocation of twenty-first century America gives full rein to Margaret Atwood\'s devastating irony, wit and astute perception.', - 'author' => 'Margaret Atwood', - 'publicationDate' => '1985-07-31T00:00:00+00:00' -] : [ - 'isbn' => '0099740915', - 'title' => 123, - 'description' => 'Natus ut doloribus magni. Impedit aperiam ea similique. Sed architecto quod nulla maxime. Quibusdam inventore esse harum accusantium rerum nulla voluptatem.', - 'author' => 'Maryse Kulas', - 'publicationDate' => 'tommorow' -]; - -$response = $client->request( - 'POST', - sprintf('http://localhost:%d/api/books', $port), - [ - 'json' => $json, - ] -); - -echo sprintf("STATUS: %d\n", $response->getStatusCode()); -echo sprintf("HEADERS: %s\n", print_r($response->getHeaders(false), true)); -echo sprintf("BODY: %s\n", print_r(json_decode($response->getContent(false), true), true)); - -if ($ffi->pactffi_mock_server_matched($port)) { - echo getenv('MATCHING') ? "Mock server matched all requests, Yay!" : "Mock server matched all requests, That Is Not Good (tm)"; - echo "\n"; - - $ffi->pactffi_write_pact_file($port, __DIR__ . '/../pacts', false); -} else { - echo getenv('MATCHING') ? "We got some mismatches, Boo!" : "We got some mismatches, as expected."; - echo "\n"; - echo sprintf("Mismatches: %s\n", print_r(json_decode(FFI::string($ffi->pactffi_mock_server_mismatches($port)), true), true)); -} - -$ffi->pactffi_cleanup_mock_server($port); diff --git a/php/src/consumer-2.php b/php/src/consumer-2.php deleted file mode 100644 index 24046310c..000000000 --- a/php/src/consumer-2.php +++ /dev/null @@ -1,86 +0,0 @@ - -// $code = file_get_contents(posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/pact.h'); -// $ffi = FFI::cdef($code, posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/osxaarch64/libpact_ffi.dylib'); - -$ffi->pactffi_init('LOG_LEVEL'); - -$pact = $ffi->pactffi_new_pact('http-consumer-2', 'http-provider'); -$ffi->pactffi_with_specification($pact, $ffi->PactSpecification_V3); - -$interaction = $ffi->pactffi_new_interaction($pact, 'A PUT request to generate book cover'); -$ffi->pactffi_upon_receiving($interaction, 'A PUT request to generate book cover'); -$ffi->pactffi_given($interaction, 'A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required'); -$ffi->pactffi_with_request($interaction, 'PUT', '/api/books/fb5a885f-f7e8-4a50-950f-c1a64a94d500/generate-cover'); -$ffi->pactffi_with_header($interaction, $ffi->InteractionPart_Request, 'Content-Type', 0, 'application/json'); -$ffi->pactffi_with_body($interaction, $ffi->InteractionPart_Request, 'application/json', '[]'); -$ffi->pactffi_response_status($interaction, 204); - -$contents = '{ - "uuid": { - "pact:matcher:type": "regex", - "regex": "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$", - "value": "fb5a885f-f7e8-4a50-950f-c1a64a94d500" - } -}'; -$length = \strlen($contents); -$size = $length + 1; -$cData = $ffi->new("uint8_t[{$size}]"); -FFI::memcpy($cData, $contents, $length); - -$messagePact = $ffi->pactffi_new_message_pact('message-consumer-2', 'message-provider'); -$message = $ffi->pactffi_new_message($messagePact, 'Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message'); -$ffi->pactffi_message_expects_to_receive($message, 'Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message'); -$ffi->pactffi_message_given($message, 'A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required'); -$ffi->pactffi_message_with_contents($message, 'application/json', $cData, $size); - -$port = $ffi->pactffi_create_mock_server_for_pact($pact, '127.0.0.1:0', false); -echo sprintf("Mock server port=%d\n", $port); - -$messageHandler = function ($message) use ($port) { - if (!isset($message->uuid)) { - return; - } - - $client = HttpClient::create(); - - $response = $client->request( - 'PUT', - sprintf('http://localhost:%d/api/books/%s/generate-cover', $port, $message->uuid), - [ - 'json' => getenv('MATCHING') ? [] : [ - 'width' => '720', - 'height' => '1080' - ], - ] - ); - - echo sprintf("STATUS: %d\n", $response->getStatusCode()); - echo sprintf("HEADERS: %s\n", print_r($response->getHeaders(false), true)); - echo sprintf("BODY: %s\n", print_r(json_decode($response->getContent(false), true), true)); -}; - -$reified = $ffi->pactffi_message_reify($message); -$raw = json_decode($reified, false); -$messageHandler($raw->contents); - -if ($ffi->pactffi_mock_server_matched($port)) { - echo getenv('MATCHING') ? "Mock server matched all requests, Yay!" : "Mock server matched all requests, That Is Not Good (tm)"; - echo "\n"; - - $ffi->pactffi_write_pact_file($port, __DIR__ . '/../pacts', false); - $ffi->pactffi_write_message_pact_file($messagePact, __DIR__ . '/../pacts', false); -} else { - echo getenv('MATCHING') ? "We got some mismatches, Boo!" : "We got some mismatches, as expected."; - echo "\n"; - echo sprintf("Mismatches: %s\n", print_r(json_decode(FFI::string($ffi->pactffi_mock_server_mismatches($port)), true), true)); -} - -$ffi->pactffi_cleanup_mock_server($port); diff --git a/php/src/consumer-plugin.php b/php/src/consumer-plugin.php deleted file mode 100644 index ae19cd5b9..000000000 --- a/php/src/consumer-plugin.php +++ /dev/null @@ -1,77 +0,0 @@ - -// $code = file_get_contents(posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/pact.h'); -// $ffi = FFI::cdef($code, posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/osxaarch64/libpact_ffi.dylib'); - -// Setup Loggers -$ffi->pactffi_logger_init(); -$ffi->pactffi_logger_attach_sink('file ./logs/log-info.txt',5); -$ffi->pactffi_logger_attach_sink('file ./logs/log-error.txt',5); -$ffi->pactffi_logger_attach_sink('stdout', 3); -$ffi->pactffi_logger_attach_sink('stderr', 2); -$ffi->pactffi_logger_apply(); -$ffi->pactffi_log_message('pact-php-ffi', 'INFO', 'hello from pact php ffi, using Pact FFI Version: ' . $ffi->pactffi_version()); - -// Setup pact for testing -$pact = $ffi->pactffi_new_pact('grpc-consumer-php', 'area-calculator-provider'); -$ffi->pactffi_with_pact_metadata($pact, 'pact-php','ffi',$ffi->pactffi_version()); -$message_pact = $ffi->pactffi_new_sync_message_interaction($pact, 'A gRPC calculateOne request'); -$ffi->pactffi_with_specification($pact, $ffi->PactSpecification_V4); - -// Setup contents - -$proto_file_path = __DIR__ . '/../../proto/area_calculator.proto'; - -$contents = '{ - "pact:proto": "'. $proto_file_path . '", - "pact:proto-service": "Calculator/calculateOne", - "pact:content-type": "application/protobuf", - "request": { - "rectangle": { - "length": "matching(number, 3)", - "width": "matching(number, 4)" - } - }, - "response": { - "value": ["matching(number, 12)"] - } - }'; - -// Start mock server - -$ffi->pactffi_using_plugin($pact, 'protobuf', '0.1.17'); -$ffi->pactffi_interaction_contents($message_pact, 0, 'application/grpc', $contents); -$port = $ffi->pactffi_create_mock_server_for_transport($pact , '0.0.0.0',0,'grpc', null); - -echo sprintf("Mock server port=%d\n", $port); - -// This is where we would call our client, gRPC in this example plugin demo -// PHP gRPC is client only, so would need to use a provider from the following -// https://github.com/pact-foundation/pact-plugins/tree/main/examples/gRPC/area_calculator -// TODO build out an area calculator PHP example -// https://grpc.io/docs/languages/php/ - -// Check if requests match - Note this _should_ fail, but the pactffi_mock_server_matched is returning true -// even if no requests were made. - -if ($ffi->pactffi_mock_server_matched($port)) { - echo getenv('MATCHING') ? "Mock server matched all requests, Yay!" : "Mock server matched all requests, That Is Not Good (tm)"; - echo "\n"; - - $ffi->pactffi_write_pact_file($port, __DIR__ . '/../pacts', false); - // $ffi->pactffi_write_message_pact_file($messagePact, __DIR__ . '/../pacts', false); -} else { - echo getenv('MATCHING') ? "We got some mismatches, Boo!" : "We got some mismatches, as expected."; - echo "\n"; - echo sprintf("Mismatches: %s\n", print_r(json_decode(FFI::string($ffi->pactffi_mock_server_mismatches($port)), true), true)); -} - -$ffi->pactffi_cleanup_mock_server($port); -$ffi->pactffi_cleanup_plugins($pact); diff --git a/php/src/provider.php b/php/src/provider.php deleted file mode 100644 index 7e64c2fd6..000000000 --- a/php/src/provider.php +++ /dev/null @@ -1,113 +0,0 @@ -start(); -$process->waitUntil(function ($type, $output) { - return false !== strpos($output, 'Development Server (http://localhost:8000) started'); -}); - -$code = file_get_contents(__DIR__ . '/../../rust/pact_ffi/include/pact.h'); -$ffi = FFI::cdef($code, getenv('PACT_FFI_LIBRARY_PATH') ?: __DIR__ . '/../../rust/target/debug/libpact_ffi.so'); -// Macs use dylib extension, following will assume os's downloaded in users home dir ~/.pact/ffi/arch/libpact_ffi. -// $code = file_get_contents(posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/pact.h'); -// $ffi = FFI::cdef($code, posix_getpwnam(get_current_user())['dir'] . '/.pact/ffi/osxaarch64/libpact_ffi.dylib'); - -$ffi->pactffi_init('LOG_LEVEL'); - -$tags = ['feature-x', 'master', 'test', 'prod']; -$consumers = ['http-consumer-1', 'http-consumer-2', 'message-consumer-2','area-calculator-consumer']; - -function getCData(array $items): FFI\CData -{ - $itemsSize = count($items); - $cDataItems = FFI::new("char*[{$itemsSize}]"); - foreach ($items as $index => $item) { - $length = \strlen($item); - $itemSize = $length + 1; - $cDataItem = FFI::new("char[{$itemSize}]", false); - FFI::memcpy($cDataItem, $item, $length); - $cDataItems[$index] = $cDataItem; - } - - return $cDataItems; -} - -$handle = $ffi->pactffi_verifier_new(); - -// // gRPC ❌ -// // HTTP ✅ -// // Verification failed with an error - Failed to verify the request: gRPC error: status Unknown error, message 'transport error' -// $ffi->pactffi_verifier_set_provider_info($handle, 'http-provider', 'http', 'localhost', 8000, '/'); - - -// // gRPC ✅ -// // HTTP ❌ -// // Request Failed - builder error for url (tcp://localhost:37757): URL scheme is not allowed -// $ffi->pactffi_verifier_set_provider_info($handle, 'http-provider', 'tcp', 'localhost', 37757, '/'); - -// // // gRPC ✅ -// // // HTTP ❌ -// // // Request Failed - builder error for url (tcp://localhost:37757): URL scheme is not allowed -// $ffi->pactffi_verifier_set_provider_info($handle, 'http-provider', 'tcp', 'localhost', 37757, '/'); -// $ffi->pactffi_verifier_add_provider_transport($handle, 'http',8000,'/','http'); - -// // gRPC ✅ -// // HTTP ❌ -// // Verification failed with an error - Failed to verify the request: gRPC error: status Unknown error, message 'transport error' -$ffi->pactffi_verifier_set_provider_info($handle, 'http-provider', 'http', 'localhost', 8000, '/'); -$ffi->pactffi_verifier_add_provider_transport($handle, 'protobuf',37757,'/','tcp'); - - -// // gRPC ✅ -// // HTTP ❌ -// // Request Failed - builder error for url (tcp://localhost:37757): URL scheme is not allowed -// $ffi->pactffi_verifier_set_provider_info($handle, 'http-provider', 'tcp', 'localhost', 37757, '/'); -// $ffi->pactffi_verifier_add_provider_transport($handle, 'http',8000,'/','http'); - - -// // 💡 -// // This would be my preferrred option -// // Set the provider name (which should be used by anything using the verifier_handle, and filter sourced pacts that don't contain name) -// // add multiple transports. -// // note pactffi_verifier_set_provider_name does not exist -// // update_provider_info might work -// // https://github.com/pact-foundation/pact-reference/blob/cfb2c03f87b3f67464291dd936d0aac555c42c91/rust/pact_ffi/src/verifier/handle.rs#L89 -// // but is marked as deprecated. -// // -// // also worthy of note, if pactffi_verifier_set_provider_info didn't mix with the information used in pactffi_verifier_add_provider_transport -// // this probably wouldn't be neccessary. -// $ffi->pactffi_verifier_set_provider_name($handle, 'http-provider'); // note this function doesn't exist (wishlist) -// $ffi->pactffi_verifier_add_provider_transport($handle, 'http',8000,'/','http'); -// $ffi->pactffi_verifier_add_provider_transport($handle, 'protobuf',37757,'/','tcp'); - - - // gRPC ❌ - // HTTP ❌ - // You can't just pass nulls into set_provider_info as it provides default info - // https://github.com/pact-foundation/pact-reference/blob/master/rust/pact_ffi/src/verifier/mod.rs#L143 -$ffi->pactffi_verifier_set_provider_info($handle, 'http-provider', null, null, null, null); -$ffi->pactffi_verifier_add_provider_transport($handle, 'protobuf',37757,'/','tcp'); -// $ffi->pactffi_verifier_add_provider_transport($handle, 'http',8000,'/','http'); // registering a http transport doesnt work either - - - - -// $ffi->pactffi_verifier_set_filter_info($handle, '', 'book', false); -$ffi->pactffi_verifier_set_provider_state($handle, 'http://localhost:8000/change-state', true, true); -$ffi->pactffi_verifier_set_verification_options($handle, false, 5000); -$ffi->pactffi_verifier_set_publish_options($handle, '1.0.0', null, getCData($tags), count($tags), 'some-branch'); -$ffi->pactffi_verifier_set_consumer_filters($handle, getCData($consumers), count($consumers)); -// $ffi->pactffi_verifier_add_provider_transport($handle, 'protobuf',37757,null,'tcp'); -$ffi->pactffi_verifier_add_directory_source($handle, __DIR__ . '/../pacts'); -$result = $ffi->pactffi_verifier_execute($handle); -$ffi->pactffi_verifier_shutdown($handle); - -if (!$result) { - echo "Verifier verified all contracts, Yay!\n"; -} else { - echo "We got some problems, Boo!\n"; -} diff --git a/python/.gitignore b/python/.gitignore deleted file mode 100644 index ed8ebf583..000000000 --- a/python/.gitignore +++ /dev/null @@ -1 +0,0 @@ -__pycache__ \ No newline at end of file diff --git a/python/Makefile b/python/Makefile deleted file mode 100644 index 3b5c990a5..000000000 --- a/python/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -build_ffi: - cd ../rust/pact_ffi && \ - cargo build && \ - rustup run nightly cbindgen \ - --crate pact_ffi \ - --output include/pact.h - -deps: - pip install -r requires.txt - -run_hello_ffi: - python hello_ffi.py - -run_pact_http: - python pact_http_create_mock_server.py - -run_pact_http_create_mock_server_for_pact: - python pact_http_create_mock_server_for_pact.py - -run_pact_message_v3: - python pact_message_v3.py - -run_pact_plugin_grpc_v4: - python pact_plugin_grpc_v4.py - -test: deps run_pact_http run_pact_http_create_mock_server_for_pact run_pact_message_v3 run_pact_plugin_grpc_v4 - -pacts_show: - cat "pacts/Consumer-Alice Service.json" | jq . - cat "pacts/http-consumer-1-http-provider.json" | jq . - cat "pacts/http-consumer-2-http-provider.json" | jq . - cat "pacts/message-consumer-2-message-provider.json" | jq . - cat "pacts/grpc-consumer-python-area-calculator-provider.json" | jq . \ No newline at end of file diff --git a/python/hello_ffi.py b/python/hello_ffi.py deleted file mode 100644 index aef2188dd..000000000 --- a/python/hello_ffi.py +++ /dev/null @@ -1,7 +0,0 @@ -from cffi import FFI -from register_ffi import get_ffi_lib - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -result = lib.pactffi_version() -print(ffi.string(result).decode('utf-8')) \ No newline at end of file diff --git a/python/pact_http_create_mock_server.py b/python/pact_http_create_mock_server.py deleted file mode 100644 index 59aea10b2..000000000 --- a/python/pact_http_create_mock_server.py +++ /dev/null @@ -1,94 +0,0 @@ -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import requests - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -version_encoded = lib.pactffi_version() -ffi_version = ffi.string(version_encoded).decode('utf-8') - -contents ={ - "provider": { - "name": "Alice Service" - }, - "consumer": { - "name": "Consumer" - }, - "interactions": [ - { - "description": "a retrieve Mallory request", - "request": { - "method": "GET", - "path": "/mallory", - "query": "name=ron&status=good" - }, - "response": { - "status": 200, - "headers": { - "Content-Type": "text/html" - }, - "body": "That is some good Mallory." - } - } - ], - "metadata": { - "pact-specification": { - "version": "1.0.0" - }, - "pact-python": { - "version": "1.0.0", - "ffi": ffi_version - } - } - } - -print(contents) - -## Setup Loggers - -lib.pactffi_logger_init() -lib.pactffi_logger_attach_sink(b'file ./logs/log-info.txt',5) -lib.pactffi_logger_attach_sink(b'file ./logs/log-error.txt',5) -# lib.pactffi_logger_attach_sink(b'stdout', 5) -# lib.pactffi_logger_attach_sink(b'stderr', 5) -lib.pactffi_logger_apply() -lib.pactffi_log_message(b'pact_python_ffi', b'INFO', b'hello from pact python ffi, using Pact FFI Version: '+ ffi.string(version_encoded)) - - -## Load pact into Mock Server and start -mock_server_port = lib.pactffi_create_mock_server(ffi.new("char[]", json.dumps(contents).encode('ascii')) , b'127.0.0.1:4432',0) -print(f"Mock server started: {mock_server_port}") - -## Make our client call - -expected_response = 'That is some good Mallory.' -try: - response = requests.get(f"http://127.0.0.1:{mock_server_port}/mallory?name=ron&status=good") - print(f"Client response - matched: {response.text}") - print(f"Client response - matched: {response.text == expected_response}") - response.raise_for_status() -except requests.HTTPError as http_err: - print(f'Client request - HTTP error occurred: {http_err}') # Python 3.6 -except Exception as err: - print(f'Client request - Other error occurred: {err}') # Python 3.6 - -result = lib.pactffi_mock_server_matched(mock_server_port) -print(f"Pact - Got matching client requests: {result}") -if result == True: - PACT_FILE_DIR='./pacts' - print(f"Writing pact file to {PACT_FILE_DIR}") - res_write_pact = lib.pactffi_write_pact_file(mock_server_port, PACT_FILE_DIR.encode('ascii'), False) - print(f"Pact file writing results: {res_write_pact}") -else: - print('pactffi_mock_server_matched did not match') - mismatchers = lib.pactffi_mock_server_mismatches(mock_server_port) - result = json.loads(ffi.string(mismatchers)) - print(json.dumps(result, indent=4)) - logs = lib.pactffi_mock_server_logs(mock_server_port) - print(logs) - -## Cleanup - -lib.pactffi_cleanup_mock_server(mock_server_port) - diff --git a/python/pact_http_create_mock_server_for_pact.py b/python/pact_http_create_mock_server_for_pact.py deleted file mode 100644 index a337f0ccc..000000000 --- a/python/pact_http_create_mock_server_for_pact.py +++ /dev/null @@ -1,132 +0,0 @@ -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import requests - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -version_encoded = lib.pactffi_version() -ffi_version = ffi.string(version_encoded).decode('utf-8') - -request_interaction_body = { - "isbn": { - "pact:matcher:type": "type", - "value": "0099740915" - }, - "title": { - "pact:matcher:type": "type", - "value": "The Handmaid\'s Tale" - }, - "description": { - "pact:matcher:type": "type", - "value": "Brilliantly conceived and executed, this powerful evocation of twenty-first century America gives full rein to Margaret Atwood\'s devastating irony, wit and astute perception." - }, - "author": { - "pact:matcher:type": "type", - "value": "Margaret Atwood" - }, - "publicationDate": { - "pact:matcher:type": "regex", - "regex": "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$", - "value": "1985-07-31T00:00:00+00:00" - } - } - -# print(request_interaction_body) - -response_interaction_body = { - "@context": "/api/contexts/Book", - "@id": { - "pact:matcher:type": "regex", - "regex": "^\\/api\\/books\\/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$", - "value": "/api/books/0114b2a8-3347-49d8-ad99-0e792c5a30e6" - }, - "@type": "Book", - "title": { - "pact:matcher:type": "type", - "value": "Voluptas et tempora repellat corporis excepturi." - }, - "description": { - "pact:matcher:type": "type", - "value": "Quaerat odit quia nisi accusantium natus voluptatem. Explicabo corporis eligendi ut ut sapiente ut qui quidem. Optio amet velit aut delectus. Sed alias asperiores perspiciatis deserunt omnis. Mollitia unde id in." - }, - "author": { - "pact:matcher:type": "type", - "value": "Melisa Kassulke" - }, - "publicationDate": { - "pact:matcher:type": "regex", - "regex": "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$", - "value": "1999-02-13T00:00:00+07:00" - }, - "reviews": [ - ] - } - -print(response_interaction_body) - -## Setup Loggers - -lib.pactffi_logger_init() -lib.pactffi_logger_attach_sink(b'file ./logs/log-info.txt',5) -lib.pactffi_logger_attach_sink(b'file ./logs/log-error.txt',5) -# lib.pactffi_logger_attach_sink(b'stdout', 5) -# lib.pactffi_logger_attach_sink(b'stderr', 5) -lib.pactffi_logger_apply() -lib.pactffi_log_message(b'pact_python_ffi', b'INFO', b'hello from pact python ffi, using Pact FFI Version: '+ ffi.string(version_encoded)) - - -## Setup pact for testing -pact = lib.pactffi_new_pact(b'http-consumer-1', b'http-provider') -lib.pactffi_with_pact_metadata(pact, b'pact-python', b'ffi', ffi.string(version_encoded)) -interaction = lib.pactffi_new_interaction(pact, b'A POST request to create book') -# setup interaction request -lib.pactffi_upon_receiving(interaction, b'A POST request to create book') -lib.pactffi_given(interaction, b'No book fixtures required') -lib.pactffi_with_request(interaction, b'POST', b'/api/books') -lib.pactffi_with_header_v2(interaction, 0,b'Content-Type', 0, b'application/json') -lib.pactffi_with_body(interaction, 0,b'application/json', ffi.new("char[]", json.dumps(request_interaction_body).encode('ascii'))) -# setup interaction response -lib.pactffi_response_status(interaction, 200) -lib.pactffi_with_header_v2(interaction, 1,b'Content-Type', 0, b'application/ld+json; charset=utf-8') -lib.pactffi_with_body(interaction, 1,b'application/ld+json; charset=utf-8', ffi.new("char[]", json.dumps(response_interaction_body).encode('ascii'))) - -# Start mock server -mock_server_port = lib.pactffi_create_mock_server_for_pact(pact , b'0.0.0.0:0',0) -print(f"Mock server started: {mock_server_port}") - -## Make our client call -body = { - "isbn": '0099740915', - "title": "The Handmaid's Tale", - "description": 'Brilliantly conceived and executed, this powerful evocation of twenty-first century America gives full rein to Margaret Atwood\'s devastating irony, wit and astute perception.', - "author": 'Margaret Atwood', - "publicationDate": '1985-07-31T00:00:00+00:00' - } -expected_response = '{"@context":"/api/contexts/Book","@id":"/api/books/0114b2a8-3347-49d8-ad99-0e792c5a30e6","@type":"Book","author":"Melisa Kassulke","description":"Quaerat odit quia nisi accusantium natus voluptatem. Explicabo corporis eligendi ut ut sapiente ut qui quidem. Optio amet velit aut delectus. Sed alias asperiores perspiciatis deserunt omnis. Mollitia unde id in.","publicationDate":"1999-02-13T00:00:00+07:00","reviews":[],"title":"Voluptas et tempora repellat corporis excepturi."}' -try: - response = requests.post(f"http://127.0.0.1:{mock_server_port}/api/books", data=json.dumps(body), - headers={'Content-Type': 'application/json'}) - print(f"Client response - matched: {response.text}") - print(f"Client response - matched: {response.text == expected_response}") - response.raise_for_status() -except requests.HTTPError as http_err: - print(f'Client request - HTTP error occurred: {http_err}') # Python 3.6 -except Exception as err: - print(f'Client request - Other error occurred: {err}') # Python 3.6 - -result = lib.pactffi_mock_server_matched(mock_server_port) -print(f"Pact - Got matching client requests: {result}") -if result == True: - PACT_FILE_DIR='./pacts' - print(f"Writing pact file to {PACT_FILE_DIR}") - res_write_pact = lib.pactffi_write_pact_file(mock_server_port, PACT_FILE_DIR.encode('ascii'), False) - print(f"Pact file writing results: {res_write_pact}") -else: - print('pactffi_mock_server_matched did not match') - mismatchers = lib.pactffi_mock_server_mismatches(mock_server_port) - result = json.loads(ffi.string(mismatchers)) - print(json.dumps(result, indent=4)) - -## Cleanup -lib.pactffi_cleanup_mock_server(mock_server_port) diff --git a/python/pact_http_dupe_test.py b/python/pact_http_dupe_test.py deleted file mode 100644 index afa2b199d..000000000 --- a/python/pact_http_dupe_test.py +++ /dev/null @@ -1,35 +0,0 @@ -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import requests - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -lib.pactffi_logger_init() -lib.pactffi_log_to_stdout(3) - -pact = lib.pactffi_new_pact(b'merge-test-consumer', b'merge-test-provider-http') -lib.pactffi_with_specification(pact, 5) -interaction = lib.pactffi_new_interaction(pact, b'a request for an order with an unknown ID') -lib.pactffi_with_request(interaction, b'GET', b'/api/orders/404') -lib.pactffi_with_header_v2(interaction, 0,b'Accept', 0, b'application/json') -lib.pactffi_response_status(interaction, 404) - -# Start mock server -mock_server_port = lib.pactffi_create_mock_server_for_transport(pact , b'0.0.0.0',0, b'http', b'{}') -print(f"Mock server started: {mock_server_port}") - -try: - response = requests.get(f"http://127.0.0.1:{mock_server_port}/api/orders/404", - headers={'Content-Type': 'application/json'}) - response.raise_for_status() -except requests.HTTPError as http_err: - print(f'Client request - HTTP error occurred: {http_err}') # Python 3.6 -except Exception as err: - print(f'Client request - Other error occurred: {err}') # Python 3.6 - -result = lib.pactffi_mock_server_matched(mock_server_port) -res_write_pact = lib.pactffi_write_pact_file(mock_server_port, './pacts'.encode('ascii'), False) - -## Cleanup -lib.pactffi_cleanup_mock_server(mock_server_port) diff --git a/python/pact_message_dupe_test.py b/python/pact_message_dupe_test.py deleted file mode 100644 index 98c29e29d..000000000 --- a/python/pact_message_dupe_test.py +++ /dev/null @@ -1,26 +0,0 @@ -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import requests - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -lib.pactffi_logger_init() -lib.pactffi_log_to_stdout(3) -message_pact = lib.pactffi_new_pact(b'merge-test-consumer', b'merge-test-provider-message') -lib.pactffi_with_specification(message_pact, 5) -message = lib.pactffi_new_message(message_pact, b'an event indicating that an order has been created') -# lib.pactffi_message_expects_to_receive(message,b'Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message') -# lib.pactffi_message_given(message, b'A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required') -contents = { - "id": { - "pact:matcher:type": 'integer', - "value": '1' - } - } -length = len(json.dumps(contents)) -size = length + 1 -lib.pactffi_message_with_contents(message, b'application/json', ffi.new("char[]", json.dumps(contents).encode('ascii')), size) -reified = lib.pactffi_message_reify(message) -res_write_message_pact = lib.pactffi_write_message_pact_file(message_pact, './pacts'.encode('ascii'), False) -print(res_write_message_pact) diff --git a/python/pact_message_v3.py b/python/pact_message_v3.py deleted file mode 100644 index ca5bb9ced..000000000 --- a/python/pact_message_v3.py +++ /dev/null @@ -1,85 +0,0 @@ -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import requests - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -version_encoded = lib.pactffi_version() -ffi_version = ffi.string(version_encoded).decode('utf-8') - -contents = { - "uuid": { - "pact:matcher:type": 'regex', - "regex": '^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$', - "value": 'fb5a885f-f7e8-4a50-950f-c1a64a94d500' - } - } -## Setup Loggers - -lib.pactffi_logger_init() -lib.pactffi_logger_attach_sink(b'file ./logs/log-info.txt',5) -lib.pactffi_logger_attach_sink(b'file ./logs/log-error.txt',5) -# lib.pactffi_logger_attach_sink(b'stdout', 5) -# lib.pactffi_logger_attach_sink(b'stderr', 5) -lib.pactffi_logger_apply() -lib.pactffi_log_message(b'pact_python_ffi', b'INFO', b'hello from pact python ffi, using Pact FFI Version: '+ ffi.string(version_encoded)) - - -## Setup pact for testing -pact = lib.pactffi_new_pact(b'http-consumer-2', b'http-provider') -lib.pactffi_with_pact_metadata(pact, b'pact-python', b'ffi', ffi.string(version_encoded)) -interaction = lib.pactffi_new_interaction(pact, b'A PUT request to generate book cover') -message_pact = lib.pactffi_new_pact(b'message-consumer-2', b'message-provider') -message = lib.pactffi_new_message(message_pact, b'Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message') - -# setup interaction request -lib.pactffi_upon_receiving(interaction, b'A PUT request to generate book cover') -lib.pactffi_given(interaction, b'A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required') -lib.pactffi_with_request(interaction, b'PUT', b'/api/books/fb5a885f-f7e8-4a50-950f-c1a64a94d500/generate-cover') -lib.pactffi_with_header_v2(interaction, 0,b'Content-Type', 0, b'application/json') -lib.pactffi_with_body(interaction, 0,b'application/json', b'[]') -# setup interaction response -lib.pactffi_response_status(interaction, 204) -length = len(json.dumps(contents)) -size = length + 1 -# memBuf = FFI::MemoryPointer.new(:uint, length) -# memBuf.put_bytes(0, json.dump(contents)) -lib.pactffi_message_expects_to_receive(message,b'Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message') -lib.pactffi_message_given(message, b'A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required') -lib.pactffi_message_with_contents(message, b'application/json', ffi.new("char[]", json.dumps(contents).encode('ascii')), size) -# Start mock server -mock_server_port = lib.pactffi_create_mock_server_for_pact(pact , b'0.0.0.0:0',0) -print(f"Mock server started: {mock_server_port}") -reified = lib.pactffi_message_reify(message) -uuid = json.loads(ffi.string(reified).decode('utf-8'))['contents']['uuid'] -## Make our client call -body = [] -try: - response = requests.put(f"http://127.0.0.1:{mock_server_port}/api/books/{uuid}/generate-cover", data=json.dumps(body), - headers={'Content-Type': 'application/json'}) - print(f"Client response - matched: {response.text}") - print(f"Client response - matched: {response.status_code}") - print(f"Client response - matched: {response.status_code == '204'}") - response.raise_for_status() -except requests.HTTPError as http_err: - print(f'Client request - HTTP error occurred: {http_err}') # Python 3.6 -except Exception as err: - print(f'Client request - Other error occurred: {err}') # Python 3.6 - -result = lib.pactffi_mock_server_matched(mock_server_port) -print(f"Pact - Got matching client requests: {result}") -if result == True: - PACT_FILE_DIR='./pacts' - print(f"Writing pact file to {PACT_FILE_DIR}") - res_write_pact = lib.pactffi_write_pact_file(mock_server_port, PACT_FILE_DIR.encode('ascii'), False) - res_write_message_pact = lib.pactffi_write_message_pact_file(message_pact, PACT_FILE_DIR.encode('ascii'), False) - print(f"Pact file writing results: {res_write_pact}") -else: - print('pactffi_mock_server_matched did not match') - mismatchers = lib.pactffi_mock_server_mismatches(mock_server_port) - result = json.loads(ffi.string(mismatchers)) - print(json.dumps(result, indent=4)) - -## Cleanup -lib.pactffi_cleanup_mock_server(mock_server_port) diff --git a/python/pact_plugin_grpc_v4.py b/python/pact_plugin_grpc_v4.py deleted file mode 100644 index 409b52de7..000000000 --- a/python/pact_plugin_grpc_v4.py +++ /dev/null @@ -1,78 +0,0 @@ -import sys -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import os -from pathlib import Path -# sys.path.insert(0, './examples/area_calculator') -# from area_calculator_client import get_rectangle_area - -ffi = FFI() -lib = get_ffi_lib(ffi) # loads the entire C namespace -version_encoded = lib.pactffi_version() -ffi_version = ffi.string(version_encoded).decode('utf-8') - -contents = { - "pact:proto": os.path.abspath('../proto/area_calculator.proto'), - "pact:proto-service": 'Calculator/calculateOne', - "pact:content-type": 'application/protobuf', - "request": { - "rectangle": { - "length": 'matching(number, 3)', - "width": 'matching(number, 4)' - } - }, - "response": { - "value": ['matching(number, 12)'] - } - } - -## Setup Loggers - -lib.pactffi_logger_init() -lib.pactffi_logger_attach_sink(b'file ./logs/log-info.txt',5) -lib.pactffi_logger_attach_sink(b'file ./logs/log-error.txt',5) -lib.pactffi_logger_attach_sink(b'stdout', 3) -# lib.pactffi_logger_attach_sink(b'stderr', 5) -lib.pactffi_logger_apply() -lib.pactffi_log_message(b'pact_python_ffi', b'INFO', b'hello from pact python ffi, using Pact FFI Version: '+ ffi.string(version_encoded)) - - -## Setup pact for testing -pact = lib.pactffi_new_pact(b'grpc-consumer-python', b'area-calculator-provider') -lib.pactffi_with_pact_metadata(pact, b'pact-python', b'ffi', ffi.string(version_encoded)) -message_pact = lib.pactffi_new_sync_message_interaction(pact, b'A gRPC calculateMulti request') -lib.pactffi_with_specification(pact, 5) - - - -# Start mock server -lib.pactffi_using_plugin(pact, b'protobuf', b'0.1.17') -lib.pactffi_interaction_contents(message_pact, 0, b'application/grpc', ffi.new("char[]", json.dumps(contents).encode('ascii'))) -mock_server_port = lib.pactffi_create_mock_server_for_transport(pact , b'0.0.0.0',0,b'grpc',ffi.cast("void *", 0)) -print(f"Mock server started: {mock_server_port}") - -# ## Make our client call -# expected_response = 12.0 -# response = get_rectangle_area(f"localhost:{mock_server_port}") -# print(f"Client response: {response}") -# print(f"Client response - matched expected: {response == expected_response}") - -result = lib.pactffi_mock_server_matched(mock_server_port) -print(f"Pact - Got matching client requests: {result}") - -if result == True: - PACT_FILE_DIR='./pacts' - print(f"Writing pact file to {PACT_FILE_DIR}") - res_write_pact = lib.pactffi_write_pact_file(mock_server_port, PACT_FILE_DIR.encode('ascii'), False) - print(f"Pact file writing results: {res_write_pact}") -else: - print('pactffi_mock_server_matched did not match') - mismatchers = lib.pactffi_mock_server_mismatches(mock_server_port) - if mismatchers: - result = json.loads(ffi.string(mismatchers)) - print(json.dumps(result, indent=4)) - -# Cleanup -lib.pactffi_cleanup_mock_server(mock_server_port) -lib.pactffi_cleanup_plugins(pact) diff --git a/python/pact_xml.py b/python/pact_xml.py deleted file mode 100644 index 62a2ca1ef..000000000 --- a/python/pact_xml.py +++ /dev/null @@ -1,104 +0,0 @@ -import requests -import xml.etree.ElementTree as ET -from cffi import FFI -from register_ffi import get_ffi_lib -import json -import requests -ffi = FFI() - -lib = get_ffi_lib(ffi) # loads the entire C namespace -lib.pactffi_logger_init() -lib.pactffi_logger_attach_sink(b'stdout', 5) -lib.pactffi_logger_apply() -version_encoded = lib.pactffi_version() -lib.pactffi_log_message(b'pact_python_ffi', b'INFO', b'hello from pact python ffi, using Pact FFI Version: '+ ffi.string(version_encoded)) - -expected_response_body = ''' - - - 1 - - - 1 - Do the laundry - true - - - 2 - Do the dishes - false - - - 3 - Do the backyard - false - - - 4 - Do nothing - false - - - - ''' -format = 'xml' -content_type = 'application/' + format -pact_handle = lib.pactffi_new_pact(b'consumer',b'provider') -lib.pactffi_with_pact_metadata(pact_handle, b'pact-python', b'version', b'1.0.0') -interaction_handle = lib.pactffi_new_interaction(pact_handle, b'description') -lib.pactffi_given(interaction_handle, b'i have a list of projects') -lib.pactffi_upon_receiving(interaction_handle, b'a request for projects in XML') -lib.pactffi_with_request(interaction_handle, b'GET', b'/projects') -lib.pactffi_with_header_v2(interaction_handle, 0, b'Accept', 0, content_type.encode('ascii')) - -# lib.pactffi_with_header_v2(interaction_handle, 1, b'Content-Type', 0, content_type.encode('ascii')) -# lib.pactffi_with_header_v2(interaction_handle, 1, b'content-type', 1, content_type.encode('ascii')) -lib.pactffi_with_body(interaction_handle, 1, content_type.encode('ascii'), expected_response_body.encode('ascii')) - -mock_server_port = lib.pactffi_create_mock_server_for_transport(pact_handle, b'127.0.0.1', 0, b'http', b'{}') -print(f"Mock server started: {mock_server_port}") -try: - uri = f"http://127.0.0.1:{mock_server_port}/projects" - response = requests.get(uri, - headers={'Accept': content_type}) - response.raise_for_status() -except requests.HTTPError as http_err: - print(f'Client request - HTTP error occurred: {http_err}') # Python 3.6 -except Exception as err: - print(f'Client request - Other error occurred: {err}') # Python 3.6 - -# Check the client made the right request - -result = lib.pactffi_mock_server_matched(mock_server_port) -print(f"Pact - Got matching client requests: {result}") -if result == True: - PACT_FILE_DIR='./pacts' - print(f"Writing pact file to {PACT_FILE_DIR}") - res_write_pact = lib.pactffi_write_pact_file(mock_server_port, PACT_FILE_DIR.encode('ascii'), False) - print(f"Pact file writing results: {res_write_pact}") -else: - print('pactffi_mock_server_matched did not match') - mismatches = lib.pactffi_mock_server_mismatches(mock_server_port) - result = json.loads(ffi.string(mismatches)) - print(json.dumps(result, indent=4)) - native_logs = lib.pactffi_mock_server_logs(mock_server_port) - logs = ffi.string(native_logs).decode("utf-8").rstrip().split("\n") - print(logs) - -## Cleanup - -lib.pactffi_cleanup_mock_server(mock_server_port) -assert result == True -print(f"Client request - matched: {response.text}") -# Check our response came back from the provider ok - -assert response.text != '' # This should always have a response -projects = ET.fromstring(response.text) -assert len(projects) == 1 -assert projects[0][0].text == '1' -tasks = projects[0].findall('tasks')[0] -assert len(tasks) == 4 -assert tasks[0][0].text == '1' -# assert tasks[0][1].text == 'Do the laundry' -print(f"Client response - matched: {response.text}") -print(f"Client response - matched: {response.text == expected_response_body}") diff --git a/python/pacts/Consumer-Alice Service.json b/python/pacts/Consumer-Alice Service.json deleted file mode 100644 index a7bd26cfd..000000000 --- a/python/pacts/Consumer-Alice Service.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "consumer": { - "name": "Consumer" - }, - "interactions": [ - { - "description": "a retrieve Mallory request", - "request": { - "method": "GET", - "path": "/mallory", - "query": "name=ron&status=good" - }, - "response": { - "body": "That is some good Mallory.", - "headers": { - "Content-Type": "text/html" - }, - "status": 200 - } - } - ], - "metadata": { - "pact-python": { - "ffi": "0.3.15", - "version": "1.0.0" - }, - "pactRust": { - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "1.0.0" - } - }, - "provider": { - "name": "Alice Service" - } -} \ No newline at end of file diff --git a/python/pacts/grpc-consumer-python-area-calculator-provider.json b/python/pacts/grpc-consumer-python-area-calculator-provider.json deleted file mode 100644 index 68e55e4c2..000000000 --- a/python/pacts/grpc-consumer-python-area-calculator-provider.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "consumer": { - "name": "grpc-consumer-python" - }, - "interactions": [ - { - "description": "A gRPC calculateMulti request", - "interactionMarkup": { - "markup": "```protobuf\nmessage AreaResponse {\n repeated float value = 1;\n}\n```\n", - "markupType": "COMMON_MARK" - }, - "key": "103e10b578b91d6b", - "pending": false, - "pluginConfiguration": { - "protobuf": { - "descriptorKey": "a85dff8f82655a9681aad113575dcfbb", - "service": "Calculator/calculateOne" - } - }, - "request": { - "contents": { - "content": "EgoNAABAQBUAAIBA", - "contentType": "application/protobuf;message=ShapeMessage", - "contentTypeHint": "BINARY", - "encoded": "base64" - }, - "matchingRules": { - "body": { - "$.rectangle.length": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - }, - "$.rectangle.width": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - } - } - } - }, - "response": [ - { - "contents": { - "content": "CgQAAEBB", - "contentType": "application/protobuf;message=AreaResponse", - "contentTypeHint": "BINARY", - "encoded": "base64" - }, - "matchingRules": { - "body": { - "$.value[0].*": { - "combine": "AND", - "matchers": [ - { - "match": "number" - } - ] - } - } - } - } - ], - "transport": "grpc", - "type": "Synchronous/Messages" - } - ], - "metadata": { - "pact-python": { - "ffi": "0.3.15" - }, - "pactRust": { - "ffi": "0.3.15", - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "4.0" - }, - "plugins": [ - { - "configuration": { - "a85dff8f82655a9681aad113575dcfbb": { - "protoDescriptors": "CsoHChVhcmVhX2NhbGN1bGF0b3IucHJvdG8SD2FyZWFfY2FsY3VsYXRvciK6AgoMU2hhcGVNZXNzYWdlEjEKBnNxdWFyZRgBIAEoCzIXLmFyZWFfY2FsY3VsYXRvci5TcXVhcmVIAFIGc3F1YXJlEjoKCXJlY3RhbmdsZRgCIAEoCzIaLmFyZWFfY2FsY3VsYXRvci5SZWN0YW5nbGVIAFIJcmVjdGFuZ2xlEjEKBmNpcmNsZRgDIAEoCzIXLmFyZWFfY2FsY3VsYXRvci5DaXJjbGVIAFIGY2lyY2xlEjcKCHRyaWFuZ2xlGAQgASgLMhkuYXJlYV9jYWxjdWxhdG9yLlRyaWFuZ2xlSABSCHRyaWFuZ2xlEkYKDXBhcmFsbGVsb2dyYW0YBSABKAsyHi5hcmVhX2NhbGN1bGF0b3IuUGFyYWxsZWxvZ3JhbUgAUg1wYXJhbGxlbG9ncmFtQgcKBXNoYXBlIikKBlNxdWFyZRIfCgtlZGdlX2xlbmd0aBgBIAEoAlIKZWRnZUxlbmd0aCI5CglSZWN0YW5nbGUSFgoGbGVuZ3RoGAEgASgCUgZsZW5ndGgSFAoFd2lkdGgYAiABKAJSBXdpZHRoIiAKBkNpcmNsZRIWCgZyYWRpdXMYASABKAJSBnJhZGl1cyJPCghUcmlhbmdsZRIVCgZlZGdlX2EYASABKAJSBWVkZ2VBEhUKBmVkZ2VfYhgCIAEoAlIFZWRnZUISFQoGZWRnZV9jGAMgASgCUgVlZGdlQyJICg1QYXJhbGxlbG9ncmFtEh8KC2Jhc2VfbGVuZ3RoGAEgASgCUgpiYXNlTGVuZ3RoEhYKBmhlaWdodBgCIAEoAlIGaGVpZ2h0IkQKC0FyZWFSZXF1ZXN0EjUKBnNoYXBlcxgBIAMoCzIdLmFyZWFfY2FsY3VsYXRvci5TaGFwZU1lc3NhZ2VSBnNoYXBlcyIkCgxBcmVhUmVzcG9uc2USFAoFdmFsdWUYASADKAJSBXZhbHVlMq0BCgpDYWxjdWxhdG9yEk4KDGNhbGN1bGF0ZU9uZRIdLmFyZWFfY2FsY3VsYXRvci5TaGFwZU1lc3NhZ2UaHS5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlc3BvbnNlIgASTwoOY2FsY3VsYXRlTXVsdGkSHC5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlcXVlc3QaHS5hcmVhX2NhbGN1bGF0b3IuQXJlYVJlc3BvbnNlIgBCHFoXaW8ucGFjdC9hcmVhX2NhbGN1bGF0b3LQAgFiBnByb3RvMw==", - "protoFile": "syntax = \"proto3\";\n\npackage area_calculator;\n\noption php_generic_services = true;\noption go_package = \"io.pact/area_calculator\";\n\nservice Calculator {\n rpc calculateOne (ShapeMessage) returns (AreaResponse) {}\n rpc calculateMulti (AreaRequest) returns (AreaResponse) {}\n}\n\nmessage ShapeMessage {\n oneof shape {\n Square square = 1;\n Rectangle rectangle = 2;\n Circle circle = 3;\n Triangle triangle = 4;\n Parallelogram parallelogram = 5;\n }\n}\n\nmessage Square {\n float edge_length = 1;\n}\n\nmessage Rectangle {\n float length = 1;\n float width = 2;\n}\n\nmessage Circle {\n float radius = 1;\n}\n\nmessage Triangle {\n float edge_a = 1;\n float edge_b = 2;\n float edge_c = 3;\n}\n\nmessage Parallelogram {\n float base_length = 1;\n float height = 2;\n}\n\nmessage AreaRequest {\n repeated ShapeMessage shapes = 1;\n}\n\nmessage AreaResponse {\n repeated float value = 1;\n}" - } - }, - "name": "protobuf", - "version": "0.1.17" - } - ] - }, - "provider": { - "name": "area-calculator-provider" - } -} \ No newline at end of file diff --git a/python/pacts/http-consumer-1-http-provider.json b/python/pacts/http-consumer-1-http-provider.json deleted file mode 100644 index f065a8ff9..000000000 --- a/python/pacts/http-consumer-1-http-provider.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "consumer": { - "name": "http-consumer-1" - }, - "interactions": [ - { - "description": "A POST request to create book", - "providerStates": [ - { - "name": "No book fixtures required" - } - ], - "request": { - "body": { - "author": "Margaret Atwood", - "description": "Brilliantly conceived and executed, this powerful evocation of twenty-first century America gives full rein to Margaret Atwood's devastating irony, wit and astute perception.", - "isbn": "0099740915", - "publicationDate": "1985-07-31T00:00:00+00:00", - "title": "The Handmaid's Tale" - }, - "headers": { - "Content-Type": "application/json" - }, - "matchingRules": { - "body": { - "$.author": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.description": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.isbn": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.publicationDate": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$" - } - ] - }, - "$.title": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - } - }, - "header": {} - }, - "method": "POST", - "path": "/api/books" - }, - "response": { - "body": { - "@context": "/api/contexts/Book", - "@id": "/api/books/0114b2a8-3347-49d8-ad99-0e792c5a30e6", - "@type": "Book", - "author": "Melisa Kassulke", - "description": "Quaerat odit quia nisi accusantium natus voluptatem. Explicabo corporis eligendi ut ut sapiente ut qui quidem. Optio amet velit aut delectus. Sed alias asperiores perspiciatis deserunt omnis. Mollitia unde id in.", - "publicationDate": "1999-02-13T00:00:00+07:00", - "reviews": [], - "title": "Voluptas et tempora repellat corporis excepturi." - }, - "headers": { - "Content-Type": "application/ld+json; charset=utf-8" - }, - "matchingRules": { - "body": { - "$.author": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.description": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.publicationDate": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$" - } - ] - }, - "$.title": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$['@id']": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^\\/api\\/books\\/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$" - } - ] - } - }, - "header": {} - }, - "status": 200 - } - } - ], - "metadata": { - "pact-python": { - "ffi": "0.3.15" - }, - "pactRust": { - "ffi": "0.3.15", - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "3.0.0" - } - }, - "provider": { - "name": "http-provider" - } -} \ No newline at end of file diff --git a/python/pacts/http-consumer-2-http-provider.json b/python/pacts/http-consumer-2-http-provider.json deleted file mode 100644 index b60c5f730..000000000 --- a/python/pacts/http-consumer-2-http-provider.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "consumer": { - "name": "http-consumer-2" - }, - "interactions": [ - { - "description": "A PUT request to generate book cover", - "providerStates": [ - { - "name": "A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required" - } - ], - "request": { - "body": [], - "headers": { - "Content-Type": "application/json" - }, - "method": "PUT", - "path": "/api/books/fb5a885f-f7e8-4a50-950f-c1a64a94d500/generate-cover" - }, - "response": { - "status": 204 - } - } - ], - "metadata": { - "pact-python": { - "ffi": "0.3.15" - }, - "pactRust": { - "ffi": "0.3.15", - "mockserver": "0.9.5", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "3.0.0" - } - }, - "provider": { - "name": "http-provider" - } -} \ No newline at end of file diff --git a/python/pacts/merge-test-consumer-merge-test-provider-http.json b/python/pacts/merge-test-consumer-merge-test-provider-http.json deleted file mode 100644 index 18430e4a2..000000000 --- a/python/pacts/merge-test-consumer-merge-test-provider-http.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "consumer": { - "name": "merge-test-consumer" - }, - "interactions": [ - { - "description": "a request for an order by ID", - "pending": false, - "providerStates": [ - { - "name": "an order with ID {id} exists", - "params": { - "id": 1 - } - } - ], - "request": { - "headers": { - "Accept": [ - "application/json" - ] - }, - "method": "GET", - "path": "/api/orders/1" - }, - "response": { - "body": { - "content": { - "date": "2023-06-28T12:13:14.0000000+01:00", - "id": 1, - "status": "Pending" - }, - "contentType": "application/json", - "encoded": false - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "matchingRules": { - "body": { - "$.date": { - "combine": "AND", - "matchers": [ - { - "match": "type" - } - ] - }, - "$.id": { - "combine": "AND", - "matchers": [ - { - "match": "integer" - } - ] - }, - "$.status": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "Pending|Fulfilling|Shipped" - } - ] - } - } - }, - "status": 200 - }, - "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 - }, - "transport": "http", - "type": "Synchronous/HTTP" - } - ], - "metadata": { - "pactRust": { - "ffi": "0.4.21", - "mockserver": "1.2.8", - "models": "1.2.1" - }, - "pactSpecification": { - "version": "4.0" - } - }, - "provider": { - "name": "merge-test-provider-http" - } -} \ No newline at end of file diff --git a/python/pacts/merge-test-consumer-merge-test-provider-message.json b/python/pacts/merge-test-consumer-merge-test-provider-message.json deleted file mode 100644 index 22a96fb9c..000000000 --- a/python/pacts/merge-test-consumer-merge-test-provider-message.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "consumer": { - "name": "merge-test-consumer" - }, - "interactions": [ - { - "description": "a request to update the status of an order", - "pending": false, - "providerStates": [ - { - "name": "an order with ID {id} exists", - "params": { - "id": 1 - } - } - ], - "request": { - "body": { - "content": "Fulfilling", - "contentType": "application/json", - "encoded": false - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "matchingRules": { - "body": { - "$": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "Pending|Fulfilling|Shipped" - } - ] - } - } - }, - "method": "PUT", - "path": "/api/orders/1/status" - }, - "response": { - "status": 204 - }, - "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" - } - ], - "metadata": { - "pactRust": { - "ffi": "0.4.21", - "models": "1.2.1" - }, - "pactSpecification": { - "version": "4.0" - } - }, - "provider": { - "name": "merge-test-provider-message" - } -} \ No newline at end of file diff --git a/python/pacts/message-consumer-2-message-provider.json b/python/pacts/message-consumer-2-message-provider.json deleted file mode 100644 index 4fba5ee67..000000000 --- a/python/pacts/message-consumer-2-message-provider.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "consumer": { - "name": "message-consumer-2" - }, - "messages": [ - { - "contents": { - "uuid": "fb5a885f-f7e8-4a50-950f-c1a64a94d500" - }, - "description": "Book (id fb5a885f-f7e8-4a50-950f-c1a64a94d500) created message", - "matchingRules": { - "body": { - "$.uuid": { - "combine": "AND", - "matchers": [ - { - "match": "regex", - "regex": "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$" - } - ] - } - } - }, - "metadata": { - "contentType": "application/json" - }, - "providerStates": [ - { - "name": "A book with id fb5a885f-f7e8-4a50-950f-c1a64a94d500 is required" - } - ] - } - ], - "metadata": { - "pactRust": { - "ffi": "0.3.15", - "models": "1.0.0" - }, - "pactSpecification": { - "version": "3.0.0" - } - }, - "provider": { - "name": "message-provider" - } -} \ No newline at end of file diff --git a/python/register_ffi.py b/python/register_ffi.py deleted file mode 100644 index fa428f684..000000000 --- a/python/register_ffi.py +++ /dev/null @@ -1,72 +0,0 @@ -import platform -import os -import sys - -IS_64 = sys.maxsize > 2 ** 32 - -DIRECTIVES =[ -"#ifndef pact_ffi_h", -"#define pact_ffi_h", -"#include ", -"#include ", -"#include ", -"#include ", -"#endif /* pact_ffi_h */" - ] - -# Build with cargo build in pact_ffi crate -FFI_HEADER_DIR='../rust/pact_ffi/include/' -FFI_LIB_DIR='../rust/target/debug/' - -FFI_HEADER_PATH=f"{FFI_HEADER_DIR}pact.h" - -def process_pact_header_file(file): - with open(file, "r") as fp: - lines = fp.readlines() - - pactfile = [] - - for line in lines: - if line.strip("\n") not in DIRECTIVES: - pactfile.append(line) - - return ''.join(pactfile) - -def load_ffi_library(ffi): - """Load the right library.""" - target_platform = platform.platform().lower() - print(target_platform) - print(platform.machine()) - - if ("darwin" in target_platform or "macos" in target_platform) and ("aarch64" in platform.machine() or "arm64" in platform.machine()): - libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi.dylib") - # the commented out lib names come from the distributed binaries - # libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi-osx-aarch64-apple-darwin.dylib") - elif "darwin" in target_platform or "macos" in target_platform: - libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi.dylib") - # libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi-osx-x86_64.dylib") - elif "linux" in target_platform and IS_64 and ("aarch64" in platform.machine() or "arm64" in platform.machine()): - libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi.so") - # libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi-linux-aarch64.so") - elif "linux" in target_platform and IS_64: - libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi.so") - # libname = os.path.abspath(f"{FFI_LIB_DIR}libpact_ffi-linux-x86_64.so") - elif 'windows' in target_platform: - libname = os.path.abspath(f"{FFI_LIB_DIR}pact_ffi-windows-x86_64.dll") - # libname = os.path.abspath(f"{FFI_LIB_DIR}pact_ffi-windows-x86_64.dll") - else: - msg = ('Unfortunately, {} is not a supported platform. Only Linux,' - ' Windows, and OSX are currently supported.').format(target_platform) - raise Exception(msg) - - return ffi.dlopen(libname) - -def load_ffi_headers(ffi): - return ffi.cdef(process_pact_header_file(FFI_HEADER_PATH)) - -def get_ffi_lib(ffi): - load_ffi_headers(ffi) - lib = load_ffi_library(ffi) - return lib - - diff --git a/python/requires.txt b/python/requires.txt deleted file mode 100644 index 7f8169e58..000000000 --- a/python/requires.txt +++ /dev/null @@ -1,2 +0,0 @@ -cffi==1.14.6 -requests>=2.5.0 diff --git a/ruby/detect_os.rb b/ruby/detect_os.rb deleted file mode 100644 index 18bc0e153..000000000 --- a/ruby/detect_os.rb +++ /dev/null @@ -1,89 +0,0 @@ -module DetectOS - def self.windows_arm? - return unless !(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RbConfig::CONFIG['arch']).nil? && !(/arm64/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.windows? - return if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.mac_arm? - return unless !(/darwin/ =~ RbConfig::CONFIG['arch']).nil? && !(/arm64/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.mac? - return unless !(/darwin/ =~ RbConfig::CONFIG['arch']).nil? && !(/x86_64/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.linux_arm_musl? - return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/aarch64/ =~ RbConfig::CONFIG['arch']).nil? && !(/musl/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.linux_musl? - return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/x86_64/ =~ RbConfig::CONFIG['arch']).nil?&& !(/musl/ =~ RbConfig::CONFIG['arch']).nil? - true - end - def self.linux_arm? - return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/aarch64/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.linux? - return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/x86_64/ =~ RbConfig::CONFIG['arch']).nil? - true - end - - def self.debug? - return if ENV['DEBUG_TARGET'].nil? - true - end - - def self.get_bin_path - if debug? - ENV['PACT_FFI_LIBRARY_PATH'].to_s - elsif windows_arm? - File.expand_path("#{__dir__}/../rust/target/aarch64-pc-windows-msvc/release/pact_ffi.dll") - elsif windows? - File.expand_path("#{__dir__}/../rust/target/x86_64-pc-windows-msvc/release/pact_ffi.dll") - elsif mac_arm? - File.expand_path("#{__dir__}/../rust/target/aarch64-apple-darwin/release/libpact_ffi.dylib") - elsif mac? - File.expand_path("#{__dir__}/../rust/target/x86_64-apple-darwin/release/libpact_ffi.dylib") - elsif linux_arm_musl? - File.expand_path("#{__dir__}/../rust/target/aarch64-unknown-linux-musl/release/libpact_ffi.so") - elsif linux_musl? - File.expand_path("#{__dir__}/../rust/target/x86_64-unknown-linux-musl/release/libpact_ffi.so") - elsif linux_arm? - File.expand_path("#{__dir__}/../rust/target/aarch64-unknown-linux-gnu/release/libpact_ffi.so") - elsif linux? - File.expand_path("#{__dir__}/../rust/target/x86_64-unknown-linux-gnu/release/libpact_ffi.so") - else - raise "Detected #{RbConfig::CONFIG['arch']}-- I have no idea what to do with that." - end - end - - def self.get_os - if windows_arm? - 'win-arm64' - elsif windows? - 'win' - elsif mac_arm? - 'macos-arm64' - elsif mac? - 'linux-x8664' - elsif linux_arm? - 'linux-aarch64' - elsif linux? - 'linux-x8664' - else - raise "Detected #{RbConfig::CONFIG['arch']}-- I have no idea what to do with that." - end - end -end - -ENV['PACT_DEBUG'] ? (puts "Detected platform: #{RbConfig::CONFIG['arch']} \nLoad Path: #{DetectOS.get_bin_path}" ): nil \ No newline at end of file diff --git a/ruby/example_consumer_spec/.rspec b/ruby/example_consumer_spec/.rspec deleted file mode 100644 index 34c5164d9..000000000 --- a/ruby/example_consumer_spec/.rspec +++ /dev/null @@ -1,3 +0,0 @@ ---format documentation ---color ---require spec_helper diff --git a/ruby/example_consumer_spec/.ruby-version b/ruby/example_consumer_spec/.ruby-version deleted file mode 100644 index 437459cd9..000000000 --- a/ruby/example_consumer_spec/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.5.0 diff --git a/ruby/example_consumer_spec/Gemfile b/ruby/example_consumer_spec/Gemfile deleted file mode 100644 index 2fbde4ffa..000000000 --- a/ruby/example_consumer_spec/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source 'https://rubygems.org' - -gem 'pact_mockserver_mk2', path: '../pact_mockserver_mk2' - -gem 'rake' -gem 'rspec' -gem 'httparty', '>= 0.21.0' diff --git a/ruby/example_consumer_spec/Gemfile.lock b/ruby/example_consumer_spec/Gemfile.lock deleted file mode 100644 index 4232d541d..000000000 --- a/ruby/example_consumer_spec/Gemfile.lock +++ /dev/null @@ -1,45 +0,0 @@ -PATH - remote: ../pact_mockserver_mk2 - specs: - pact_mockserver_mk2 (0.0.0) - helix_runtime (~> 0.7.0) - -GEM - remote: https://rubygems.org/ - specs: - diff-lcs (1.3) - helix_runtime (0.7.3) - rake (>= 10.0) - thor (>= 0.19.4, < 2.0) - tomlrb (~> 1.2.4) - httparty (0.16.1) - multi_xml (>= 0.5.2) - multi_xml (0.6.0) - rake (13.0.1) - rspec (3.7.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-mocks (3.7.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-support (3.7.1) - thor (0.20.0) - tomlrb (1.2.6) - -PLATFORMS - ruby - -DEPENDENCIES - httparty - pact_mockserver_mk2! - rake - rspec - -BUNDLED WITH - 1.16.1 diff --git a/ruby/example_consumer_spec/Rakefile b/ruby/example_consumer_spec/Rakefile deleted file mode 100644 index 70a846df5..000000000 --- a/ruby/example_consumer_spec/Rakefile +++ /dev/null @@ -1,5 +0,0 @@ -require 'rspec/core/rake_task' - -RSpec::Core::RakeTask.new(:spec) - -task :default => :spec diff --git a/ruby/example_consumer_spec/spec/simple_consumer_spec.rb b/ruby/example_consumer_spec/spec/simple_consumer_spec.rb deleted file mode 100644 index cb0fd2d3b..000000000 --- a/ruby/example_consumer_spec/spec/simple_consumer_spec.rb +++ /dev/null @@ -1,152 +0,0 @@ -require 'httparty' - -RSpec.describe 'Simple Consumer Spec' do - - describe 'with matching requests' do - - let(:pact) do - ' - { - "provider": { - "name": "Alice Service" - }, - "consumer": { - "name": "Consumer" - }, - "interactions": [ - { - "description": "a retrieve Mallory request", - "request": { - "method": "GET", - "path": "/mallory", - "query": "name=ron&status=good" - }, - "response": { - "status": 200, - "headers": { - "Content-Type": "text/html" - }, - "body": "That is some good Mallory." - } - } - ], - "metadata": { - "pact-specification": { - "version": "1.0.0" - }, - "pact-jvm": { - "version": "1.0.0" - } - } - } - ' - end - - let(:mock_server_port) { PactMockServerMk2::create_mock_server(pact, 0) } - - after do - PactMockServerMk2::cleanup_mock_server(mock_server_port) - end - - it 'executes the pact test with no errors' do - puts "Mock server port=#{mock_server_port}" - - response = HTTParty.get("http://localhost:#{mock_server_port}/mallory?name=ron&status=good") - - expect(response.body).to eq 'That is some good Mallory.' - expect(PactMockServerMk2::all_matched(mock_server_port)).to be true - end - end - - - describe 'with mismatching requests' do - - let(:pact) do - ' - { - "provider": { - "name": "test_provider" - }, - "consumer": { - "name": "test_consumer" - }, - "interactions": [ - { - "providerState": "test state", - "description": "test interaction", - "request": { - "method": "POST", - "path": "/", - "body": { - "complete": { - "certificateUri": "http://...", - "issues": { - "idNotFound": {} - }, - "nevdis": { - "body": null, - "colour": null, - "engine": null - }, - "body": 123456 - }, - "body": [ - 1, - 2, - 3 - ] - } - }, - "response": { - "status": 200 - } - } - ], - "metadata": { - "pact-specification": { - "version": "2.0.0" - }, - "pact-jvm": { - "version": "" - } - } - } - ' - end - - let(:mock_server_port) { PactMockServerMk2::create_mock_server(pact, 0) } - - after do - PactMockServerMk2::cleanup_mock_server(mock_server_port) - end - - it 'returns the mismatches' do - puts "Mock server port=#{mock_server_port}" - - expect(PactMockServerMk2::all_matched(mock_server_port)).to be false - - response1 = HTTParty.post("http://localhost:#{mock_server_port}/", - :headers => {'Content-Type': 'application/json'}, :body => '{}') - - response2 = HTTParty.put("http://localhost:#{mock_server_port}/mallory", body: { - :complete => { - :certificateUri => "http://...", - :issues => {}, - :nevdis => { - :body => "red", - :colour => nil, - :engine => nil - }, - :body => "123456" - }, - :body => [1, 3] - }) - - expect(PactMockServerMk2::all_matched(mock_server_port)).to be false - mismatchers = PactMockServerMk2::mock_server_mismatches(mock_server_port) - puts mismatchers - expect(mismatchers.length).to eql(2) - end - end - -end diff --git a/ruby/example_consumer_spec/spec/spec_helper.rb b/ruby/example_consumer_spec/spec/spec_helper.rb deleted file mode 100644 index dae29caf4..000000000 --- a/ruby/example_consumer_spec/spec/spec_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'bundler/setup' -require 'pact_mockserver_mk2' - -RSpec.configure do |config| - # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = '.rspec_status' - - # Disable RSpec exposing methods globally on `Module` and `main` - config.disable_monkey_patching! - - config.expect_with :rspec do |c| - c.syntax = :expect - end -end diff --git a/ruby/pact_mockserver_mk2/.rspec b/ruby/pact_mockserver_mk2/.rspec deleted file mode 100644 index 34c5164d9..000000000 --- a/ruby/pact_mockserver_mk2/.rspec +++ /dev/null @@ -1,3 +0,0 @@ ---format documentation ---color ---require spec_helper diff --git a/ruby/pact_mockserver_mk2/.ruby-version b/ruby/pact_mockserver_mk2/.ruby-version deleted file mode 100644 index 437459cd9..000000000 --- a/ruby/pact_mockserver_mk2/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.5.0 diff --git a/ruby/pact_mockserver_mk2/.travis.yml b/ruby/pact_mockserver_mk2/.travis.yml deleted file mode 100644 index 6a8e36fa1..000000000 --- a/ruby/pact_mockserver_mk2/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -sudo: false -language: ruby -rvm: - - 2.5.0 -before_install: gem install bundler -v 1.16.1 diff --git a/ruby/pact_mockserver_mk2/CODE_OF_CONDUCT.md b/ruby/pact_mockserver_mk2/CODE_OF_CONDUCT.md deleted file mode 100644 index 58b1f842a..000000000 --- a/ruby/pact_mockserver_mk2/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at uglyog@gmail.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/ruby/pact_mockserver_mk2/Cargo.lock b/ruby/pact_mockserver_mk2/Cargo.lock deleted file mode 100644 index 7e09ee568..000000000 --- a/ruby/pact_mockserver_mk2/Cargo.lock +++ /dev/null @@ -1,730 +0,0 @@ -[[package]] -name = "aho-corasick" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ansi_term" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "base64" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bitflags" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "byteorder" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cfg-if" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cookie" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cstr-macro" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "difference" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "dtoa" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "either" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "env_logger" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "helix" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cstr-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "libcruby-sys 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hex" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hpack" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "httparse" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hyper" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "idna" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "indextree" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "itertools" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itertools" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itoa" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.40" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libcruby-sys" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "log" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "maplit" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "matches" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "memchr" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "mime" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-traits" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num_cpus" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "p-macro" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "pact_matching" -version = "0.4.1" -dependencies = [ - "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "indextree 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "maplit 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "p-macro 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "sxd-document 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pact_mock_server" -version = "0.4.1" -dependencies = [ - "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "maplit 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "p-macro 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pact_matching 0.4.1", - "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pact_mockserver_mk2" -version = "0.0.0" -dependencies = [ - "helix 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "pact_matching 0.4.1", - "pact_mock_server 0.4.1", - "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "simplelog 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "peresil" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "proc-macro2" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quote" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand" -version = "0.3.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "redox_syscall" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "regex" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex-syntax" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "safemem" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_derive" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_derive_internals" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_json" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "simplelog" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "solicit" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "sxd-document" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typed-arena 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "term" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread_local" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "time" -version = "0.1.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "traitobject" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typed-arena" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "ucd-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "url" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "utf8-ranges" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "uuid" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "uuid" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "version_check" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" -"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" -"checksum base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5032d51da2741729bfdaeb2664d9b8c6d9fd1e2b90715c660b6def36628499c2" -"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" -"checksum byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b5bdfe7ee3ad0b99c9801d58807a9dbc9e09196365b0203853b99889ab3c87" -"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -"checksum cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0e3d6405328b6edb412158b3b7710e2634e23f3614b9bb1c412df7952489a626" -"checksum cstr-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db53fddba18cdd35477a7213a3ef6acfbfa333c31b42ce019e544c4a1420a06f" -"checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" -"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" -"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" -"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum helix 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1a5e45d09f37327fded2b1e0939ab4c061e181b0c007f82c53ccd03e869cf085" -"checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" -"checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58" -"checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37" -"checksum hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9bf64f730d6ee4b0528a5f0a316363da9d8104318731509d4ccc86248f82b3" -"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" -"checksum indextree 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4891aa1dfa3c697a4406e93d952d924b34664a040250a7d5e6a45290aaa6c0" -"checksum itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3f2be4da1690a039e9ae5fd575f706a63ad5a2120f161b1d653c9da3930dd21" -"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" -"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" -"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b" -"checksum libcruby-sys 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b0fb9beb529127d706dd12e26f961be3e527badb74a7b2e5d6b9d928fe6059" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" -"checksum maplit 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "22593015b8df7747861c69c28acd32589fb96c1686369f3b661d12e409d4cf65" -"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" -"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dee092fcdf725aee04dd7da1d21debff559237d49ef1cb3e69bcb8ece44c7364" -"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" -"checksum p-macro 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2e6ec260ffca4e190641151b2d900ce473300f53de8f298a132ad37168581c9" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f658886ed52e196e850cfbbfddab9eaa7f6d90dd0929e264c31e5cec07e09e57" -"checksum proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "77997c53ae6edd6d187fec07ec41b207063b5ee6f33680e9fa86d405cdd313d4" -"checksum quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0ff51282f28dc1b53fd154298feaa2e77c5ea0dba68e1fd8b03b72fbe13d2a" -"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" -"checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" -"checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb" -"checksum regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2550876c31dc914696a6c2e01cbce8afba79a93c8ae979d2fe051c0230b3756" -"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" -"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum semver 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd61b85a0fa777f7fb7c454b9189b2941b110d1385ce84d7f76efdf1606a85" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "d3bcee660dcde8f52c3765dd9ca5ee36b4bf35470a738eb0bd5a8752b0389645" -"checksum serde_derive 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "f1711ab8b208541fa8de00425f6a577d90f27bb60724d2bb5fd911314af9668f" -"checksum serde_derive_internals 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "89b340a48245bc03ddba31d0ff1709c118df90edc6adabaca4aac77aea181cce" -"checksum serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "5c508584d9913df116b91505eec55610a2f5b16e9ed793c46e4d0152872b3e74" -"checksum simplelog 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "24b615b1a3cc51ffa565d9a1d0cfcc49fe7d64737ada84eca284cddb0292d125" -"checksum solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "172382bac9424588d7840732b250faeeef88942e37b6e35317dce98cafdd75b2" -"checksum sxd-document 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1e360d2575b173847506841ca97dbab96b6d27a2ec660b70932fe32a2b12e0a2" -"checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59" -"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" -"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" -"checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098" -"checksum traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "07eaeb7689bb7fca7ce15628319635758eda769fed481ecfe6686ddef2600616" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum typed-arena 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5934776c3ac1bea4a9d56620d6bf2d483b20d394e49581db40f187e1118ff667" -"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" -"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" -"checksum uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc7e3b898aa6f6c08e5295b6c89258d1331e9ac578cc992fb818759951bdc22" -"checksum uuid 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4670e1e935f7edd193a413f802e2ee52274aed62a09ccaab1656515c9c53a66" -"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/ruby/pact_mockserver_mk2/Cargo.toml b/ruby/pact_mockserver_mk2/Cargo.toml deleted file mode 100644 index a88bb9cd2..000000000 --- a/ruby/pact_mockserver_mk2/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "pact_mockserver_mk2" -version = "0.0.0" -authors = ["Ronald Holshausen "] - -[lib] -crate-type = ["cdylib"] - -[dependencies] -helix = "0.7" -pact_matching = { version = "0.5", path = "../../rust/pact_matching" } -pact_mock_server = { version = "0.5", path = "../../rust/pact_mock_server" } -serde_json = "1.0" -log = "0.3.8" -simplelog = "0.4.0" -uuid = { version = "0.6", features = ["v4"] } diff --git a/ruby/pact_mockserver_mk2/Gemfile b/ruby/pact_mockserver_mk2/Gemfile deleted file mode 100644 index d67893f6d..000000000 --- a/ruby/pact_mockserver_mk2/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://rubygems.org' - -git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } - -# Specify your gem's dependencies in pact_mockserver_mk2.gemspec -gemspec diff --git a/ruby/pact_mockserver_mk2/Gemfile.lock b/ruby/pact_mockserver_mk2/Gemfile.lock deleted file mode 100644 index 8bdbf256e..000000000 --- a/ruby/pact_mockserver_mk2/Gemfile.lock +++ /dev/null @@ -1,42 +0,0 @@ -PATH - remote: . - specs: - pact_mockserver_mk2 (0.0.0) - helix_runtime (~> 0.7.0) - -GEM - remote: https://rubygems.org/ - specs: - diff-lcs (1.3) - helix_runtime (0.7.3) - rake (>= 10.0) - thor (>= 0.19.4, < 2.0) - tomlrb (~> 1.2.4) - rake (13.0.1) - rspec (3.7.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-mocks (3.7.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-support (3.7.1) - thor (0.20.0) - tomlrb (1.2.6) - -PLATFORMS - ruby - -DEPENDENCIES - bundler (~> 1.16) - pact_mockserver_mk2! - rake (~> 13.0) - rspec (~> 3.0) - -BUNDLED WITH - 1.16.1 diff --git a/ruby/pact_mockserver_mk2/LICENSE.txt b/ruby/pact_mockserver_mk2/LICENSE.txt deleted file mode 100644 index d0de87414..000000000 --- a/ruby/pact_mockserver_mk2/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Ronald Holshausen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/ruby/pact_mockserver_mk2/README.md b/ruby/pact_mockserver_mk2/README.md deleted file mode 100644 index cc8a9bd8a..000000000 --- a/ruby/pact_mockserver_mk2/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Pact::Mockserver::Mk2 - -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pact/mockserver/mk2`. To experiment with that code, run `bin/console` for an interactive prompt. - -TODO: Delete this and the text above, and describe your gem - -## Installation - -Add this line to your application's Gemfile: - -```ruby -gem 'pact_mockserver_mk2' -``` - -And then execute: - - $ bundle - -Or install it yourself as: - - $ gem install pact-mockserver-mk2 - -## Usage - -TODO: Write usage instructions here - -## Development - -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. - -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). - -## Contributing - -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pact-mockserver-mk2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. - -## License - -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). - -## Code of Conduct - -Everyone interacting in the Pact::Mockserver::Mk2 project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pact-mockserver-mk2/blob/master/CODE_OF_CONDUCT.md). diff --git a/ruby/pact_mockserver_mk2/Rakefile b/ruby/pact_mockserver_mk2/Rakefile deleted file mode 100644 index 3583eac7e..000000000 --- a/ruby/pact_mockserver_mk2/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'bundler/gem_tasks' -require 'rspec/core/rake_task' -require 'helix_runtime/build_task' - -HelixRuntime::BuildTask.new - -RSpec::Core::RakeTask.new(:spec) - -task :spec => :build -task :default => :spec diff --git a/ruby/pact_mockserver_mk2/bin/console b/ruby/pact_mockserver_mk2/bin/console deleted file mode 100755 index 3d5db9497..000000000 --- a/ruby/pact_mockserver_mk2/bin/console +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby - -require 'bundler/setup' -require 'pact_mockserver_mk2' - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start - -require 'irb' -IRB.start(__FILE__) diff --git a/ruby/pact_mockserver_mk2/bin/setup b/ruby/pact_mockserver_mk2/bin/setup deleted file mode 100755 index dce67d860..000000000 --- a/ruby/pact_mockserver_mk2/bin/setup +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' -set -vx - -bundle install - -# Do any other automated setup that you need to do here diff --git a/ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2.rb b/ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2.rb deleted file mode 100644 index 9b6957a0c..000000000 --- a/ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'pact/mockserver/mk2/version' - -module Pact - module Mockserver - module Mk2 - # Your code goes here... - end - end -end diff --git a/ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2/version.rb b/ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2/version.rb deleted file mode 100644 index 6ab2df24d..000000000 --- a/ruby/pact_mockserver_mk2/lib/pact/mockserver/mk2/version.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Pact - module Mockserver - module Mk2 - VERSION = '0.0.0'.freeze - end - end -end diff --git a/ruby/pact_mockserver_mk2/lib/pact_mockserver_mk2.rb b/ruby/pact_mockserver_mk2/lib/pact_mockserver_mk2.rb deleted file mode 100644 index fa1dcfc37..000000000 --- a/ruby/pact_mockserver_mk2/lib/pact_mockserver_mk2.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'helix_runtime' - -begin - require 'pact_mockserver_mk2/native' -rescue LoadError => e - warn 'Unable to load pact_mockserver_mk2 native. Please run `rake build`' - warn e -end - -require 'pact/mockserver/mk2' diff --git a/ruby/pact_mockserver_mk2/pact_mockserver_mk2.gemspec b/ruby/pact_mockserver_mk2/pact_mockserver_mk2.gemspec deleted file mode 100644 index ec4f67e6f..000000000 --- a/ruby/pact_mockserver_mk2/pact_mockserver_mk2.gemspec +++ /dev/null @@ -1,37 +0,0 @@ - -lib = File.expand_path('../lib', __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'pact/mockserver/mk2/version' - -Gem::Specification.new do |spec| - spec.name = 'pact_mockserver_mk2' - spec.version = Pact::Mockserver::Mk2::VERSION - spec.authors = ['Ronald Holshausen'] - spec.email = ['uglyog@gmail.com'] - - spec.summary = 'Pact mock server library based on the Pact Rust implementation' - # spec.description = 'TODO: Write a longer description or delete this line.' - spec.homepage = "TODO: Put your gem's website or public repo URL here." - spec.license = 'MIT' - - # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' - # to allow pushing to a single host or delete this section to allow pushing to any host. - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" - else - raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' - end - - spec.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features)/}) - end - spec.bindir = 'exe' - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ['lib'] - - spec.add_dependency 'helix_runtime', '~> 0.7.0' - - spec.add_development_dependency 'bundler', '~> 1.16' - spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rspec', '~> 3.0' -end diff --git a/ruby/pact_mockserver_mk2/spec/pact/pact_mockserver_mk2_spec.rb b/ruby/pact_mockserver_mk2/spec/pact/pact_mockserver_mk2_spec.rb deleted file mode 100644 index 608964905..000000000 --- a/ruby/pact_mockserver_mk2/spec/pact/pact_mockserver_mk2_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'pact_mockserver_mk2' - -RSpec.describe Pact::Mockserver::Mk2 do - it 'has a version number' do - expect(Pact::Mockserver::Mk2::VERSION).not_to be nil - end -end diff --git a/ruby/pact_mockserver_mk2/spec/spec_helper.rb b/ruby/pact_mockserver_mk2/spec/spec_helper.rb deleted file mode 100644 index dae29caf4..000000000 --- a/ruby/pact_mockserver_mk2/spec/spec_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'bundler/setup' -require 'pact_mockserver_mk2' - -RSpec.configure do |config| - # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = '.rspec_status' - - # Disable RSpec exposing methods globally on `Module` and `main` - config.disable_monkey_patching! - - config.expect_with :rspec do |c| - c.syntax = :expect - end -end diff --git a/ruby/pact_mockserver_mk2/src/lib.rs b/ruby/pact_mockserver_mk2/src/lib.rs deleted file mode 100644 index a40b65743..000000000 --- a/ruby/pact_mockserver_mk2/src/lib.rs +++ /dev/null @@ -1,60 +0,0 @@ -#[macro_use] extern crate helix; -extern crate pact_mock_server; -extern crate pact_matching; -#[macro_use] extern crate serde_json; -#[macro_use] extern crate log; -extern crate simplelog; -extern crate uuid; - -use simplelog::*; -use uuid::Uuid; -use pact_matching::models::Pact; -use pact_mock_server::MatchResult; - -ruby! { - - class PactMockServerMk2 { - def create_mock_server(pact_json: String, port: i32) -> Result { - SimpleLogger::init(LogLevelFilter::Info, Config::default()).unwrap_or(()); - - match serde_json::from_str(&pact_json) { - Ok(pact_json) => { - let pact = Pact::from_json(&"".to_string(), &pact_json); - pact_mock_server::start_mock_server(Uuid::new_v4().simple().to_string(), pact, port) - .map_err(|err| { - error!("Could not start mock server: {}", err); - format!("Could not start mock server: {}", err) - }) - }, - Err(err) => { - error!("Could not parse pact json: {}", err); - Err(format!("Could not parse pact json: {}", err)) - } - } - } - - def cleanup_mock_server(port: i32) -> bool { - pact_mock_server::shutdown_mock_server_by_port(port) - } - - def all_matched(port: i32) -> bool { - pact_mock_server::mock_server_matched(port) - } - - def mock_server_mismatches(port: i32) -> Option> { - pact_mock_server::lookup_mock_server_by_port(port, &|mock_server| { - mock_server.mismatches().iter() - .map(|mismatch| mismatch.to_json().to_string() ) - .collect() - }) - } - } -} - -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - assert_eq!(2 + 2, 4); - } -} diff --git a/ruby/smoke-test.sh b/ruby/smoke-test.sh deleted file mode 100755 index fef0e35b5..000000000 --- a/ruby/smoke-test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e -set -x - -case $1 in -x86_64-unknown-linux-musl) - docker run --platform=linux/amd64 --rm -v $(pwd)/..:/home -w /home/ruby ruby:alpine ruby test_ffi.rb - ;; -aarch64-unknown-linux-musl) - docker run --platform=linux/arm64 --rm -v $(pwd)/..:/home -w /home/ruby ruby:alpine ruby test_ffi.rb - ;; -x86_64-unknown-linux-gnu) - docker run --platform=linux/amd64 --rm -v $(pwd)/..:/home -w /home/ruby ruby:slim ruby test_ffi.rb - ;; -aarch64-unknown-linux-gnu) - docker run --platform=linux/arm64 --rm -v $(pwd)/..:/home -w /home/ruby ruby:slim ruby test_ffi.rb - ;; -aarch64-pc-windows-msvc) - echo unable to test in github actions - exit 0 - ;; -*) ruby test_ffi.rb ;; -esac diff --git a/ruby/test_ffi.rb b/ruby/test_ffi.rb deleted file mode 100644 index 36fd38d8f..000000000 --- a/ruby/test_ffi.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'fiddle' -require_relative 'detect_os' - -lib = Fiddle.dlopen(DetectOS.get_bin_path) - -pactffi_version = Fiddle::Function.new( - lib['pactffi_version'], - [], - Fiddle::TYPE_VOIDP -) -pactffi_logger_init = Fiddle::Function.new( - lib['pactffi_logger_init'], - [], - Fiddle::TYPE_VOIDP -) -pactffi_logger_apply = Fiddle::Function.new( - lib['pactffi_logger_apply'], - [], - Fiddle::TYPE_VOIDP -) -pactffi_logger_attach_sink = Fiddle::Function.new( - lib['pactffi_logger_attach_sink'], - [Fiddle::TYPE_VOIDP, Fiddle::TYPE_INT], - Fiddle::TYPE_VOIDP -) -pactffi_log_message = Fiddle::Function.new( - lib['pactffi_log_message'], - [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP], - Fiddle::TYPE_VOIDP -) - -pactffi_logger_init.call -pactffi_logger_attach_sink.call('stdout', 5) -pactffi_logger_apply.call -pactffi_log_message.call('pact-ruby-fiddle', 'INFO', "hello from ffi version: #{pactffi_version.call}, platform: #{RUBY_PLATFORM}") \ No newline at end of file