From 856768fc78b748f0ea4b4e3520efc57822be49e8 Mon Sep 17 00:00:00 2001
From: Sebastian Villena <97059974+ruisebas@users.noreply.github.com>
Date: Tue, 30 Apr 2024 18:08:35 -0400
Subject: [PATCH] Removing CoreMLPlugin tests

---
 .../get_platform_parameters/action.yml             |  6 +++---
 .github/workflows/unit_test.yml                    |  6 ++----
 .../CoreMLNaturalLanguageAdapterTests.swift        |  5 ++---
 .../DependencyTests/CoreMLVisionAdapterTests.swift | 14 ++++++--------
 4 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/.github/composite_actions/get_platform_parameters/action.yml b/.github/composite_actions/get_platform_parameters/action.yml
index ab28693b87..2b01f58d75 100644
--- a/.github/composite_actions/get_platform_parameters/action.yml
+++ b/.github/composite_actions/get_platform_parameters/action.yml
@@ -63,9 +63,9 @@ runs:
 
         DESTINATION_MAPPING='{
           "minimum": {
-            "iOS": "platform=iOS Simulator,name=iPhone 14,OS=17.0",
-            "tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4",
-            "watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4",
+            "iOS": "platform=iOS Simulator,name=iPhone 14,OS=17.0.1",
+            "tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=17.0",
+            "watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=10.0",
             "macOS": "platform=macOS,arch=x86_64"
           },
           "latest": {
diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml
index 1e733c2060..454c08bec9 100644
--- a/.github/workflows/unit_test.yml
+++ b/.github/workflows/unit_test.yml
@@ -70,8 +70,7 @@ jobs:
           AWSPredictionsPlugin,
           AWSPinpointAnalyticsPlugin,
           AWSPinpointPushNotificationsPlugin,
-          AWSS3StoragePlugin,
-          CoreMLPredictionsPlugin
+          AWSS3StoragePlugin
         ]
     uses: ./.github/workflows/run_unit_tests_platforms.yml
     with:
@@ -96,8 +95,7 @@ jobs:
           { scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
           { scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
           { scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' },
-          { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' },
-          { scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' }
+          { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' }
         ]
     uses: ./.github/workflows/upload_coverage_report.yml
     with:
diff --git a/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLNaturalLanguageAdapterTests.swift b/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLNaturalLanguageAdapterTests.swift
index 71d847cbb7..0adea26595 100644
--- a/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLNaturalLanguageAdapterTests.swift
+++ b/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLNaturalLanguageAdapterTests.swift
@@ -52,7 +52,6 @@ class CoreMLNaturalLanguageAdapterTests: XCTestCase {
     /// - Then:
     ///    - I should get back correct tokens
     ///
-#if !os(watchOS) && !os(iOS)
     func testSyntaxToken() {
         let text = "The ripe taste of cheese improves with age."
         let result = coreMLNaturalLanguageAdapter.getSyntaxTokens(for: text)
@@ -65,7 +64,7 @@ class CoreMLNaturalLanguageAdapterTests: XCTestCase {
             "First word in the input should be determiner"
         )
     }
-#endif
+
     /// Test syntax token with invalid text
     ///
     /// - Given: CoreML Adapter
@@ -89,7 +88,7 @@ class CoreMLNaturalLanguageAdapterTests: XCTestCase {
     /// - Then:
     ///    - I should get back valid result
     ///
-#if !os(watchOS) && !os(iOS)
+#if !os(watchOS)
     func testEntityToken() {
         let text = "The American Red Cross was established in Washington, D.C., by Clara Barton."
         let result = coreMLNaturalLanguageAdapter.getEntities(for: text)
diff --git a/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLVisionAdapterTests.swift b/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLVisionAdapterTests.swift
index bb4327c079..fc8bf9c4a6 100644
--- a/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLVisionAdapterTests.swift
+++ b/AmplifyPlugins/Predictions/Tests/CoreMLPredictionsPluginUnitTests/DependencyTests/CoreMLVisionAdapterTests.swift
@@ -17,20 +17,19 @@ class CoreMLVisionAdapterTests: XCTestCase {
         coreMLVisionAdapter = CoreMLVisionAdapter()
     }
 
-    func testDetectText() throws {
+    func testDetectLabels() throws {
         let url = try XCTUnwrap(
-            Bundle.module.url(forResource: "screenshotWithText", withExtension: "png", subdirectory: "TestImages")
+            Bundle.module.url(forResource: "people", withExtension: "jpg", subdirectory: "TestImages")
         )
-        let result = try coreMLVisionAdapter.detectText(url)
+        let result = try coreMLVisionAdapter.detectLabels(url)
         XCTAssertNotNil(result, "The result should be nil")
     }
 
-#if !os(macOS)
-    func testDetectLabels() throws {
+    func testDetectText() throws {
         let url = try XCTUnwrap(
-            Bundle.module.url(forResource: "people", withExtension: "jpg", subdirectory: "TestImages")
+            Bundle.module.url(forResource: "screenshotWithText", withExtension: "png", subdirectory: "TestImages")
         )
-        let result = try coreMLVisionAdapter.detectLabels(url)
+        let result = try coreMLVisionAdapter.detectText(url)
         XCTAssertNotNil(result, "The result should be nil")
     }
 
@@ -42,6 +41,5 @@ class CoreMLVisionAdapterTests: XCTestCase {
         XCTAssertNotNil(result, "The result should be nil")
         XCTAssertTrue(result?.entities.isEmpty != true, "The result should contain values for the image provided.")
     }
-#endif
 }
 #endif