Repository: opensearch-project/opensearch-build

Issue:
Remove `integtest.sh` from all plugin repos
The [integtest.sh](https://github.com/opensearch-project/opensearch-build/blob/main/bundle-workflow/scripts/default/integtest.sh) tool contains the logic to run integration tests for a plugin. This logic is mostly common across most plugins, so it has been moved to `opensearch-build` repo. Thus it can be removed from the individual plugin repos.
However, if a plugin requires some custom logic to run integtests, which the standard tool doesn't provide, they can continue maintaining this integtest.sh in their own repo. In this case, when the integration tests are run, if a plugin has a integtest.sh tool in their repo, it gets precedence over the standard default integtest.sh in the `opensearch-build` repo. This precedence order logic is defined in ScriptFinder [here](https://github.com/opensearch-project/opensearch-build/blob/84f2fa1cf15abe314aee62dbd2cb39bf2c9bb65f/bundle-workflow/src/paths/script_finder.py#L65) 

Action items:

Raise PRs on all plugin repos and remove integtest.sh 
- [ ] index-management
- [ ] anomaly-detection,
- [ ] alerting
- [ ] asynchronous-search
- [ ] k-NN

Changes will need to be backported into 1.x branches if such exist, too.


Discussion:
I took the liberty to make PRs in all plugin repos that had an integtest.sh file using meta, see https://github.com/opensearch-project/opensearch-plugins/pull/80.

Resolving patch:
diff --git a/bundle-workflow/src/paths/script_finder.py b/bundle-workflow/src/paths/script_finder.py
--- a/bundle-workflow/src/paths/script_finder.py
+++ b/bundle-workflow/src/paths/script_finder.py
@@ -64,9 +64,8 @@ def find_build_script(cls, component_name, git_dir):
     @classmethod
     def find_integ_test_script(cls, component_name, git_dir):
         paths = [
-            # TODO: Uncomment this after the integtest.sh tool is removed from plugin repos. See issue #497
-            # os.path.realpath(os.path.join(git_dir, "integtest.sh")),
-            # os.path.realpath(os.path.join(git_dir, "scripts/integtest.sh")),
+            os.path.realpath(os.path.join(git_dir, "integtest.sh")),
+            os.path.realpath(os.path.join(git_dir, "scripts/integtest.sh")),
             os.path.realpath(
                 os.path.join(cls.component_scripts_path, component_name, "integtest.sh")
             ),


Test patch:
diff --git a/bundle-workflow/tests/tests_paths/test_script_finder.py b/bundle-workflow/tests/tests_paths/test_script_finder.py
--- a/bundle-workflow/tests/tests_paths/test_script_finder.py
+++ b/bundle-workflow/tests/tests_paths/test_script_finder.py
@@ -92,7 +92,6 @@ def test_find_integ_test_script_component_override(self):
             msg="A component without scripts resolves to a component override.",
         )
 
-    @unittest.skip('See https://github.com/opensearch-project/opensearch-build/issues/497')
     def test_find_integ_test_script_component_script(self):
         self.assertEqual(
             os.path.join(self.component_with_scripts, "integtest.sh"),
@@ -102,7 +101,6 @@ def test_find_integ_test_script_component_script(self):
             msg="A component with a script resolves to the script at the root.",
         )
 
-    @unittest.skip('See https://github.com/opensearch-project/opensearch-build/issues/497')
     def test_find_integ_test_script_component_script_in_folder(self):
         self.assertEqual(
             os.path.join(self.component_with_scripts_folder, "scripts/integtest.sh"),