Skip to content

Commit

Permalink
BT iOS Unit Tests (#1225)
Browse files Browse the repository at this point in the history
* Fixes.

* ExposureManagerTests.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Updates.

* cleanup

* Merge develop into mb-bt-ios-tests

* wip

* wip
  • Loading branch information
Matt Buckley authored Jul 14, 2020
1 parent 16a383f commit 8bf83a1
Show file tree
Hide file tree
Showing 14 changed files with 471 additions and 109 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dev_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ jobs:

- name: Bundle iOS JS
run: npx react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios --verbose

48 changes: 47 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
env:
CI: true

unit-test-ios:
unit-test-ios-gps:
runs-on: macOS-latest
needs: unit-test
timeout-minutes: 25
Expand Down Expand Up @@ -84,6 +84,52 @@ jobs:
-destination 'platform=iOS Simulator,name=iPhone 8' \
-skip-testing GPSTests/COVIDSafePathsTests/testRendersWelcomeScreen
working-directory: ./ios
unit-test-ios-bt:
runs-on: macOS-latest
needs: unit-test
timeout-minutes: 25
steps:
- uses: actions/checkout@master

- name: Set XCode Version
run: sudo xcode-select -s /Applications/Xcode_11.5.app

- name: Cache node_modules/
uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- name: Install Node Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile

- name: Cache ruby gems
uses: actions/cache@v1
with:
path: ios/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install ruby gems (including Cocoapods)
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
working-directory: ./ios

- run: pod install --repo-update
working-directory: ./ios

# TODO(https://pathcheck.atlassian.net/browse/SAF-250): remove the skip on COVIDSafePathsTests/testRendersWelcomeScreen once it's passing
- run: |
xcodebuild test -workspace COVIDSafePaths.xcworkspace \
-scheme BT_Development \
-destination 'platform=iOS Simulator,name=iPhone 8' \
working-directory: ./ios
# separate build job so that multiple test jobs can run on the same artifact
e2e-ios-build:
Expand Down
2 changes: 1 addition & 1 deletion ios/BT/API/Model/UserState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UserState: Object {

@objc dynamic var id: Int = UserState.id
@objc dynamic var dateLastPerformedFileCapacityReset: Date? = nil
@objc dynamic var remainingDailyFileProcessingCapacity: Int = 0
@objc dynamic var remainingDailyFileProcessingCapacity: Int = Constants.dailyFileProcessingCapacity
@objc dynamic var exposureDetectionErrorLocalizedDescription: String = .default
@objc dynamic var urlOfMostRecentlyDetectedKeyFile: String = .default
dynamic var exposures: List<Exposure> = List<Exposure>()
Expand Down
4 changes: 2 additions & 2 deletions ios/BT/API/Requests/DiagnosisKeyRequests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ enum DiagnosisKeyListRequest: APIRequest {
"temporaryExposureKeys": keys,
"regions": regions.map { $0.rawValue },
"appPackageName": Bundle.main.bundleIdentifier!,
"verificationPayload": certificate,
"hmackey": hmacKey,
"verificationPayload": String.default,
"hmackey": String.default,
"padding": String(decoding: Data(), as: UTF8.self)
]
}
Expand Down
Loading

0 comments on commit 8bf83a1

Please sign in to comment.