Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 67 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,73 @@ on:
- stable

jobs:
acceptance_test:
name: RR <-> PHP <-> Temporal Acceptance tests (Go ${{ matrix.go }}, PHP ${{ matrix.php }}, OS ${{matrix.os}})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
php: [ "8.4" ]
go: [ stable ]
os: [ "ubuntu-latest" ]
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v6 # action page: <https://github.com/actions/setup-go>
with:
go-version: ${{ matrix.go }}

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2 # action page: <https://github.com/shivammathur/setup-php>
with:
php-version: ${{ matrix.php }}
extensions: dom, sockets, grpc, curl, protobuf

- name: Check out code
uses: actions/checkout@v5
with:
submodules: true

- name: Install dependencies with composer
uses: ramsey/composer-install@v3
with:
working-directory: tests/acceptance/php-sdk

- name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules>
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Download binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd tests/acceptance/php-sdk
vendor/bin/dload get temporal
vendor/bin/dload get temporal-tests-server

- name: Build RoadRunner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd tests/acceptance
php-sdk/vendor/bin/dload build -vv

- name: Run Acceptance tests
env:
ROADRUNNER_BINARY: './rr'
run: |
cd tests/acceptance/php-sdk
composer test:accept

- name: Run Functional tests
env:
ROADRUNNER_BINARY: './rr'
run: |
cd tests/acceptance/php-sdk
composer test:func

rrtemporal_updates_test:
name: RR Temporal updates tests with (Go ${{ matrix.go }}, PHP ${{ matrix.php }}, OS ${{matrix.os}})
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tests/acceptance/php-sdk"]
path = tests/acceptance/php-sdk
url = [email protected]:temporalio/sdk-php.git
41 changes: 41 additions & 0 deletions tests/acceptance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Acceptance Tests

This directory contains acceptance tests to verify the functionality of RoadRunner and PHP SDK integration with Temporal server.
The PHP SDK is included as a submodule in this repository.

### Setup

To run the PHP SDK, you need to install Composer dependencies:

```bash
cd tests/acceptance/php-sdk
composer update
```

Next, you need to download the Temporal Dev Server and Temporal Test Server.
This is done using the DLoad utility, which comes bundled with the PHP SDK.
DLoad automatically fetches the correct binary versions from the configuration, which is especially useful since different PHP SDK branches may require different Temporal server versions (including pre-release builds with experimental features).

Download the binaries with:

```bash
cd tests/acceptance/php-sdk
vendor/bin/dload get temporal temporal-tests-server
```

To build RoadRunner with the Temporal plugin, we also use DLoad. It fetches the plugin version numbers from build.roadrunner.dev, generates the Velox configuration, and runs Velox to build RoadRunner with the current codebase.

```bash
cd tests/acceptance
php-sdk/vendor/bin/dload build
```

### Running Tests

Navigate to the php-sdk directory and run the Acceptance or Functional tests using Composer:

```bash
cd tests/acceptance/php-sdk
composer test:acc
composer test:func
```
23 changes: 23 additions & 0 deletions tests/acceptance/dload.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<dload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/php-internal/dload/refs/heads/1.x/dload.xsd"
temp-dir="./runtime"
>
<actions>
<download software="velox" />
<velox config-file="./velox.toml"
velox-version="2025.1.4"
roadrunner-ref="v2025.1.4"
binary-path="./php-sdk/rr"
>
<plugin name="temporal" replace="../.."/>
<plugin name="rpc"/>
<plugin name="kv"/>
<plugin name="memory"/>
<plugin name="server"/>
<plugin name="logger"/>
<plugin name="appLogger"/>
<plugin name="status"/>
</velox>
</actions>
</dload>
1 change: 1 addition & 0 deletions tests/acceptance/php-sdk
Submodule php-sdk added at 728df2
3 changes: 3 additions & 0 deletions tests/acceptance/velox.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[log]
level = "debug"
mode = "production"
Loading