We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] BWC test suite does not run on Jenkins
**Describe the bug**
BWC test job fails to run Jenkins due to misconfigured directory to kick off tests. 

```
Running ./bundle-workflow/src/run_bwc_test.py --s3-bucket <artifact_s3_bucket> --opensearch-version 1.1.0 --build-id 163 --architecture x64 --test-run-id 6 ...
2021-09-17 21:50:08 INFO     Switching to temporary work_dir: /tmp/tmp70l5b7_e
Traceback (most recent call last):
  File "/var/jenkins/workspace/bwc-test/bundle-workflow/src/run_bwc_test.py", line 31, in <module>
    sys.exit(main())
  File "/var/jenkins/workspace/bwc-test/bundle-workflow/src/run_bwc_test.py", line 26, in main
    args.s3_bucket, args.build_id, args.opensearch_version, args.architecture, cur_dir)
  File "/var/jenkins/workspace/bwc-test/bundle-workflow/src/manifests/bundle_manifest.py", line 85, in from_s3
    S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)
  File "/var/jenkins/workspace/bwc-test/bundle-workflow/src/aws/s3_bucket.py", line 99, in download_file
    local_dir = Path(dest)
  File "/usr/lib64/python3.7/pathlib.py", line 1027, in __new__
    self = cls._from_parts(args, init=False)
  File "/usr/lib64/python3.7/pathlib.py", line 674, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "/usr/lib64/python3.7/pathlib.py", line 658, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
```

**To Reproduce**
Run `/bundle-workflow/src/test.sh bwc-test --s3-bucket <artifact_s3_bucket> --opensearch-version 1.1.0 --build-id 163 --architecture x64 --test-run-id 6`


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bundle-workflow/src/manifests/bundle_manifest.py`
Content:
```
1 # SPDX-License-Identifier: Apache-2.0
2 #
3 # The OpenSearch Contributors require contributions made to
4 # this file be licensed under the Apache-2.0 license or a
5 # compatible open source license.
6 
7 import os
8 
9 from aws.s3_bucket import S3Bucket
10 from manifests.manifest import Manifest
11 
12 
13 class BundleManifest(Manifest):
14     """
15     A BundleManifest is an immutable view of the outputs from a assemble step
16     The manifest contains information about the bundle that was built (in the `assemble` section),
17     and the components that made up the bundle in the `components` section.
18 
19     The format for schema version 1.0 is:
20         schema-version: "1.0"
21         build:
22           name: string
23           version: string
24           architecture: x64 or arm64
25           location: /relative/path/to/tarball
26         components:
27           - name: string
28             repository: URL of git repository
29             ref: git ref that was built (sha, branch, or tag)
30             commit_id: The actual git commit ID that was built (i.e. the resolved "ref")
31             location: /relative/path/to/artifact
32     """
33 
34     SCHEMA = {
35         "build": {
36             "required": True,
37             "type": "dict",
38             "schema": {
39                 "architecture": {"required": True, "type": "string"},
40                 "id": {"required": True, "type": "string"},
41                 "location": {"required": True, "type": "string"},
42                 "name": {"required": True, "type": "string"},
43                 "version": {"required": True, "type": "string"},
44             },
45         },
46         "schema-version": {"required": True, "type": "string", "allowed": ["1.0"]},
47         "components": {
48             "required": True,
49             "type": "list",
50             "schema": {
51                 "type": "dict",
52                 "schema": {
53                     "commit_id": {"required": True, "type": "string"},
54                     "location": {"required": True, "type": "string"},
55                     "name": {"required": True, "type": "string"},
56                     "ref": {"required": True, "type": "string"},
57                     "repository": {"required": True, "type": "string"},
58                 },
59             },
60         },
61     }
62 
63     def __init__(self, data):
64         super().__init__(data)
65         self.build = self.Build(data["build"])
66         self.components = list(
67             map(lambda entry: self.Component(entry), data["components"])
68         )
69 
70     def __to_dict__(self):
71         return {
72             "schema-version": "1.0",
73             "build": self.build.__to_dict__(),
74             "components": list(
75                 map(lambda component: component.__to_dict__(), self.components)
76             ),
77         }
78 
79     @staticmethod
80     def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):
81         work_dir = work_dir if not None else str(os.getcwd())
82         manifest_s3_path = BundleManifest.get_bundle_manifest_relative_location(
83             build_id, opensearch_version, architecture
84         )
85         S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)
86         with open("manifest.yml", "r") as file:
87             bundle_manifest = BundleManifest.from_file(file)
88         os.remove(os.path.realpath(os.path.join(work_dir, "manifest.yml")))
89         return bundle_manifest
90 
91     @staticmethod
92     def get_tarball_relative_location(build_id, opensearch_version, architecture):
93         return f"bundles/{opensearch_version}/{build_id}/{architecture}/opensearch-{opensearch_version}-linux-{architecture}.tar.gz"
94 
95     @staticmethod
96     def get_tarball_name(opensearch_version, architecture):
97         return f"opensearch-{opensearch_version}-linux-{architecture}.tar.gz"
98 
99     @staticmethod
100     def get_bundle_manifest_relative_location(
101         build_id, opensearch_version, architecture
102     ):
103         return f"bundles/{opensearch_version}/{build_id}/{architecture}/manifest.yml"
104 
105     class Build:
106         def __init__(self, data):
107             self.name = data["name"]
108             self.version = data["version"]
109             self.architecture = data["architecture"]
110             self.location = data["location"]
111             self.id = data["id"]
112 
113         def __to_dict__(self):
114             return {
115                 "name": self.name,
116                 "version": self.version,
117                 "architecture": self.architecture,
118                 "location": self.location,
119                 "id": self.id,
120             }
121 
122     class Component:
123         def __init__(self, data):
124             self.name = data["name"]
125             self.repository = data["repository"]
126             self.ref = data["ref"]
127             self.commit_id = data["commit_id"]
128             self.location = data["location"]
129 
130         def __to_dict__(self):
131             return {
132                 "name": self.name,
133                 "repository": self.repository,
134                 "ref": self.ref,
135                 "commit_id": self.commit_id,
136                 "location": self.location,
137             }
138
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bundle-workflow/src/manifests/bundle_manifest.py b/bundle-workflow/src/manifests/bundle_manifest.py
--- a/bundle-workflow/src/manifests/bundle_manifest.py
+++ b/bundle-workflow/src/manifests/bundle_manifest.py
@@ -83,8 +83,7 @@
             build_id, opensearch_version, architecture
         )
         S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)
