Skip to content

Commit

Permalink
Maze runner tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLindsay0 committed Aug 6, 2024
1 parent 6bd0164 commit af978fb
Show file tree
Hide file tree
Showing 14 changed files with 348 additions and 10 deletions.
1 change: 1 addition & 0 deletions .buildkite/block.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ steps:
buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.linux.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml
197 changes: 197 additions & 0 deletions .buildkite/pipeline.linux.full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
aliases:
- &2020 "2020.3.48f1"
- &2021 "2021.3.36f1"
- &2022 "2022.3.22f1"
- &2023 "2023.2.19f1"

agents:
queue: macos-14

steps:
#
# Build Linux test fixtures
#
- label: Build Unity 2020 Linux test fixture
timeout_in_minutes: 30
key: "linux-2020-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2020
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- features/fixtures/maze_runner/build/linux-release-2020.zip
commands:
- scripts/ci-build-linux-fixture.sh release
retry:
automatic:
- exit_status: "*"
limit: 1

- label: Build Unity 2021 linux test fixture
timeout_in_minutes: 30
key: "linux-2021-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2021
commands:
- scripts/ci-build-linux-fixture.sh release
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- c/linux-release-2021.zip
retry:
automatic:
- exit_status: "*"
limit: 1

- label: Build Unity 2021 linux DEV test fixture
timeout_in_minutes: 30
key: "linux-2021-dev-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2021
commands:
- scripts/ci-build-linux-fixture.sh dev
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- features/fixtures/maze_runner/build/linux-dev-2021.zip
retry:
automatic:
- exit_status: "*"
limit: 1

- label: Build Unity 2022 linux test fixture
timeout_in_minutes: 30
key: "linux-2022-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2022
commands:
- scripts/ci-build-linux-fixture.sh release
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- features/fixtures/maze_runner/build/linux-release-2022.zip
retry:
automatic:
- exit_status: "*"
limit: 1

- label: Build Unity 2023 linux test fixture
skip: Pending PLAT-12072
timeout_in_minutes: 30
key: "linux-2023-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2023
commands:
- scripts/ci-build-linux-fixture.sh release
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- features/fixtures/maze_runner/build/linux-release-2023.zip
retry:
automatic:
- exit_status: "*"
limit: 1

#
# Run linux e2e tests
#
- label: Run linux e2e tests for Unity 2020
timeout_in_minutes: 30
depends_on: "linux-2020-fixture"
env:
UNITY_VERSION: *2020
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-release-2020.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv

command:
- scripts/ci-run-linux-tests.sh release

- label: Run linux e2e tests for Unity 2021
timeout_in_minutes: 30
depends_on: "linux-2021-fixture"
env:
UNITY_VERSION: *2021
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-release-2021.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh release

- label: Run linux e2e DEV tests for Unity 2021
timeout_in_minutes: 30
depends_on: "linux-2021-dev-fixture"
env:
UNITY_VERSION: *2021
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-dev-2021.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh dev

- label: Run linux e2e tests for Unity 2022
timeout_in_minutes: 30
depends_on: "linux-2022-fixture"
env:
UNITY_VERSION: *2022
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-release-2022.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh release

