-
Notifications
You must be signed in to change notification settings - Fork 447
chore: Add a DA service unit test #3423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ee6684c
chore: Add a DA service unit test
EmandM acdc798
temp trigger update for faster iteration
EmandM 9f9ab40
fix pvp exceptions
EmandM 4a04ed9
Fix code docs
EmandM d86da3e
fix formatting
EmandM 16b504b
remove backticks
EmandM b2fed7f
Add missing import
EmandM a10e61f
Swap the tests to run on ubuntu
EmandM e5d76bb
use inline command instead of funtion
EmandM d0e8d14
Fix while loop issue
EmandM 58aefa9
Stop changeownership message on spawn
EmandM c4498e5
try connect to service utp only
EmandM 8d07f34
update standalone service timeout to 1h
EmandM 60ca952
ensure active scene hash is always synchroniszed to the service
EmandM 8c5745d
Add timeout between rust tests
EmandM 9ec7b43
unbreak test
EmandM 76fdbf1
Merge branch 'develop-2.0.0' of https://github.com/Unity-Technologies…
EmandM b08c482
actually use the hosted service
EmandM d000e5a
Remove can connect test, we can connect. Run only CreateObjectNew()
EmandM ae2ddf0
Fix formatting
EmandM 07a51ff
lets go
EmandM 1324963
All tests passing
EmandM 5b6266a
Run tests against release rust build
EmandM 82138d5
Fix InScenePlacedNetworkObjectTests
EmandM 666e1d4
Only log cmb error logs
EmandM 48aa4cd
remove log lines
EmandM 7611a51
update port env variable
EmandM 4ef95a2
remove connection test
EmandM 4a3804c
fix bug in StartServerAndClientsWithTimeTravel
EmandM 41307ba
cleanup
EmandM a658445
Merge branch 'develop-2.0.0' of https://github.com/Unity-Technologies…
EmandM eaf54a1
further cleanup
EmandM db50def
code review comments
EmandM 3783c64
text - fix
NoelStephensUnity e95f56c
add comments to bash file and explicitly pass env variables to script
EmandM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/bash | ||
|
||
# DESCRIPTION-------------------------------------------------------------------------- | ||
# This bash file is used to build and run CMB service resources. | ||
# These are resources relating to the distributed authority feature. The CMB service is built and maintained by the services team. | ||
|
||
# CONTENTS----------------------------------------------------------------------------- | ||
# There are two resources that are built and run: | ||
# 1. The echo server - this is a "mock" server that simply echoes back the messages it receives. It is used to test message serialization. | ||
# The echo server is used inside the DistributedAuthorityCodecTests. These are tests that are built and maintained by the CMB service team. | ||
# 2. The standalone server - this is a release build of the full CMB service. | ||
|
||
# USAGE--------------------------------------------------------------------------------- | ||
# The script requires ports to be defined. This works via the following command: | ||
# ./<path-to-script>/run_cmb_service.sh -e <echo-server-port> -s <cmb-service-port> | ||
|
||
# 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. | ||
|
||
# TECHNICAL CONSIDERATIONS--------------------------------------------------------------- | ||
# This is a bash script and so needs to be run on a Unix based system. | ||
# - It runs on mac and ubuntu bokken machines. It will not run on windows bokken machines. | ||
|
||
# This script starts processes running in the background. All logs are still written to stdout and will be seen in the logs of the job. | ||
# Running in the background means that the processes will continue to run after the script exits. | ||
# This is not a concern for bokken machines as all processes are killed when the machine is shut down. | ||
|
||
# QUALITY THOUGHTS-------------------------------------------------------------------- | ||
# Currently this script simply uses the head of the cmb service repo. | ||
# We might want to consider using the latest released version in the future. | ||
|
||
#------------------------------------------------------------------------------------- | ||
|
||
# Define error message if ports are not defined | ||
ERROR="Error: Expected ports to be defined! Example script usage:" | ||
EXAMPLE="run_cmb_service.sh -e <echo-server-port> -s <cmb-service-port>" | ||
|
||
# get arguments passed to the script | ||
while getopts 'e:s:' flag; do | ||
case "${flag}" in | ||
e) echo_port="${OPTARG}" ;; | ||
s) service_port="${OPTARG}" ;; | ||
*) printf "%s\n" "$ERROR" "$EXAMPLE" | ||
exit 1 ;; | ||
esac | ||
done | ||
|
||
# ensure arguments were passed and the ports are defined | ||
if [ -z "$echo_port" ] || [ -z "$service_port" ]; then | ||
printf "%s\n" "$ERROR" "$EXAMPLE"; | ||
exit 1; | ||
elif [[ "$echo_port" == "$service_port" ]]; then | ||
printf "Ports cannot be the same! Please use different ports.\n"; | ||
exit 1; | ||
fi | ||
|
||
echo "Starting with echo server on port: $echo_port and the cmb service on port: $service_port" | ||
|
||
# Setup ------------------------------------------------------------------------- | ||
|
||
# clone the cmb service repo | ||
git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git | ||
# navigate to the cmb service directory | ||
cd ./mps-common-multiplayer-backend/runtime | ||
|
||
# Install rust | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
# Add the cargo bin directory to the PATH | ||
export PATH="$HOME/.cargo/bin:$PATH" | ||
|
||
|
||
# Echo server ------------------------------------------------------------------- | ||
|
||
# Build the echo server | ||
cargo build --example ngo_echo_server | ||
# Run the echo server in the background | ||
cargo run --example ngo_echo_server -- --port $echo_port & | ||
|
||
|
||
# CMB Service ------------------------------------------------------------------- | ||
|
||
# Build a release version of the standalone cmb service | ||
cargo build --release --locked | ||
|
||
# Run the standalone service on an infinite loop in the background. | ||
# The infinite loop is required as the service will exit each time all connected clients disconnect. | ||
# This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. | ||
while :; do | ||
./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m; | ||
done & # <- use & to run the entire loop in the background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where we are using it 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's inside the
UseCMBService()
function insideNetcodeIntegrationTest.cs
(here)