Skip to content

Commit

Permalink
Update macOS test fixture to build and run in separate CI steps (#245)
Browse files Browse the repository at this point in the history
* Tests/Unity MacOS project: Remove test fixture build step from Maze-runner step

* Tests/Unity MacOS project: Ensure the app is transferrable between steps by zipping it

* Tests/Unity MacOS project: Ensure fixtures are built before attempting to run tests

* Tests/Unity MacOS project: Ensure all previous steps are carried over to new script

* Tests/Unity MacOS project: Ensure the correct directory is used
  • Loading branch information
Cawllec authored May 11, 2021
1 parent 77b92e8 commit 5f41200
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 12 deletions.
48 changes: 41 additions & 7 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ steps:
concurrency: 2
concurrency_group: 'unity-license'

- label: Run e2e tests for Unity 2017.4.40f1
- label: Build Unity 2017 desktop test fixture
key: 'cocoa-2017-fixture'
depends_on: 'build-artifacts'
timeout_in_minutes: 30
agents:
Expand All @@ -30,6 +31,42 @@ steps:
- Bugsnag-with-android-64bit.unitypackage
upload:
- test/desktop/maze_output/*
commands:
- cd test/desktop
- ./features/scripts/build_maze_runner.sh
artifact_paths:
- test/desktop/features/fixtures/Mazerunner-2017.4.40f1.app.zip

- label: Build Unity 2018 desktop test fixture
key: 'cocoa-2018-fixture'
depends_on: 'build-artifacts'
timeout_in_minutes: 30
agents:
queue: opensource-mac-unity
env:
UNITY_VERSION: "2018.4.34f1"
plugins:
artifacts#v1.2.0:
download:
- Bugsnag.unitypackage
- Bugsnag-with-android-64bit.unitypackage
commands:
- cd test/desktop
- ./features/scripts/build_maze_runner.sh
artifact_paths:
- test/desktop/features/fixtures/Mazerunner-2018.4.34f1.app.zip

- label: Run e2e tests for Unity 2017.4.40f1
depends_on: 'cocoa-2017-fixture'
timeout_in_minutes: 30
agents:
queue: opensource-mac-cocoa
env:
UNITY_VERSION: "2017.4.40f1"
plugins:
artifacts#v1.2.0:
download:
- test/desktop/features/fixtures/Mazerunner-2017.4.40f1.app.zip
commands:
- cd test/desktop
- bundle install
Expand All @@ -38,19 +75,16 @@ steps:
concurrency_group: 'unity-license'

- label: Run e2e tests for Unity 2018.4.34f1
depends_on: 'build-artifacts'
depends_on: 'cocoa-2018-fixture'
timeout_in_minutes: 30
agents:
queue: opensource-mac-unity
queue: opensource-mac-cocoa
env:
UNITY_VERSION: "2018.4.34f1"
plugins:
artifacts#v1.2.0:
download:
- Bugsnag.unitypackage
- Bugsnag-with-android-64bit.unitypackage
upload:
- test/desktop/maze_output/*
- test/desktop/features/fixtures/Mazerunner-2018.4.34f1.app.zip
commands:
- cd test/desktop
- bundle install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ TestResult.xml
bugsnag-cocoa-build/
unity.log
bugsnag-android-unity/.cxx
test/**/*.app.zip
4 changes: 4 additions & 0 deletions test/desktop/features/scripts/build_maze_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ pushd "${0%/*}"
-executeMethod Builder.MacOSBuild
RESULT=$?
if [ $RESULT -ne 0 ]; then exit $RESULT; fi

tar -czf "Mazerunner-$UNITY_VERSION.app.zip" "maze_runner/Mazerunner.app"
RESULT=$?
if [ $RESULT -ne 0 ]; then exit $RESULT; fi
popd
popd
2 changes: 1 addition & 1 deletion test/desktop/features/scripts/launch_unity_application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

pushd "${0%/*}"
pushd ../fixtures/maze_runner
Mazerunner.app/Contents/MacOS/Mazerunner -batchmode -nographics
${UNITY_PROJECT_NAME}.app/Contents/MacOS/${UNITY_PROJECT_NAME} -batchmode -nographics
popd
popd
9 changes: 5 additions & 4 deletions test/desktop/features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
# definitions

ENV['BUGSNAG_APIKEY'] = 'a35a2a72bd230ac0aa0f52715bbdc6aa'
run_required_commands([
["features/scripts/build_maze_runner.sh"]
])
unity_project_name = ENV['UNITY_PROJECT_NAME'] = "Mazerunner"
unity_test_project = "features/fixtures/maze_runner/#{unity_project_name}.app"

`cd features/fixtures && tar -xzf #{unity_project_name}-#{ENV['UNITY_VERSION']}.app.zip`

# Scenario hooks
Before do
Expand All @@ -19,5 +20,5 @@

at_exit do
`pkill Mazerunner`
FileUtils.rm_rf('features/fixtures/Mazerunner.app')
FileUtils.rm_rf(unity_test_project)
end

0 comments on commit 5f41200

Please sign in to comment.