-        with open("manifest.yml", "r") as file:
-            bundle_manifest = BundleManifest.from_file(file)
+        bundle_manifest = BundleManifest.from_path(os.path.join(work_dir, 'manifest.yml'))
         os.remove(os.path.realpath(os.path.join(work_dir, "manifest.yml")))
         return bundle_manifest

{"golden_diff": "diff --git a/bundle-workflow/src/manifests/bundle_manifest.py b/bundle-workflow/src/manifests/bundle_manifest.py\n--- a/bundle-workflow/src/manifests/bundle_manifest.py\n+++ b/bundle-workflow/src/manifests/bundle_manifest.py\n@@ -83,8 +83,7 @@\n             build_id, opensearch_version, architecture\n         )\n         S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n-        with open(\"manifest.yml\", \"r\") as file:\n-            bundle_manifest = BundleManifest.from_file(file)\n+        bundle_manifest = BundleManifest.from_path(os.path.join(work_dir, 'manifest.yml'))\n         os.remove(os.path.realpath(os.path.join(work_dir, \"manifest.yml\")))\n         return bundle_manifest\n", "issue": "[BUG] BWC test suite does not run on Jenkins\n**Describe the bug**\r\nBWC test job fails to run Jenkins due to misconfigured directory to kick off tests. \r\n\r\n```\r\nRunning ./bundle-workflow/src/run_bwc_test.py --s3-bucket <artifact_s3_bucket> --opensearch-version 1.1.0 --build-id 163 --architecture x64 --test-run-id 6 ...\r\n2021-09-17 21:50:08 INFO     Switching to temporary work_dir: /tmp/tmp70l5b7_e\r\nTraceback (most recent call last):\r\n  File \"/var/jenkins/workspace/bwc-test/bundle-workflow/src/run_bwc_test.py\", line 31, in <module>\r\n    sys.exit(main())\r\n  File \"/var/jenkins/workspace/bwc-test/bundle-workflow/src/run_bwc_test.py\", line 26, in main\r\n    args.s3_bucket, args.build_id, args.opensearch_version, args.architecture, cur_dir)\r\n  File \"/var/jenkins/workspace/bwc-test/bundle-workflow/src/manifests/bundle_manifest.py\", line 85, in from_s3\r\n    S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\r\n  File \"/var/jenkins/workspace/bwc-test/bundle-workflow/src/aws/s3_bucket.py\", line 99, in download_file\r\n    local_dir = Path(dest)\r\n  File \"/usr/lib64/python3.7/pathlib.py\", line 1027, in __new__\r\n    self = cls._from_parts(args, init=False)\r\n  File \"/usr/lib64/python3.7/pathlib.py\", line 674, in _from_parts\r\n    drv, root, parts = self._parse_args(args)\r\n  File \"/usr/lib64/python3.7/pathlib.py\", line 658, in _parse_args\r\n    a = os.fspath(a)\r\nTypeError: expected str, bytes or os.PathLike object, not NoneType\r\n```\r\n\r\n**To Reproduce**\r\nRun `/bundle-workflow/src/test.sh bwc-test --s3-bucket <artifact_s3_bucket> --opensearch-version 1.1.0 --build-id 163 --architecture x64 --test-run-id 6`\r\n\n", "before_files": [{"content": "# SPDX-License-Identifier: Apache-2.0\n#\n# The OpenSearch Contributors require contributions made to\n# this file be licensed under the Apache-2.0 license or a\n# compatible open source license.\n\nimport os\n\nfrom aws.s3_bucket import S3Bucket\nfrom manifests.manifest import Manifest\n\n\nclass BundleManifest(Manifest):\n    \"\"\"\n    A BundleManifest is an immutable view of the outputs from a assemble step\n    The manifest contains information about the bundle that was built (in the `assemble` section),\n    and the components that made up the bundle in the `components` section.\n\n    The format for schema version 1.0 is:\n        schema-version: \"1.0\"\n        build:\n          name: string\n          version: string\n          architecture: x64 or arm64\n          location: /relative/path/to/tarball\n        components:\n          - name: string\n            repository: URL of git repository\n            ref: git ref that was built (sha, branch, or tag)\n            commit_id: The actual git commit ID that was built (i.e. the resolved \"ref\")\n            location: /relative/path/to/artifact\n    \"\"\"\n\n    SCHEMA = {\n        \"build\": {\n            \"required\": True,\n            \"type\": \"dict\",\n            \"schema\": {\n                \"architecture\": {\"required\": True, \"type\": \"string\"},\n                \"id\": {\"required\": True, \"type\": \"string\"},\n                \"location\": {\"required\": True, \"type\": \"string\"},\n                \"name\": {\"required\": True, \"type\": \"string\"},\n                \"version\": {\"required\": True, \"type\": \"string\"},\n            },\n        },\n        \"schema-version\": {\"required\": True, \"type\": \"string\", \"allowed\": [\"1.0\"]},\n        \"components\": {\n            \"required\": True,\n            \"type\": \"list\",\n            \"schema\": {\n                \"type\": \"dict\",\n                \"schema\": {\n                    \"commit_id\": {\"required\": True, \"type\": \"string\"},\n                    \"location\": {\"required\": True, \"type\": \"string\"},\n                    \"name\": {\"required\": True, \"type\": \"string\"},\n                    \"ref\": {\"required\": True, \"type\": \"string\"},\n                    \"repository\": {\"required\": True, \"type\": \"string\"},\n                },\n            },\n        },\n    }\n\n    def __init__(self, data):\n        super().__init__(data)\n        self.build = self.Build(data[\"build\"])\n        self.components = list(\n            map(lambda entry: self.Component(entry), data[\"components\"])\n        )\n\n    def __to_dict__(self):\n        return {\n            \"schema-version\": \"1.0\",\n            \"build\": self.build.__to_dict__(),\n            \"components\": list(\n                map(lambda component: component.__to_dict__(), self.components)\n            ),\n        }\n\n    @staticmethod\n    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):\n        work_dir = work_dir if not None else str(os.getcwd())\n        manifest_s3_path = BundleManifest.get_bundle_manifest_relative_location(\n            build_id, opensearch_version, architecture\n        )\n        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n        with open(\"manifest.yml\", \"r\") as file:\n            bundle_manifest = BundleManifest.from_file(file)\n        os.remove(os.path.realpath(os.path.join(work_dir, \"manifest.yml\")))\n        return bundle_manifest\n\n    @staticmethod\n    def get_tarball_relative_location(build_id, opensearch_version, architecture):\n        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n\n    @staticmethod\n    def get_tarball_name(opensearch_version, architecture):\n        return f\"opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n\n    @staticmethod\n    def get_bundle_manifest_relative_location(\n        build_id, opensearch_version, architecture\n    ):\n        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/manifest.yml\"\n\n    class Build:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.version = data[\"version\"]\n            self.architecture = data[\"architecture\"]\n            self.location = data[\"location\"]\n            self.id = data[\"id\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"version\": self.version,\n                \"architecture\": self.architecture,\n                \"location\": self.location,\n                \"id\": self.id,\n            }\n\n    class Component:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.repository = data[\"repository\"]\n            self.ref = data[\"ref\"]\n            self.commit_id = data[\"commit_id\"]\n            self.location = data[\"location\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"repository\": self.repository,\n                \"ref\": self.ref,\n                \"commit_id\": self.commit_id,\n                \"location\": self.location,\n            }\n", "path": "bundle-workflow/src/manifests/bundle_manifest.py"}], "after_files": [{"content": "# SPDX-License-Identifier: Apache-2.0\n#\n# The OpenSearch Contributors require contributions made to\n# this file be licensed under the Apache-2.0 license or a\n# compatible open source license.\n\nimport os\n\nfrom aws.s3_bucket import S3Bucket\nfrom manifests.manifest import Manifest\n\n\nclass BundleManifest(Manifest):\n    \"\"\"\n    A BundleManifest is an immutable view of the outputs from a assemble step\n    The manifest contains information about the bundle that was built (in the `assemble` section),\n    and the components that made up the bundle in the `components` section.\n\n    The format for schema version 1.0 is:\n        schema-version: \"1.0\"\n        build:\n          name: string\n          version: string\n          architecture: x64 or arm64\n          location: /relative/path/to/tarball\n        components:\n          - name: string\n            repository: URL of git repository\n            ref: git ref that was built (sha, branch, or tag)\n            commit_id: The actual git commit ID that was built (i.e. the resolved \"ref\")\n            location: /relative/path/to/artifact\n    \"\"\"\n\n    SCHEMA = {\n        \"build\": {\n            \"required\": True,\n            \"type\": \"dict\",\n            \"schema\": {\n                \"architecture\": {\"required\": True, \"type\": \"string\"},\n                \"id\": {\"required\": True, \"type\": \"string\"},\n                \"location\": {\"required\": True, \"type\": \"string\"},\n                \"name\": {\"required\": True, \"type\": \"string\"},\n                \"version\": {\"required\": True, \"type\": \"string\"},\n            },\n        },\n        \"schema-version\": {\"required\": True, \"type\": \"string\", \"allowed\": [\"1.0\"]},\n        \"components\": {\n            \"required\": True,\n            \"type\": \"list\",\n            \"schema\": {\n                \"type\": \"dict\",\n                \"schema\": {\n                    \"commit_id\": {\"required\": True, \"type\": \"string\"},\n                    \"location\": {\"required\": True, \"type\": \"string\"},\n                    \"name\": {\"required\": True, \"type\": \"string\"},\n                    \"ref\": {\"required\": True, \"type\": \"string\"},\n                    \"repository\": {\"required\": True, \"type\": \"string\"},\n                },\n            },\n        },\n    }\n\n    def __init__(self, data):\n        super().__init__(data)\n        self.build = self.Build(data[\"build\"])\n        self.components = list(\n            map(lambda entry: self.Component(entry), data[\"components\"])\n        )\n\n    def __to_dict__(self):\n        return {\n            \"schema-version\": \"1.0\",\n            \"build\": self.build.__to_dict__(),\n            \"components\": list(\n                map(lambda component: component.__to_dict__(), self.components)\n            ),\n        }\n\n    @staticmethod\n    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):\n        work_dir = work_dir if not None else str(os.getcwd())\n        manifest_s3_path = BundleManifest.get_bundle_manifest_relative_location(\n            build_id, opensearch_version, architecture\n        )\n        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n        bundle_manifest = BundleManifest.from_path(os.path.join(work_dir, 'manifest.yml'))\n        os.remove(os.path.realpath(os.path.join(work_dir, \"manifest.yml\")))\n        return bundle_manifest\n\n    @staticmethod\n    def get_tarball_relative_location(build_id, opensearch_version, architecture):\n        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n\n    @staticmethod\n    def get_tarball_name(opensearch_version, architecture):\n        return f\"opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n\n    @staticmethod\n    def get_bundle_manifest_relative_location(\n        build_id, opensearch_version, architecture\n    ):\n        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/manifest.yml\"\n\n    class Build:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.version = data[\"version\"]\n            self.architecture = data[\"architecture\"]\n            self.location = data[\"location\"]\n            self.id = data[\"id\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"version\": self.version,\n                \"architecture\": self.architecture,\n                \"location\": self.location,\n                \"id\": self.id,\n            }\n\n    class Component:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.repository = data[\"repository\"]\n            self.ref = data[\"ref\"]\n            self.commit_id = data[\"commit_id\"]\n            self.location = data[\"location\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"repository\": self.repository,\n                \"ref\": self.ref,\n                \"commit_id\": self.commit_id,\n                \"location\": self.location,\n            }\n", "path": "bundle-workflow/src/manifests/bundle_manifest.py"}]}