Skip to content
Merged
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
6 changes: 5 additions & 1 deletion Tools/CI/service.cmb/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Testing against the CMB Service

The CMB Service is a tool that is external to our repository. The tool is inside the `runtime` folder in the [mps-common-multiplayer-backend](https://github.com/Unity-Technologies/mps-common-multiplayer-backend) repository.
The CMB Service is a tool that is external to our repository. The tool is inside the `runtime` folder of the [CMB service](https://github.com/Unity-Technologies/unity-player-services/tree/main/services/common-multiplayer-backend) in the Unity Player Services monorepo.

Due to this, there is some more setup needed when running tests against the CMB Service.

Expand Down Expand Up @@ -56,3 +56,7 @@ The following environment variables allow for further configuration of the setup
`CMB_SERVICE_PORT` defines the port where the tests will try to connect to the service (defaults to `7789`).

`NGO_HOST` defines the http address where the tests will try to connect to the service (defaults to `127.0.0.1`).

## Running on CI (Yamato)

The CMB tests can also be run from Yamato. The jobs are defined in [`.yamato/cmb-service-standalone-tests.yml`](../../../.yamato/cmb-service-standalone-tests.yml) and appear in Yamato as `CMB Service Test - NGO <project> - [<platform>, <editor>, <backend>]`. The job can be triggered manually from any branch meaning it can be easier to run the CMB tests from Yamato rather than set them up locally. The test uses [`run_cmb_service.sh`](./run_cmb_service.sh) to setup and run the CMB service.
11 changes: 7 additions & 4 deletions Tools/CI/service.cmb/run_cmb_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Example usage:
# ./<path-to-script>/run_cmb_service.sh -e 7788 -s 7799

# This script is currently used in the desktop-standalone-tests yamato job.
# This script is currently used in the cmb-service-standalone-tests yamato job (found at ../../../.yamato/cmb-service-standalone-tests.yml).

# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
# This is a bash script and so needs to be run on a Unix based system.
Expand Down Expand Up @@ -136,11 +136,14 @@ else
logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC"
fi

# clone the cmb service repo
git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git
# Sparse-checkout only the CMB service directory from the unity-player-services monorepo.
# --filter=blob:none + --depth 1 avoids downloading file contents and history for the rest of the monorepo.
git clone --depth 1 --filter=blob:none --sparse https://github.com/Unity-Technologies/unity-player-services.git
cd ./unity-player-services
git sparse-checkout set services/common-multiplayer-backend/runtime

# navigate to the cmb service directory
cd ./mps-common-multiplayer-backend/runtime
cd ./services/common-multiplayer-backend/runtime

# Install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Expand Down