Skip to content

Commit

Permalink
Fix pytests and update build.sh to add ppc64le support.
Browse files Browse the repository at this point in the history
Signed-off-by: Sunidhi-Gaonkar1 <sunidhi.gaonkar@ibm.com>
  • Loading branch information
Sunidhi-Gaonkar1 committed Feb 6, 2024
1 parent fec0355 commit 13972b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions scripts/components/OpenSearch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in
TARGET="$PLATFORM-arm64-$PACKAGE"
SUFFIX="$PLATFORM-arm64"
;;
linux-tar-ppc64le)
PACKAGE="tar"
EXT="tar.gz"
TYPE="archives"
TARGET="$PLATFORM-ppc64le-$PACKAGE"
SUFFIX="$PLATFORM-ppc64le"
;;
linux-deb-x64)
PACKAGE="deb"
EXT="deb"
Expand Down
2 changes: 2 additions & 0 deletions src/system/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def current_architecture() -> str:
return "x64"
elif architecture == "aarch64" or architecture == "arm64":
return "arm64"
elif architecture == "ppc64le":
return "ppc64le"

Check warning on line 19 in src/system/os.py

View check run for this annotation

Codecov / codecov/patch

src/system/os.py#L19

Added line #L19 was not covered by tests
else:
raise ValueError(f"Unsupported architecture: {architecture}")

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_system/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class TestOs(unittest.TestCase):
# current_architecture
def test_current_architecture(self) -> None:
self.assertTrue(current_architecture() in ["x64", "arm64"])
self.assertTrue(current_architecture() in ["x64", "arm64", "ppc64le"])

@patch("subprocess.check_output", return_value="x86_64".encode())
def test_x86_64_return_x64_architecture(self, mock_subprocess: MagicMock) -> None:
Expand Down

0 comments on commit 13972b9

Please sign in to comment.