diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 877f6db9..d5795e67 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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: + with: + go-version: ${{ matrix.go }} + + - name: Set up PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 # action page: + 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: + 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 }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..6aa97b41 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tests/acceptance/php-sdk"] + path = tests/acceptance/php-sdk + url = git@github.com:temporalio/sdk-php.git diff --git a/tests/acceptance/README.md b/tests/acceptance/README.md new file mode 100644 index 00000000..90abc170 --- /dev/null +++ b/tests/acceptance/README.md @@ -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 +``` \ No newline at end of file diff --git a/tests/acceptance/dload.xml b/tests/acceptance/dload.xml new file mode 100644 index 00000000..da8f319d --- /dev/null +++ b/tests/acceptance/dload.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/tests/acceptance/php-sdk b/tests/acceptance/php-sdk new file mode 160000 index 00000000..728df25d --- /dev/null +++ b/tests/acceptance/php-sdk @@ -0,0 +1 @@ +Subproject commit 728df25dc3fdbd47699bb8c6fdb4807353d0d6cb diff --git a/tests/acceptance/velox.toml b/tests/acceptance/velox.toml new file mode 100644 index 00000000..86949922 --- /dev/null +++ b/tests/acceptance/velox.toml @@ -0,0 +1,3 @@ +[log] +level = "debug" +mode = "production"