Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ script:
- ./Scripts/ci.sh
matrix:
include:
- osx_image: xcode11.3
env: ACTION="xcode";PLATFORMS="macOS_10_15";
- osx_image: xcode11.3
env: ACTION="swift-package";PLATFORMS="iOS_13,tvOS_13,macOS_10_15,watchOS_6";
- osx_image: xcode11.3
Expand All @@ -23,3 +25,4 @@ branches:
only:
- master
- develop--4.0
- dfed--run-signed-tests-on-mac
3 changes: 3 additions & 0 deletions Scripts/build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ for rawPlatform in rawPlatforms {
if task.shouldUseLegacyBuildSystem {
xcodeBuildArguments.append("-UseModernBuildSystem=0")
}

xcodeBuildArguments.append("-allowProvisioningUpdates")

xcodeBuildArguments.append("build")
if task.shouldTest(on: platform) {
xcodeBuildArguments.append("test")
Expand Down
2 changes: 2 additions & 0 deletions Scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if [ $ACTION == "swift-package" ]; then
fi

if [ $ACTION == "xcode" ]; then
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp Valet\ macOS\ Test\ Host\ App/58f4a46d-9ea5-4134-bb2d-46b5ef0ad765.provisionprofile ~/Library/MobileDevice/Provisioning\ Profiles
$DIR/build.swift $PLATFORMS xcode
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension SecureEnclaveIntegrationTests {
@available (*, deprecated)
func test_backwardsCompatibility_withLegacyValet()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extension SinglePromptSecureEnclaveIntegrationTests {
@available (*, deprecated)
func test_backwardsCompatibility_withLegacyValet()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ extension CloudIntegrationTests {
// MARK: Backwards Compatibility

func test_backwardsCompatibility_withLegacyValet() {
guard testEnvironmentIsSigned() else {
return
}

Valet.iCloudCurrentAndLegacyPermutations(with: valet.identifier).forEach { permutation, legacyValet in
legacyValet.setString(passcode, forKey: key)

Expand All @@ -42,10 +38,6 @@ extension CloudIntegrationTests {
}

func test_backwardsCompatibility_withSharedAccessGroupLegacyValet() {
guard testEnvironmentIsSigned() else {
return
}

Valet.iCloudCurrentAndLegacyPermutations(with: Valet.sharedAccessGroupIdentifier, shared: true).forEach { permutation, legacyValet in
legacyValet.setString(passcode, forKey: key)

Expand Down
20 changes: 0 additions & 20 deletions Tests/ValetIntegrationTests/CloudIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ class CloudIntegrationTests: XCTestCase

func test_synchronizableValet_isDistinctFromVanillaValetWithEqualConfiguration()
{
guard testEnvironmentIsSigned() else {
return
}

let localValet = Valet.valet(with: valet.identifier, accessibility: valet.accessibility)

// Setting
Expand All @@ -67,21 +63,13 @@ class CloudIntegrationTests: XCTestCase

func test_setStringForKey()
{
guard testEnvironmentIsSigned() else {
return
}

XCTAssertNil(valet.string(forKey: key))
XCTAssertTrue(valet.set(string: passcode, forKey: key))
XCTAssertEqual(passcode, valet.string(forKey: key))
}

func test_removeObjectForKey()
{
guard testEnvironmentIsSigned() else {
return
}

XCTAssertTrue(valet.set(string: passcode, forKey: key))
XCTAssertEqual(passcode, valet.string(forKey: key))

Expand All @@ -93,21 +81,13 @@ class CloudIntegrationTests: XCTestCase

func test_canAccessKeychain()
{
guard testEnvironmentIsSigned() else {
return
}

Valet.iCloudPermutations(with: valet.identifier).forEach { permutation in
XCTAssertTrue(permutation.canAccessKeychain(), "\(permutation) could not access keychain.")
}
}

func test_canAccessKeychain_sharedAccessGroup()
{
guard testEnvironmentIsSigned() else {
return
}

Valet.iCloudPermutations(with: Valet.sharedAccessGroupIdentifier, shared: true).forEach { permutation in
XCTAssertTrue(permutation.canAccessKeychain(), "\(permutation) could not access keychain.")
}
Expand Down
20 changes: 4 additions & 16 deletions Tests/ValetIntegrationTests/SecureEnclaveIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SecureEnclaveIntegrationTests: XCTestCase

func test_secureEnclaveValetsWithEqualConfiguration_canAccessSameData()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand All @@ -58,7 +58,7 @@ class SecureEnclaveIntegrationTests: XCTestCase

func test_secureEnclaveValetsWithDifferingAccessControl_canNotAccessSameData()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand All @@ -73,10 +73,6 @@ class SecureEnclaveIntegrationTests: XCTestCase

func test_canAccessKeychain()
{
guard testEnvironmentIsSigned() else {
return
}

#if swift(>=4.1)
let permutations: [SecureEnclaveValet] = SecureEnclaveAccessControl.allValues().compactMap { accessControl in
return .valet(with: valet.identifier, accessControl: accessControl)
Expand All @@ -93,10 +89,6 @@ class SecureEnclaveIntegrationTests: XCTestCase
}

func test_canAccessKeychain_sharedAccessGroup() {
guard testEnvironmentIsSigned() else {
return
}

let sharedAccessGroupIdentifier: Identifier
#if os(iOS)
sharedAccessGroupIdentifier = Identifier(nonEmpty: "com.squareup.Valet-iOS-Test-Host-App")!
Expand Down Expand Up @@ -129,10 +121,6 @@ class SecureEnclaveIntegrationTests: XCTestCase

func test_migrateObjectsMatchingQuery_failsForBadQuery()
{
guard testEnvironmentIsSigned() else {
return
}

let invalidQuery = [
kSecClass as String: kSecClassGenericPassword as String,
kSecAttrAccessControl as String: "Fake access control"
Expand All @@ -142,7 +130,7 @@ class SecureEnclaveIntegrationTests: XCTestCase

func test_migrateObjectsFromValet_migratesSuccessfullyToSecureEnclave()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand Down Expand Up @@ -178,7 +166,7 @@ class SecureEnclaveIntegrationTests: XCTestCase
}

func test_migrateObjectsFromValet_migratesSuccessfullyAfterCanAccessKeychainCalls() {
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase

func test_SinglePromptSecureEnclaveValetsWithEqualConfiguration_canAccessSameData()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand All @@ -58,7 +58,7 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase

func test_SinglePromptSecureEnclaveValetsWithDifferingAccessControl_canNotAccessSameData()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand All @@ -73,7 +73,7 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase

func test_allKeys()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand All @@ -99,10 +99,6 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase

func test_canAccessKeychain()
{
guard testEnvironmentIsSigned() else {
return
}

#if swift(>=4.1)
let permutations: [SecureEnclaveValet] = SecureEnclaveAccessControl.allValues().compactMap { accessControl in
return .valet(with: valet.identifier, accessControl: accessControl)
Expand All @@ -119,10 +115,6 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase
}

func test_canAccessKeychain_sharedAccessGroup() {
guard testEnvironmentIsSigned() else {
return
}

let sharedAccessGroupIdentifier: Identifier
#if os(iOS)
sharedAccessGroupIdentifier = Identifier(nonEmpty: "com.squareup.Valet-iOS-Test-Host-App")!
Expand Down Expand Up @@ -151,10 +143,6 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase

func test_migrateObjectsMatchingQuery_failsForBadQuery()
{
guard testEnvironmentIsSigned() else {
return
}

let invalidQuery = [
kSecClass as String: kSecClassGenericPassword as String,
kSecAttrAccessControl as String: "Fake access control"
Expand All @@ -164,7 +152,7 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase

func test_migrateObjectsFromValet_migratesSuccessfullyToSecureEnclave()
{
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand Down Expand Up @@ -200,7 +188,7 @@ class SinglePromptSecureEnclaveIntegrationTests: XCTestCase
}

func test_migrateObjectsFromValet_migratesSuccessfullyAfterCanAccessKeychainCalls() {
guard testEnvironmentIsSigned() && testEnvironmentSupportsWhenPasscodeSet() else {
guard testEnvironmentSupportsWhenPasscodeSet() else {
return
}

Expand Down
Loading