Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .circleci/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
environment:
CI: true
macos:
xcode: "15.4"
xcode: "16.2"
resource_class: macos.m1.medium.gen1
steps:
- checkout
Expand Down
23 changes: 5 additions & 18 deletions .github/actions/perform_snapshot_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ inputs:
runs:
using: "composite"
steps:

- name: Set up Homebrew and Install Dependencies
shell: bash
run: |
Expand All @@ -32,24 +31,12 @@ runs:
echo "jq version:"
jq --version

- name: Validate JSON Configuration
shell: bash
run: |
jq empty "EcosiaTests/SnapshotTests/snapshot_configuration.json"
echo "JSON configuration is valid."

- name: Run Snapshot Tests
shell: bash
run: |
mkdir -p EcosiaTests/Results/
./perform_snapshot_tests.sh "EcosiaTests/SnapshotTests/snapshot_configuration.json" "EcosiaTests/SnapshotTests/environment.json" "EcosiaTests/Results" "EcosiaSnapshotTests"
run: ./perform_snapshot_tests.sh "EcosiaTests/SnapshotTests/snapshot_configuration.json" "EcosiaTests/SnapshotTests/environment.json" "EcosiaTests/Results" "EcosiaSnapshotTests"

- name: Process xcresult files
uses: kishikawakatsumi/xcresulttool@v1
- name: Upload test result as artifact
uses: actions/upload-artifact@v4
with:
path: 'EcosiaTests/Results/all_tests.xcresult'
token: ${{ inputs.github-token }}
show-passed-tests: false
show-code-coverage: false
upload-bundles: 'failure'
if: success() || failure()
name: test-result
path: 'firefox-ios/EcosiaTests/Results/all_tests.xcresult'
2 changes: 1 addition & 1 deletion .github/actions/perform_unit_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
- name: Run Unit Tests
shell: bash
run: |
bundle exec fastlane run run_tests prelaunch_simulator:true testplan:"UnitTest"
bundle exec fastlane run run_tests prelaunch_simulator:true

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3.7.6
Expand Down
13 changes: 9 additions & 4 deletions .github/actions/prepare_environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ inputs:
runs:
using: "composite"
steps:
- name: Xcode Select Version
uses: mobiledevops/xcode-select-version-action@v1
with:
xcode-select-version: 16.2

