Skip to content

[SDK-3347] add ui tests to CICD (WIP) #312

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 31 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
409dc67
feat: add ui tests pipeline
andrew-yangy Oct 22, 2024
e2dc6f6
chore: fix macbuilder
andrew-yangy Oct 22, 2024
2e2bcfe
chore: fix upload
andrew-yangy Oct 22, 2024
5cac0dc
chore: update build
andrew-yangy Oct 22, 2024
a4fe5e6
chore: debug artifacts
andrew-yangy Oct 22, 2024
cc5e839
chore: python dependencies
andrew-yangy Oct 22, 2024
5f96aa7
chore: open build
andrew-yangy Oct 22, 2024
2f1a2b8
chore: ls
andrew-yangy Oct 22, 2024
91abeaa
chore: macos -> ubuntu
andrew-yangy Oct 22, 2024
b639eca
chore: fix typo
andrew-yangy Oct 22, 2024
a5b7042
chore: add sudo
andrew-yangy Oct 22, 2024
c5109d1
chore: mac
andrew-yangy Oct 22, 2024
be0777a
chore: update license
andrew-yangy Oct 22, 2024
740f928
chore: fix build
andrew-yangy Oct 22, 2024
8fdfa1e
chore: try build
andrew-yangy Oct 22, 2024
adb0264
chore: not batchmode
andrew-yangy Oct 22, 2024
9d3ed1e
chore: macos-13
andrew-yangy Oct 22, 2024
62646fd
chore: try diff version
andrew-yangy Oct 22, 2024
1f2d003
chore: build
andrew-yangy Oct 22, 2024
713880e
chore: build
andrew-yangy Oct 22, 2024
3c4d9a5
chore: nographics
andrew-yangy Oct 22, 2024
e1a295f
chore: log
andrew-yangy Oct 22, 2024
bbd0795
chore: change version
andrew-yangy Oct 22, 2024
dc08ca7
chore: disable cache
andrew-yangy Oct 22, 2024
7041616
chore: windows
andrew-yangy Oct 22, 2024
835e74b
chore: ubuntu build
andrew-yangy Oct 22, 2024
dfe1909
chore: test path
andrew-yangy Oct 22, 2024
e04cca7
chore: fix build path
andrew-yangy Oct 22, 2024
0a6a937
chore: simple tests
andrew-yangy Oct 23, 2024
67fa7ff
chore: test path
andrew-yangy Oct 23, 2024
cc83d1d
chore: add test file
andrew-yangy Oct 23, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
with:
branch: gh-pages
folder: build/WebGL/WebGL
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: Build-${{ matrix.targetPlatform }}
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: UI Tests 🧪

on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build sample game for AltTester 🛠️
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }}
restore-keys: |
Library-
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
targetPlatform: StandaloneOSX
projectPath: sample
buildMethod: MacBuilder.BuildForAltTester
customParameters: -logFile logFile.log -quit -batchmode
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Build-StandaloneOSX
path: sample/Builds/MacOS
test:
name: Run UI tests on AltTester 🧪
runs-on: macos-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/download-artifact@v4
with:
name: Build-StandaloneOSX
- name: Open application
run: |
pwd
ls -la
export RUN_IN_BROWSERSTACK="false"
export ALTSERVER_PORT=13000
export ALTSERVER_HOST="159.196.149.251"
chmod -R 755 SampleApp.app
open SampleApp.app
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r "sample/Tests/requirements.txt"
- name: Run UI tests
run: |
export ALTSERVER_PORT=13000
export ALTSERVER_HOST="159.196.149.251"
pytest -s -v sample/Tests/test.py

4 changes: 0 additions & 4 deletions sample/Assets/Editor/MacBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if UNITY_EDITOR_OSX

using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
Expand Down Expand Up @@ -117,5 +115,3 @@ public static void RemoveAltFromScene(string scene)
}

}

#endif
7 changes: 7 additions & 0 deletions sample/Tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AltTester_Driver==2.1.1
google_api_python_client==2.136.0
google_auth_oauthlib==1.2.0
protobuf==5.27.2
selenium==4.22.0
pytest==8.2.2
requests==2.32.3
17 changes: 17 additions & 0 deletions sample/Tests/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import unittest
from alttester import *

class UnityTest(unittest.TestCase):

# altdriver = None
#
# @classmethod
# def setUpClass(cls):
# cls.altdriver = AltDriver()
#
# @classmethod
# def tearDownClass(cls):
# cls.altdriver.stop()

def test(self):
assert True
Loading