Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
b45e9c0
Use Rust FFI: Consumer
tienvx Dec 23, 2022
849efd5
Merge branch 'master' into use-rust-ffi-consumer
tienvx Jan 11, 2023
e1d49cc
Remove method BuilderInterface::writePact
tienvx Jan 11, 2023
0d7fe0a
Remove CHANGELOG.md. Add '@internal' to classes are not supposed to b…
tienvx Jan 15, 2023
0812b31
Add missing return type to method Matcher::regex
tienvx Jan 15, 2023
cf5144b
Add more details to UPGRADE-9.0.md
tienvx Jan 15, 2023
d20f1f5
Revert multiple values support in header and query parameter
tienvx Jan 16, 2023
7d57b25
Merge branch 'master' into use-rust-ffi-consumer
Feb 14, 2023
bb256ef
Support multiple values in header and query parameter
tienvx Mar 1, 2023
d6a9d0d
Update pact ffi library
tienvx Mar 1, 2023
ca46297
Rename method getCode to getHeader
tienvx Mar 2, 2023
39718b9
Revert breaking change that require to call createMockServer manually
tienvx Mar 12, 2023
ddc46e5
Remove composer/semver
tienvx Mar 2, 2023
5dae03a
Make sure every value of header and query parameter is string
tienvx Mar 14, 2023
52e9a99
Move exception message to exception
tienvx Mar 14, 2023
bff0f9b
Extract method getSpecification() to check for supporting plugin
tienvx Mar 14, 2023
312c45c
Extract, change visibility, and move methods to abstract class to sup…
tienvx Mar 14, 2023
e7675e6
Use Rust FFI: Support multiple provider states with params for intera…
tienvx Mar 7, 2023
1e0b409
Fix provider state without params not added
tienvx Mar 16, 2023
47b0a81
Remove jsonSerialize methods
tienvx Jan 5, 2023
2754f47
Rename pact to driver
tienvx Mar 17, 2023
18b85b2
Move log level config to trait for reusing
tienvx Mar 23, 2023
5a4b15f
Allow mock server write pact file
tienvx Mar 23, 2023
072cc93
Merge branch 'master' into use-rust-ffi-consumer
tienvx May 3, 2023
29b33ec
Revert removing semver
tienvx May 3, 2023
a0302bc
Extract services and helpers
tienvx May 4, 2023
7fbc58d
Make PR smaller
tienvx May 4, 2023
ff2120f
Extract drivers and factories
tienvx May 4, 2023
420f4c2
Extract set up method
tienvx May 5, 2023
7f472fe
Simplify default interaction registry factory
tienvx May 5, 2023
c87dd62
Move methods from AbstractDriver to InteractionDriver and rename
tienvx May 5, 2023
53cef3d
Group assertions together for better readability
tienvx May 5, 2023
d5a4b83
Remove condition to make code shorter
tienvx May 5, 2023
6cf8128
Update ffi library to 0.4.4
tienvx May 5, 2023
156f989
Remove not useful annotation
tienvx May 5, 2023
bd8b751
Rename ffi service and move it to FFI namespace
tienvx May 6, 2023
d41e1ac
Assign result to variable before asserting
tienvx May 8, 2023
cc7f14c
Change type hint from 'mixed' to 'string|array|null'
tienvx May 8, 2023
dfaa021
Add @throws annotation to setPactFileWriteMode() method declaration b…
tienvx May 8, 2023
693daad
Rename FFI Proxy to Client
tienvx May 8, 2023
d960221
Extract interaction part drivers
tienvx May 8, 2023
770e6e0
Extract interaction contents drivers
tienvx May 9, 2023
29f7b4c
Extract interaction part traits for reusing
tienvx May 9, 2023
768b772
Allow sub-class access properties
tienvx May 9, 2023
a96c56a
Move common code back to MockServer for reusing. Remove methods from …
tienvx May 9, 2023
264018a
Move code from registry to driver
tienvx May 9, 2023
3a3afda
Switch term 'Driver' <--> 'Registry'
tienvx May 10, 2023
02b7fc3
Merge branch 'master' into use-rust-ffi-consumer
tienvx May 11, 2023
1d6d39e
Inject driver factory into builder
tienvx May 12, 2023
f844be0
Revert namespace change
tienvx May 12, 2023
d5d14e8
Use Rust FFI: Message Consumer
tienvx Dec 28, 2022
6aad456
Use Rust FFI: Provider
tienvx Jan 2, 2023
e96453f
Use Rust FFI: Stub Server
tienvx Jan 3, 2023
6d19fa8
Use Rust FFI: Offload process
tienvx Jan 3, 2023
9dbbde1
Fix stub server always load pact files from pact broker
tienvx May 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Rust FFI: Offload process
  • Loading branch information
tienvx committed May 12, 2023
commit 6d19fa86d5871a14bdf0ceb4ed98030132384d29
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
extensions: openssl, sockets, curl, zip, ffi
extensions: sockets, curl, zip, ffi
php-version: ${{ matrix.php }}
coverage: none

Expand Down
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@
],
"require": {
"php": "^8.0",
"ext-openssl": "*",
"ext-json": "*",
"composer/semver": "^1.4.0|^3.2.0",
"amphp/amp": "^2.5.1",
"amphp/byte-stream": "^1.8",
"amphp/log": "^1.1",
"amphp/process": "^1.1.1",
"symfony/process": "^4.4|^5.4|^6.0",
"guzzlehttp/guzzle": "^6.5.8|^7.4.5",
"phpunit/phpunit": ">=8.5.23 <10",
"tienvx/composer-downloads-plugin": "^1.2.0"
Expand Down
14 changes: 7 additions & 7 deletions example/tests/Provider/PactVerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
use PhpPact\Standalone\ProviderVerifier\Model\Config\ProviderTransport;
use PhpPact\Standalone\ProviderVerifier\Model\VerifierConfig;
use PhpPact\Standalone\ProviderVerifier\Verifier;
use PhpPact\Standalone\Runner\ProcessRunner;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Process;

/**
* This is an example on how you could use the included amphp/process wrapper to start your API to run PACT verification against a Provider.
* Class PactVerifyTest
*/
class PactVerifyTest extends TestCase
{
/** @var ProcessRunner */
private ProcessRunner $processRunner;
/** @var Process */
private Process $process;

/**
* Run the PHP build-in web server.
Expand All @@ -25,18 +25,18 @@ protected function setUp(): void
{
$publicPath = __DIR__ . '/../../src/Provider/public/';

$this->processRunner = new ProcessRunner('php', ['-S', 'localhost:7202', '-t', $publicPath]);
$this->process = new Process(['php', '-S', '127.0.0.1:7202', '-t', $publicPath]);

$this->processRunner->run();
\usleep(300000); // wait for server to start
$this->process->start();
$this->process->waitUntil(fn () => is_resource(@fsockopen('127.0.0.1', 7202)));
}

/**
* Stop the web server process once complete.
*/
protected function tearDown(): void
{
$this->processRunner->stop();
$this->process->stop();
}

/**
Expand Down
6 changes: 6 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ parameters:
level: 7
paths:
- src
ignoreErrors:
-
messages:
- '#Method PhpPact\\Standalone\\Broker\\Broker::[a-zA-Z0-9\\_]+\(\) return type has no value type specified in iterable type array\.#'
- '#Method PhpPact\\Standalone\\Broker\\Broker::[a-zA-Z0-9\\_]+\(\) has parameter \$options with no value type specified in iterable type array\.#'
path: src/PhpPact/Standalone/Broker/Broker.php
Loading