- name: Fix-up private Github URLs
shell: bash
run: find . -type f \( -name '*.pbxproj' -o -name 'Package.swift' -o -name 'Package.resolved' \) -exec sed -i '' "s/https:\/\/github.com\/${GITHUB_REPOSITORY_OWNER}/https:\/\/${GITHUB_ACCESS_TOKEN}@github.com\/${GITHUB_REPOSITORY_OWNER}/g" {} \;
Expand Down Expand Up @@ -40,19 +45,19 @@ runs:
uses: actions/cache/restore@v3
with:
path: SourcePackages/
key: ${{ runner.os }}-spm-cache-${{ hashFiles('Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
key: ${{ runner.os }}-spm-cache-${{ hashFiles('firefox-ios/Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}

- name: Install SPM if cache not found
shell: bash
if: steps.restore-spm-cache.outputs.cache-hit != 'true'
run: xcodebuild -resolvePackageDependencies -clonedSourcePackagesDirPath "SourcePackages/"
run: xcodebuild -resolvePackageDependencies -clonedSourcePackagesDirPath "firefox-ios/SourcePackages/"

- name: Save SPM Cache if needed
if: steps.restore-spm-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: SourcePackages/
key: ${{ runner.os }}-spm-cache-${{ hashFiles('Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
path: firefox-ios/SourcePackages/
key: ${{ runner.os }}-spm-cache-${{ hashFiles('firefox-ios/Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}

- name: Extract Staging XCConfig
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/merge_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:

jobs:
execute_merge_tests:
runs-on: macos-14
runs-on: macos-15
name: Execute Merge Tests

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare environment
uses: ./.github/actions/prepare_environment
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/snapshot_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:

jobs:
execute_snapshot_tests:
runs-on: macos-14
runs-on: macos-15
name: Execute Snapshot Tests

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Check for MARKETING_VERSION change
id: check_marketing_version
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/swift_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
image: ghcr.io/realm/swiftlint:latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: SwiftLint
run: |
swiftlint --reporter github-actions-logging --strict
- name: SwiftLint
run: |
swiftlint --reporter github-actions-logging --strict
2 changes: 1 addition & 1 deletion .github/workflows/upload_release_notes_to_appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install gems
uses: ruby/setup-ruby@v1
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ vendor/bundle
Staging.xcconfig
Production.xcconfig
.github/workflows/firefox-*.yml
SourcePackages
firefox-ios/SourcePackages
test_output
.vscode
firefox-ios/EcosiaTests/Results
firefox-ios/EcosiaTests/SnapshotTests/SnapshotArtifacts/*

# TODO Ecosia Upgrade: Remove once confirmed not needed
# (they are still above but prefixed with `firefox-ios/`)
Expand All @@ -162,4 +163,4 @@ Client/Assets/MainFrameAtDocumentEnd.js
Client/Assets/AutofillAllFramesAtDocumentStart.js
Client/Assets/WebcompatAllFramesAtDocumentStart.js
Client/Assets/*.js.LICENSE.txt
/Storage/Generated
/Storage/Generated
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "firefox-ios/EcosiaTests/SnapshotTests/SnapshotArtifacts"]
path = firefox-ios/EcosiaTests/SnapshotTests/SnapshotArtifacts
url = git@github.com:ecosia/ios-snapshot-tests-files.git
6 changes: 4 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
# Temporarly ignore focus-ios folder
- focus-ios/
# Ecosia: Exclude Swift Packages
- SourcePackages

- firefox-ios/SourcePackages
# Ecosia: Remove Metrics.swift as part of Glean
- Storage/Generated/Metrics.swift

included:
- /Users/vagrant/git
- .
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.1040.0)
aws-sdk-core (3.216.0)
aws-partitions (1.1043.0)
aws-sdk-core (3.217.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
Expand All @@ -33,7 +33,7 @@ GEM
commander (4.6.0)
highline (~> 2.0.0)
declarative (0.0.20)
digest-crc (0.6.5)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.6.20240107)
dotenv (2.8.1)
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ If more information is required or you have any questions then we suggest reachi

Want to contribute on the codebase but don't know where to start? Here is a list of [issues that are contributor friendly](https://github.com/mozilla-mobile/firefox-ios/labels/Contributor%20OK), but make sure to read the [Contributing guidelines](https://github.com/mozilla-mobile/firefox-ios/blob/main/CONTRIBUTING.md) first.

## Update Ecosia Comments

To ensure consistency when commenting code in Firefox for Ecosia updates, you could document the following approach:

Commenting Guidelines for Ecosia Code in Firefox:
1. One-liner Comments:
Use `//` for introducing new code or brief explanations.

```
// Ecosia: Update appversion predicate
let appVersionPredicate = (appVersionString?.contains("Ecosia") ?? false) == true
```

2. Block Comments:
Use `/* */` when commenting out existing Firefox code for easier readability and conflict resolution.

```
/* Ecosia: Update appversion predicate
let appVersionPredicate = (appVersionString?.contains("Firefox") ?? false) == true
*/
let appVersionPredicate = (appVersionString?.contains("Ecosia") ?? false) == true
```

After cloning (for Ecosians)
-----------

Expand Down
14 changes: 7 additions & 7 deletions SNAPSHOT_TESTING_WIKI.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ This array specifies the devices on which the snapshot tests will be executed. E
- **`"os"`**: The operating system version to simulate (e.g., `"17.5"`). If `"os"` is not specified, the default would be used.
> Make sure the devices you are going to list down are present or available in the machine you are going to run the tests.

#### 3. Test Plans (`"testPlans"`)
This array defines the test plans, which are groups of tests to be executed under the specified configurations. Each test plan contains:
- **`"name"`**: The name of the test plan (e.g., `"EcosiaSnapshotTests"`).
#### 3. Test Bundles (`"testBundles"`)
This array defines the test bundles, which are groups of tests to be executed under the specified configurations. Each test plan contains:
- **`"name"`**: The name of the test bundle (e.g., `"EcosiaSnapshotTests"`).
- **`"testClasses"`**: An array of test classes to be executed within this plan. Each test class includes:
- **`"name"`**: The name of the test class (e.g., `"OnboardingTests"`).
- **`"devices"`**: An array specifying the devices this test class should run on. If `"all"` is specified, the test will run on all devices listed in the `"devices"` section.
Expand Down Expand Up @@ -147,7 +147,7 @@ SnapshotTestHelper will take care of retrieving all the details and configure th
"orientation": "portrait"
}
],
"testPlans": [
"testBundles": [
{
"name": "EcosiaSnapshotTests",
"testClasses": [
Expand Down Expand Up @@ -206,7 +206,7 @@ SnapshotTestHelper will take care of retrieving all the details and configure th
"orientation": "portrait"
}
],
"testPlans": [
"testBundles": [
{
"name": "EcosiaSnapshotTests",
"testClasses": [
Expand Down Expand Up @@ -294,7 +294,7 @@ Do not forget to also declare the new device in the `snapshot_configuration.json
}
...
],
"testPlans": [
"testBundles": [
{
"name": "EcosiaSnapshotTests",
"testClasses": [
Expand Down Expand Up @@ -343,7 +343,7 @@ You can specify the requirements as part of the devices list of that test class.
}
...
],
"testPlans": [
"testBundles": [
{
"name": "EcosiaSnapshotTests",
"testClasses": [
Expand Down
6 changes: 3 additions & 3 deletions fastlane/Scanfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scheme("Ecosia")
configuration("BetaDebug")
project("Client.xcodeproj")
destination("platform=iOS Simulator,name=iPhone 15,OS=17.4")
configuration("Testing")
project("firefox-ios/Client.xcodeproj")
destination("platform=iOS Simulator,name=iPhone 16,OS=18.2")
skip_detect_devices(true)
output_types("junit")
output_directory("test_output/xml")
Expand Down
Loading