-
Notifications
You must be signed in to change notification settings - Fork 450
chore: Add mobile tests to nightly trigger #1161
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
11 commits
Select commit
Hold shift + click to select a range
eec248f
Add mobile tests to nightly trigger
zain-mecklai a4faead
Fixing some issues with android tests
andrews-unity 4691853
removing an extra argument
andrews-unity 674190a
remove timeout
andrews-unity 5260f94
don't build it twice
andrews-unity 5847132
Move to run all
zain-mecklai f00f074
Merge branch 'chore/run-mobile-tests-nightly' of github.com:Unity-Tec…
zain-mecklai 1e3750e
test filter to exclude multiprocess tests
zain-mecklai 0a57cfc
making ios the same as android for commands and artifacts
andrews-unity 414b708
Fixing copy paste error
andrews-unity 84cf2c6
Merge branch 'develop' into chore/run-mobile-tests-nightly
zain-mecklai 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.vs | ||
.vscode | ||
.idea | ||
.DS_Store |
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,93 @@ | ||
import argparse | ||
import json | ||
import os | ||
|
||
|
||
args = None | ||
platform_plugin_definition = None | ||
|
||
|
||
def resolve_target(platform): | ||
resolved_target = platform | ||
if 'StandaloneWindows' in platform: | ||
resolved_target = 'StandaloneWindows' | ||
elif 'StandaloneLinux' in platform: | ||
resolved_target = 'StandaloneLinux64' | ||
|
||
return resolved_target | ||
|
||
|
||
def create_config(settings_path, platform): | ||
config_name = os.path.join(settings_path, 'BurstAotSettings_{}.json'.format(resolve_target(platform))) | ||
monobehaviour = { | ||
'm_Enabled': True, | ||
'm_EditorHideFlags': 0, | ||
'm_Name': "", | ||
'm_EditorClassIdentifier': 'Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings', | ||
'DisableOptimisations': False, | ||
'DisableSafetyChecks': True, | ||
'DisableBurstCompilation': False | ||
} | ||
|
||
data = {'MonoBehaviour': monobehaviour} | ||
with open(config_name, 'w') as f: | ||
json.dump(data, f) | ||
return config_name | ||
|
||
|
||
def get_or_create_AOT_config(project_path, platform): | ||
settings_path = os.path.join(project_path, 'ProjectSettings') | ||
if not os.path.isdir(settings_path): | ||
os.mkdir(settings_path) | ||
config_names = [os.path.join(settings_path, filename) for filename in os.listdir(settings_path) if filename.startswith("BurstAotSettings_{}".format(resolve_target(platform)))] | ||
if not config_names: | ||
return [create_config(settings_path, platform)] | ||
return config_names | ||
|
||
|
||
def disable_AOT(project_path, platform): | ||
config_names = get_or_create_AOT_config(project_path, platform) | ||
for config_name in config_names: | ||
set_AOT(config_name, True) | ||
|
||
|
||
def enable_AOT(project_path, platform): | ||
config_names = get_or_create_AOT_config(project_path, platform) | ||
for config_name in config_names: | ||
set_AOT(config_name, False) | ||
|
||
|
||
def set_AOT(config_file, status): | ||
config = None | ||
with open(config_file, 'r') as f: | ||
config = json.load(f) | ||
|
||
assert config is not None, 'AOT settings not found; did the burst-enabled build finish successfully?' | ||
|
||
config['MonoBehaviour']['DisableBurstCompilation'] = status | ||
with open(config_file, 'w') as f: | ||
json.dump(config, f) | ||
|
||
|
||
def main(): | ||
enable_burst = os.environ.get('ENABLE_BURST_COMPILATION', 'true').strip().lower() | ||
if enable_burst == 'true': | ||
print('BURST COMPILATION: ENABLED') | ||
elif enable_burst == 'false': | ||
print('BURST COMPILATION: DISABLED') | ||
disable_AOT(args.project_path, args.platform) | ||
else: | ||
sys.exit('BURST COMPILATION: unexpected value: {}'.format(enable_burst)) | ||
|
||
|
||
def parse_args(): | ||
global args | ||
parser = argparse.ArgumentParser(description='This tool disables burst AOT compilation') | ||
parser.add_argument('--project-path', help='Specify the location of the unity project.') | ||
parser.add_argument('--platform', help="Platform to be used to run the build.") | ||
args = parser.parse_args() | ||
|
||
|
||
if __name__ == '__main__': | ||
parse_args() | ||
main() |
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
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.
Uh oh!
There was an error while loading. Please reload this page.