- label: Run linux e2e tests for Unity 2023
skip: Pending PLAT-12072
timeout_in_minutes: 30
depends_on: "linux-2023-fixture"
env:
UNITY_VERSION: *2023
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-release-2023.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh release
1 change: 1 addition & 0 deletions .buildkite/pipeline_trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if [[ "$BUILDKITE_MESSAGE" == *"[full ci]"* ||
buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.linux.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml
else
# Basic build, but allow a full build to be triggered
Expand Down
27 changes: 25 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ This will generate the following file:
#### MacOS
1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh macos`
1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh release macos`
Where `UNITY_VERSION` corresponds to the Unity installation path, e.g:
```
Expand All @@ -119,7 +119,7 @@ This will generate the test fixture app:
Building the test fixture on Windows requires a Git bash terminal.
In a Git bash terminal:
1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh windows`
1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh release windows`
Where `UNITY_VERSION` corresponds to the Unity installation path, e.g:
```
Expand All @@ -132,6 +132,20 @@ dependencies:
./features/fixtures/maze_runner/build/Windows
```
#### Linux
1. `UNITY_VERSION=2021.3.40f1 ./features/scripts/build_maze_runner.sh release linux`
Where `UNITY_VERSION` corresponds to the Unity installation path, e.g:
```
$HOME/Unity/Hub/Editor/$UNITY_VERSION/Editor/Unity
```
This will generate a build folder containing the test fixture executable, together with the UnityPlayer.so and other
dependencies:
```
./features/fixtures/maze_runner/build/linux
```
### Running an end-to-end test
#### MacOS
Expand All @@ -155,6 +169,15 @@ In the Ubuntu terminal:
bundle exec maze-runner --app=features/fixtures/maze_runner/build/Windows/Mazerunner.exe --os=windows
```
#### Linux
1. Check the contents of `Gemfile` to select the version of `maze-runner` to use
1. Run `bundle install` if you haven't run end-to-end tests before
1. To run the tests:
```shell script
bundle exec maze-runner --app=features/fixtures/maze_runner/build/linux/Mazerunner --os=linux
```

#### WebGL

The WebGL e2e tests depend on Chrome and `chromedriver` (available from Homebrew).
Expand Down
4 changes: 2 additions & 2 deletions features/csharp/csharp_config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Feature: csharp events
And the exception "message" equals "Error 2"
And the event "app.isLaunching" is false

@skip_cocoa @skip_windows @skip_webgl # PLAT-9061
@skip_cocoa @skip_windows @skip_linux @skip_webgl # PLAT-9061
Scenario: Set long launch time
When I run the game in the "LongLaunchTime" state
And I wait to receive 2 errors
Expand All @@ -39,7 +39,7 @@ Feature: csharp events
And the exception "message" equals "Error 2"
And the event "app.isLaunching" is false

@skip_cocoa @skip_windows @skip_webgl # PLAT-9061
@skip_cocoa @skip_windows @skip_linux @skip_webgl # PLAT-9061
Scenario: Set short launch time
When I run the game in the "ShortLaunchTime" state
And I wait to receive 2 errors
Expand Down
2 changes: 1 addition & 1 deletion features/csharp/csharp_persistence.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Unity Persistence
Background:
Given I clear the Bugsnag cache

@skip_windows @skip_webgl @skip_cocoa @skip_android #pending PLAT-8632
@skip_windows @skip_linux @skip_webgl @skip_cocoa @skip_android #pending PLAT-8632
Scenario: Receive a persisted session
When I set the HTTP status code for the next request to 408
And I run the game in the "PersistSession" state
Expand Down
6 changes: 6 additions & 0 deletions features/csharp/csharp_sessions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Feature: Session Tracking
And the session payload field "app.type" equals the platform-dependent string:
| macos | MacOS |
| windows | Windows |
| linux | Linux |
| switch | nintendo-switch |
| browser | WebGL |
| android | android |
Expand All @@ -45,6 +46,7 @@ Feature: Session Tracking
And the session payload field "device.osName" equals the platform-dependent string:
| macos | Mac OS |
| windows | Microsoft Windows NT |
| linux | Unix |
| switch | Nintendo Switch |
| browser | Unix |
| android | android |
Expand All @@ -53,6 +55,7 @@ Feature: Session Tracking
And the session payload field "device.manufacturer" equals the platform-dependent string:
| macos | Apple |
| windows | PC |
| linux | @skip |
| switch | Nintendo |
| browser | @skip |
| android | @skip |
Expand All @@ -72,6 +75,7 @@ Feature: Session Tracking
And the session payload field "app.type" equals the platform-dependent string:
| macos | MacOS |
| windows | Windows |
| linux | Linux |
| switch | nintendo-switch |
| browser | WebGL |
| android | android |
Expand All @@ -80,6 +84,7 @@ Feature: Session Tracking
And the session payload field "device.osName" equals the platform-dependent string:
| macos | Mac OS |
| windows | Microsoft Windows NT |
| linux | Unix |
| switch | Nintendo Switch |
| browser | Unix |
| android | android |
Expand All @@ -88,6 +93,7 @@ Feature: Session Tracking
And the session payload field "device.manufacturer" equals the platform-dependent string:
| macos | Apple |
| windows | PC |
| linux | @skip |
| switch | Nintendo |
| browser | @skip |
| android | @skip |
Expand Down
15 changes: 15 additions & 0 deletions features/fixtures/maze_runner/Assets/Editor/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public static void Win64Release()
Win64(false);
}

public static void Linux64Release()
{
Linux64(false);
}

public static void WebGLRelease()
{
WebGL(false);
Expand All @@ -46,6 +51,11 @@ public static void Win64Dev()
Win64(true);
}

public static void Linux64Dev()
{
Linux64(true);
}

public static void WebGLDev()
{
WebGL(true);
Expand All @@ -61,6 +71,11 @@ static void Win64(bool dev)
BuildStandalone(dev ? "build/Windows/Mazerunner_dev.exe" : "build/Windows/Mazerunner.exe", BuildTarget.StandaloneWindows64, dev);
}

static void Linux64(bool dev)
{
BuildStandalone(dev ? "build/linux/Mazerunner_dev" : "build/linux/Mazerunner", BuildTarget.StandaloneLinux64, dev);
}

static void WebGL(bool dev)
{
BuildStandalone("build/WebGL/Mazerunner" + (dev ? "_dev" : ""), BuildTarget.WebGL, dev);
Expand Down
Loading

0 comments on commit af978fb

Please sign in to comment.