-
Notifications
You must be signed in to change notification settings - Fork 272
test: Updating older cross-build smoke tests (iOS, Android) #7487
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
Open
thesuzerain
wants to merge
17
commits into
main
Choose a base branch
from
test-updating-older-cross-build-smoke-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f6b7579
test: Adds new python smoke tests for building against iOS; fenix
thesuzerain e0a8b67
test: Adds scheme, tests
thesuzerain 5a50949
fix: Modularization and missing xcframework change
thesuzerain 0f4649a
fix: linting
thesuzerain 01dc2e3
fix: Lints, docs
thesuzerain 54c9391
fix: Adds deprecation notes
thesuzerain a223a2f
fix: Adds regex for fenix + docs
thesuzerain de33222
fix: Clarifies a todo
thesuzerain 119a717
fix: missed err_msg change
thesuzerain b2f472f
feat: Adds HNT tests, fixes some review issues
thesuzerain a5a8e20
fix: Some missing docs
thesuzerain a82029a
fix: Small edits
thesuzerain 3174384
fix: adds hnt test
thesuzerain 203c371
fix: Build against all
thesuzerain fd689b0
fix: Small log correction
thesuzerain 3825800
fix: some doc changes
thesuzerain 29f33ae
fix: some readme linting
thesuzerain 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 |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| #!/usr/bin/env python3 | ||
| # This Source Code Form is subject to the terms of the Mozilla Public | ||
| # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| # Purpose: Run various smoke tests against this application-services working tree. | ||
| # Requirements: | ||
| # - python | ||
| # - application-services built and working. | ||
| # For the mac builds: | ||
| # - xcpretty (`gem install xcpretty`) | ||
| # - xcode + xcodebuild + xcodetools setup and running (a successful build of the firefox-ios repository) | ||
| # Arguments: | ||
| # --action => Can be either `run-tests` (default) or `build-without-testing` | ||
| # --use_local_firefox_ios => Use a local firefox-ios repository instead (at the provided path). | ||
| # --verbose => Includes the stdout of subprocesses (like the xcodebuild output, or other bootstrapping scripts) | ||
| # --allow-clears => Clear existing uniffi bindings, swift files, and so on during the various build processes. | ||
| # --use-local-firefox-ios => Use a local copy of firefox-ios instead of cloning it for iOS tests. Exclusive with `remote-ios-repo-url` | ||
| # --remote-ios-repo-url => Clone a different firefox-ios repository for iOS tests. Exclusive with `use-local-firefox-ios` | ||
| # --ios-scheme => The scheme to run for iOS tests. Likely: `Fennec` (default) or `Firefox` | ||
| # --ios-test-plan => The test plan to test with for iOS tests. Likely: `Smoketest` (default) or `FullFunctionalTestPlan` | ||
| import argparse | ||
| import time | ||
| from shared import err_msg, step_msg | ||
| from build_against_hnt import build_against_hnt | ||
| from build_against_fenix import build_against_fenix | ||
| from build_against_ios import build_against_ios | ||
|
|
||
| parser = argparse.ArgumentParser( | ||
| description="Run groups of tests against this application-services working tree." | ||
| ) | ||
|
|
||
| group = parser.add_mutually_exclusive_group() | ||
| parser.add_argument( | ||
| "--firefox-dir", | ||
| required=True, | ||
| help="Path to existing bootstrapped `mozilla-central` directory.", | ||
| ) | ||
| parser.add_argument( | ||
| "--verbose", | ||
| help="Display subprocess logs for compilation processes (off by default).", | ||
| action=argparse.BooleanOptionalAction, | ||
| ) | ||
| parser.add_argument( | ||
| "--allow-clears", | ||
| help="Clear existing uniffi bindings, swift files, and so on during the various build processes (what gets cleared varies per platform test).", | ||
| action=argparse.BooleanOptionalAction, | ||
| ) | ||
| parser.add_argument( | ||
| "--action", | ||
| required=True, | ||
| choices=["run-tests", "build-without-testing"], | ||
| help="Run the following action for target's test", | ||
| ) | ||
|
|
||
| # iOS arguments to pass down | ||
| group = parser.add_mutually_exclusive_group() | ||
| group.add_argument( | ||
| "--use-local-firefox-ios", | ||
| metavar="LOCAL_IOS_REPO_PATH", | ||
| help="Use a local copy of firefox-ios instead of cloning it for iOS tests. Exclusive with `remote-ios-repo-url`", | ||
| ) | ||
| group.add_argument( | ||
| "--remote-ios-repo-url", | ||
| metavar="REMOTE_REPO_PATH", | ||
| help="Clone a different firefox-ios repository for iOS tests. Exclusive with `use-local-firefox-ios`", | ||
| ) | ||
| parser.add_argument( | ||
| "--ios-scheme", | ||
| help="The scheme to run for iOS tests. Likely: `Fennec` (default) or `Firefox`", | ||
| default="Fennec", | ||
| ) | ||
| parser.add_argument( | ||
| "--ios-test-plan", | ||
| help="The test plan to test with for iOS tests. Likely: `Smoketest` (default) or `FullFunctionalTestPlan`", | ||
| default="Smoketest", | ||
| ) | ||
|
|
||
| # HNT argument to pass down | ||
| parser.add_argument( | ||
| "--hnt-test", | ||
| help="Name of the test file to run, as if you were running `./mach test ARG`.", | ||
| ) | ||
|
|
||
|
|
||
| # Fenix arguments to pass down | ||
| parser.add_argument( | ||
| "--prefix-ff", | ||
| help="Prefix name to pass to mozilla-central gradlew compilation to reduce the amount needing to build or test. For example: `geckoview`, `fenix`, `focus`.", | ||
| default="fenix", | ||
| ) | ||
|
|
||
|
|
||
| args = parser.parse_args() | ||
| firefox_dir = args.firefox_dir | ||
| verbose = args.verbose if args.verbose else False | ||
| allow_clears = args.allow_clears | ||
| action = args.action | ||
|
|
||
| local_firefox_ios = args.use_local_firefox_ios | ||
| remote_ios_repo_url = args.remote_ios_repo_url | ||
| ios_scheme = args.ios_scheme | ||
| ios_test_plan = args.ios_test_plan | ||
|
|
||
| hnt_test = args.hnt_test | ||
|
|
||
| prefix_ff = args.prefix_ff | ||
|
|
||
| # Build against iOS | ||
| start_time_ios = time.time() | ||
| success_ios = build_against_ios( | ||
| local_firefox_ios, | ||
| remote_ios_repo_url, | ||
| ios_scheme, | ||
| ios_test_plan, | ||
| clear_previous_bindings=allow_clears, | ||
| clean_ios_caches=allow_clears, | ||
| verbose=verbose, | ||
| action=action, | ||
| ) | ||
| time_diff_ios = time.time() - start_time_ios | ||
|
|
||
| # Build against Fenix | ||
| start_time_fenix = time.time() | ||
| success_fenix = build_against_fenix( | ||
| firefox_dir, | ||
| None, | ||
| prefix_ff, | ||
| prefix_as=None, | ||
| clear_bindings=allow_clears, | ||
| verbose=verbose, | ||
| action=action, | ||
| ) | ||
| time_diff_fenix = time.time() - start_time_fenix | ||
|
|
||
| # Build against Desktop | ||
| start_time_hnt = time.time() | ||
| success_hnt = build_against_hnt(firefox_dir, None, True, hnt_test=hnt_test, verbose=verbose, action=action) | ||
| time_diff_hnt = time.time() - start_time_hnt | ||
|
|
||
| did_tests_string = "" if action != "run-tests" else " (and tested)" | ||
| do_tests_string = "" if action != "run-tests" else " (and test)" | ||
| step_msg("Finished building. Results:") | ||
| if success_ios: | ||
| step_msg( | ||
| f"Successfully built{did_tests_string} against iOS (elapsed {time_diff_ios:.2f}s)" | ||
| ) | ||
| else: | ||
| err_msg( | ||
| f"Failed to build{do_tests_string} against iOS (elapsed {time_diff_ios:.2f}s)" | ||
| ) | ||
| if success_fenix: | ||
| step_msg( | ||
| f"Successfully built{did_tests_string} against Fenix (elapsed {time_diff_fenix:.2f}s)" | ||
| ) | ||
| else: | ||
| err_msg( | ||
| f"Failed to build{do_tests_string} against Fenix (elapsed {time_diff_fenix:.2f}s)" | ||
| ) | ||
| if success_hnt: | ||
| step_msg( | ||
| f"Successfully built{did_tests_string} against HNT (elapsed {time_diff_hnt:.2f}s)" | ||
| ) | ||
| else: | ||
| err_msg( | ||
| f"Failed to build{do_tests_string} against HNT (elapsed {time_diff_hnt:.2f}s)" | ||
| ) | ||
Oops, something went wrong.
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.