-
Notifications
You must be signed in to change notification settings - Fork 123
CI enable integration test on iOS Simulator #349
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
Conversation
819410f
to
ef4a0cc
Compare
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.
What is this file? scripts/gha/integration_testing/gameloop.zip
I built the app & XCUITest, and compressed the test files into a .zip file. |
Rather than letting our tests go red, could you add a flag that turns off the simulator tests, so that we can file a ticket to re-enable and fix them? (I recommend an env setting since we are out of input parameters.) |
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.
Minor comments on python code.
scripts/gha/test_simulator.py
Outdated
logging.info("No test Result") | ||
return None | ||
|
||
log_path = os.path.join(result.stdout.strip(), "Documents/GameLoopResults/Results1.json") |
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.
Is the log path guaranteed to be this all the time?
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.
Yes. Or we could iterate the directory to find the result.
scripts/gha/test_simulator.py
Outdated
"""Create a simulator locally. Will wait until this simulator botted.""" | ||
device_info = ios_device.split("-") | ||
device_name = device_info[0] | ||
device_os = device_info[1] |
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.
This could error if the device name does not have a "-". Maybe check for that first and raise exception if that is the case?
A comment stating an example string that could be passed for ios_device will be helpful to follow any string operations.
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 comment here:
xcrun simctl list |
I checked before, no device name (both Android & iOS) contains "-".
But I noticed that setting device info could be a problem.
My next plan is to expend the test device matrix. And I will figure out how to deal with it then.
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.
Sorry, I meant device_info could be missing a "-". and the token split will fail in that case.
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.
Got it. Currently, we only use the default value, thus it won't be a problem.
But I will keep this in mind when expending the test device matrix.
ios_device = FLAGS.ios_device | ||
|
||
config_path = os.path.join(current_dir, "integration_testing/build_testapps.json") | ||
with open(config_path, "r") as config: |
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.
nit: file handle variable could be named "config_file" for easier reading. Json data and file handle have the same name currently.
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.
Historically, testing scripts name variable this way.
import XCTest | ||
|
||
/// Constants used across the loop launcher and UI test. | ||
public struct Constants { |
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.
Don't know much about swift but noticed the same constants are also defined in "Constants.swift". Could we reuse?
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 create this class for reuse.
But sadly, UITest focus on UI, and cannot get access to the app's source code.
AFAIK, the way to reuse this class is to build it into a Framework.
I don't really like including a prebuilt app in our repo - is this zip file used by the script? Or does the script build the app? |
The script uses this zip file |
Add an env, and modified the build script to support it. |
❌ Integration test FAILEDRequested by @sunmou99 on commit 79affe1
|
Script that running game-loop test on simulator: scripts/gha/test_simulator.py
A UI Test App that enable game-loop test: scripts/gha/integration_testing/gameloop
Workflow passed (admob,analytics):
https://github.com/firebase/firebase-cpp-sdk/runs/2241571055?check_suite_focus=true#step:33:28
Many test failed on simulator (due to keychain issue):
https://github.com/firebase/firebase-cpp-sdk/runs/2241582501?check_suite_focus=true#step:33:31