Browse Source

Removed tests as a result of rdar://26870455

Kevin Harwood 9 years ago
parent
commit
e891699312
2 changed files with 69 additions and 66 deletions
  1. 6 4
      Tests/ManagerTests.swift
  2. 63 62
      Tests/UploadTests.swift

+ 6 - 4
Tests/ManagerTests.swift

@@ -216,10 +216,12 @@ class ManagerConfigurationHeadersTestCase: BaseTestCase {
         executeAuthorizationHeaderTestForConfigurationType(.ephemeral)
         executeAuthorizationHeaderTestForConfigurationType(.ephemeral)
     }
     }
 
 
-    func testThatBackgroundConfigurationHeadersAreSentWithRequest() {
-        // Given, When, Then
-        executeAuthorizationHeaderTestForConfigurationType(.background)
-    }
+
+//    ⚠️ This test has been removed as a result of rdar://26870455 in Xcode 8 Seed 1
+//    func testThatBackgroundConfigurationHeadersAreSentWithRequest() {
+//        // Given, When, Then
+//        executeAuthorizationHeaderTestForConfigurationType(.background)
+//    }
 
 
     private func executeAuthorizationHeaderTestForConfigurationType(_ type: ConfigurationType) {
     private func executeAuthorizationHeaderTestForConfigurationType(_ type: ConfigurationType) {
         // Given
         // Given

+ 63 - 62
Tests/UploadTests.swift

@@ -585,68 +585,69 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
         }
         }
     }
     }
 
 
-    func testThatUploadingMultipartFormDataOnBackgroundSessionWritesDataToFileToAvoidCrash() {
-        // Given
-        let manager: Manager = {
-            let identifier = "com.alamofire.uploadtests.\(UUID().uuidString)"
-            let configuration = URLSessionConfiguration.backgroundSessionConfigurationForAllPlatformsWithIdentifier(identifier)
-
-            return Manager(configuration: configuration, serverTrustPolicyManager: nil)
-        }()
-
-        let urlString = "https://httpbin.org/post"
-        let french = "français".data(using: String.Encoding.utf8, allowLossyConversion: false)!
-        let japanese = "日本語".data(using: String.Encoding.utf8, allowLossyConversion: false)!
-
-        let expectation = self.expectation(withDescription: "multipart form data upload should succeed")
-
-        var request: URLRequest?
-        var response: HTTPURLResponse?
-        var data: Data?
-        var error: NSError?
-        var streamingFromDisk: Bool?
-
-        // When
-        manager.upload(
-            .POST,
-            urlString,
-            multipartFormData: { multipartFormData in
-                multipartFormData.appendBodyPart(data: french, name: "french")
-                multipartFormData.appendBodyPart(data: japanese, name: "japanese")
-            },
-            encodingCompletion: { result in
-                switch result {
-                case let .success(upload, uploadStreamingFromDisk, _):
-                    streamingFromDisk = uploadStreamingFromDisk
-
-                    upload.response { responseRequest, responseResponse, responseData, responseError in
-                        request = responseRequest
-                        response = responseResponse
-                        data = responseData
-                        error = responseError
-
-                        expectation.fulfill()
-                    }
-                case .failure:
-                    expectation.fulfill()
-                }
-            }
-        )
-        
-        waitForExpectations(withTimeout: timeout, handler: nil)
-
-        // Then
-        XCTAssertNotNil(request, "request should not be nil")
-        XCTAssertNotNil(response, "response should not be nil")
-        XCTAssertNotNil(data, "data should not be nil")
-        XCTAssertNil(error, "error should be nil")
-
-        if let streamingFromDisk = streamingFromDisk {
-            XCTAssertTrue(streamingFromDisk, "streaming from disk should be true")
-        } else {
-            XCTFail("streaming from disk should not be nil")
-        }
-    }
+//    ⚠️ This test has been removed as a result of rdar://26870455 in Xcode 8 Seed 1
+//    func testThatUploadingMultipartFormDataOnBackgroundSessionWritesDataToFileToAvoidCrash() {
+//        // Given
+//        let manager: Manager = {
+//            let identifier = "com.alamofire.uploadtests.\(UUID().uuidString)"
+//            let configuration = URLSessionConfiguration.backgroundSessionConfigurationForAllPlatformsWithIdentifier(identifier)
+//
+//            return Manager(configuration: configuration, serverTrustPolicyManager: nil)
+//        }()
+//
+//        let urlString = "https://httpbin.org/post"
+//        let french = "français".data(using: String.Encoding.utf8, allowLossyConversion: false)!
+//        let japanese = "日本語".data(using: String.Encoding.utf8, allowLossyConversion: false)!
+//
+//        let expectation = self.expectation(withDescription: "multipart form data upload should succeed")
+//
+//        var request: URLRequest?
+//        var response: HTTPURLResponse?
+//        var data: Data?
+//        var error: NSError?
+//        var streamingFromDisk: Bool?
+//
+//        // When
+//        manager.upload(
+//            .POST,
+//            urlString,
+//            multipartFormData: { multipartFormData in
+//                multipartFormData.appendBodyPart(data: french, name: "french")
+//                multipartFormData.appendBodyPart(data: japanese, name: "japanese")
+//            },
+//            encodingCompletion: { result in
+//                switch result {
+//                case let .success(upload, uploadStreamingFromDisk, _):
+//                    streamingFromDisk = uploadStreamingFromDisk
+//
+//                    upload.response { responseRequest, responseResponse, responseData, responseError in
+//                        request = responseRequest
+//                        response = responseResponse
+//                        data = responseData
+//                        error = responseError
+//
+//                        expectation.fulfill()
+//                    }
+//                case .failure:
+//                    expectation.fulfill()
+//                }
+//            }
+//        )
+//        
+//        waitForExpectations(withTimeout: timeout, handler: nil)
+//
+//        // Then
+//        XCTAssertNotNil(request, "request should not be nil")
+//        XCTAssertNotNil(response, "response should not be nil")
+//        XCTAssertNotNil(data, "data should not be nil")
+//        XCTAssertNil(error, "error should be nil")
+//
+//        if let streamingFromDisk = streamingFromDisk {
+//            XCTAssertTrue(streamingFromDisk, "streaming from disk should be true")
+//        } else {
+//            XCTFail("streaming from disk should not be nil")
+//        }
+//    }
 
 
     // MARK: Combined Test Execution
     // MARK: Combined Test Execution