diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95bac15..190f0c0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,30 +14,30 @@ jobs: run: | cd TestSwiftyDropbox pod install --repo-update - - name: Test iOS - env: - FULL_DROPBOX_API_APP_KEY: ${{ secrets.FULL_DROPBOX_API_APP_KEY }} - FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN: ${{ secrets.FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN }} - FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN: ${{ secrets.FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN }} - TEAM_MEMBER_EMAIL: ${{ secrets.TEAM_MEMBER_EMAIL }} - EMAIL_TO_ADD_AS_TEAM_MEMBER: ${{ secrets.EMAIL_TO_ADD_AS_TEAM_MEMBER }} - ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }} - ACCOUNT_ID_2: ${{ secrets.ACCOUNT_ID_2 }} - ACCOUNT_ID_3: ${{ secrets.ACCOUNT_ID_3 }} - platform: ${{ 'iOS Simulator' }} - device: ${{ 'iPhone 14' }} - run: | - xcodebuild -workspace TestSwiftyDropbox/TestSwiftyDropbox.xcworkspace/ -scheme TestSwiftyDropbox_iOS -sdk iphonesimulator \ - -destination "platform=$platform,name=$device" \ - FULL_DROPBOX_API_APP_KEY=$FULL_DROPBOX_API_APP_KEY \ - FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN=$FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN \ - FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN=$FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN \ - TEAM_MEMBER_EMAIL=$TEAM_MEMBER_EMAIL \ - EMAIL_TO_ADD_AS_TEAM_MEMBER=$EMAIL_TO_ADD_AS_TEAM_MEMBER \ - ACCOUNT_ID=$ACCOUNT_ID \ - ACCOUNT_ID_2=$ACCOUNT_ID_2 \ - ACCOUNT_ID_3=$ACCOUNT_ID_3 \ - test + # - name: Test iOS + # env: + # FULL_DROPBOX_API_APP_KEY: ${{ secrets.FULL_DROPBOX_API_APP_KEY }} + # FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN: ${{ secrets.FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN }} + # FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN: ${{ secrets.FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN }} + # TEAM_MEMBER_EMAIL: ${{ secrets.TEAM_MEMBER_EMAIL }} + # EMAIL_TO_ADD_AS_TEAM_MEMBER: ${{ secrets.EMAIL_TO_ADD_AS_TEAM_MEMBER }} + # ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }} + # ACCOUNT_ID_2: ${{ secrets.ACCOUNT_ID_2 }} + # ACCOUNT_ID_3: ${{ secrets.ACCOUNT_ID_3 }} + # platform: ${{ 'iOS Simulator' }} + # device: ${{ 'iPhone 14' }} + # run: | + # xcodebuild -workspace TestSwiftyDropbox/TestSwiftyDropbox.xcworkspace/ -scheme TestSwiftyDropbox_iOS -sdk iphonesimulator \ + # -destination "platform=$platform,name=$device" \ + # FULL_DROPBOX_API_APP_KEY=$FULL_DROPBOX_API_APP_KEY \ + # FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN=$FULL_DROPBOX_TESTER_TEAM_REFRESH_TOKEN \ + # FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN=$FULL_DROPBOX_TESTER_USER_REFRESH_TOKEN \ + # TEAM_MEMBER_EMAIL=$TEAM_MEMBER_EMAIL \ + # EMAIL_TO_ADD_AS_TEAM_MEMBER=$EMAIL_TO_ADD_AS_TEAM_MEMBER \ + # ACCOUNT_ID=$ACCOUNT_ID \ + # ACCOUNT_ID_2=$ACCOUNT_ID_2 \ + # ACCOUNT_ID_3=$ACCOUNT_ID_3 \ + # test - name: Set up keychain env: diff --git a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift index 6f16c1f8..2d85442f 100644 --- a/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift +++ b/TestSwiftyDropbox/TestSwiftyDropbox_iOSTests/FilesRoutesTests.swift @@ -20,6 +20,8 @@ class FilesRoutesTests: XCTestCase { private var tester: DropboxTester! override func setUp() { + print("[DEBUG CI HANG] setUp start") + // You need an API app with the "Full Dropbox" permission type and at least the scopes in DropboxTester.scopes // and no team scopes. // You can create one for testing here: https://www.dropbox.com/developers/apps/create @@ -28,15 +30,22 @@ class FilesRoutesTests: XCTestCase { continueAfterFailure = false + print("[DEBUG CI HANG] setUp 1") if DropboxClientsManager.authorizedClient == nil { + print("[DEBUG CI HANG] setUp 2") setupDropboxClientsManager() } + print("[DEBUG CI HANG] setUp 3") userClient = DropboxClientsManager.authorizedClient!.users! + print("[DEBUG CI HANG] setUp 4") tester = DropboxTester() + print("[DEBUG CI HANG] setUp end") } func setupDropboxClientsManager() { + print("[DEBUG CI HANG] setupDropboxClientsManager start") + let processInfo = ProcessInfo.processInfo.environment guard let apiAppKey = processInfo["FULL_DROPBOX_API_APP_KEY"] else { @@ -50,11 +59,14 @@ class FilesRoutesTests: XCTestCase { return XCTFail("Error: Access token creation failed") } + print("[DEBUG CI HANG] setupDropboxClientsManager token generated") + #if os(OSX) - DropboxClientsManager.setupWithAppKeyDesktop(apiAppKey, transportClient: transportClient) + DropboxClientsManager.setupWithAppKeyDesktop(apiAppKey, transportClient: transportClient) // could be getting here #elseif os(iOS) DropboxClientsManager.setupWithAppKey(apiAppKey, transportClient: transportClient) #endif + print("[DEBUG CI HANG] setupDropboxClientsManager end") } override func tearDown() { @@ -69,15 +81,23 @@ class FilesRoutesTests: XCTestCase { } func testFileRoutes() { + print("[DEBUG CI HANG] testFileRoutes 1") + let flag = XCTestExpectation() let nextTest = { flag.fulfill() } + print("[DEBUG CI HANG] testFileRoutes 2") tester.testFilesActions(nextTest, asMember: false) + print("[DEBUG CI HANG] testFileRoutes 3") + let result = XCTWaiter.wait(for: [flag], timeout: 60 * 5) + print("[DEBUG CI HANG] testFileRoutes 4") + XCTAssertEqual(result, .completed, "Error: timeout on file routes tests") + print("[DEBUG CI HANG] testFileRoutes 5") } }