Skip to content

Commit

Permalink
Merge pull request #20 from run-ai/omer/fix-test-encoded-buffer
Browse files Browse the repository at this point in the history
Fix FileStreamer output encoded
  • Loading branch information
omer-dayan authored Dec 5, 2024
2 parents bf57cc6 + b01bafb commit 74af0b8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: devcontainers/[email protected]
with:
runCmd: |
make test
make test && \
PACKAGE_VERSION=${{ env.PACKAGE_VERSION }} make build
- name: Set package file names
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.PHONY: build test install

build:
make -C cpp clean
make -C py clean
make -C cpp build
make -C cpp clean && \
make -C py clean && \
make -C cpp build && \
make -C py build

install: build
make -C py install

test: install
make -C cpp test
make -C py test
make -C cpp test && \
make -C py test && \
make -C tests all

2 changes: 1 addition & 1 deletion cpp/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: build build_mock test

build:
bazel build streamer:libstreamer.so
bazel build streamer:libstreamer.so && \
bazel build --define USE_SYSTEM_LIBS=${USE_SYSTEM_LIBS} s3:libstreamers3.so

build_mock:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_runai_library(self):
for id, dst, offset in fs.get_chunks():
self.assertEqual(offset, id_to_results[id]["expected_offset"])
self.assertEqual(
dst[offset : offset + request_sizes[id]].decode("utf-8"),
dst[offset : offset + request_sizes[id]].tobytes().decode("utf-8"),
id_to_results[id]["expected_text"],
)

Expand Down Expand Up @@ -63,7 +63,7 @@ def test_min_memory_cap(self, mock_get_memory_mode):
for id, dst, offset in fs.get_chunks():
self.assertEqual(offset, id_to_results[id]["expected_offset"])
self.assertEqual(
dst[offset : offset + request_sizes[id]].decode("utf-8"),
dst[offset : offset + request_sizes[id]].tobytes().decode("utf-8"),
id_to_results[id]["expected_text"],
)

Expand Down Expand Up @@ -95,7 +95,7 @@ def test_limited_memory_cap(self, mock_get_memory_mode, mock_getenv):
for id, dst, offset in fs.get_chunks():
self.assertEqual(offset, id_to_results[id]["expected_offset"])
self.assertEqual(
dst[offset : offset + request_sizes[id]].decode("utf-8"),
dst[offset : offset + request_sizes[id]].tobytes().decode("utf-8"),
id_to_results[id]["expected_text"],
)

Expand Down
2 changes: 1 addition & 1 deletion tests/fuzzing/test_file_streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_file_streamer(self):
for id, dst, offset in fs.get_chunks():
self.assertEqual(offset, expected_id_to_results[id]["expected_offset"])
self.assertEqual(
dst[offset : offset + request_sizes[id]],
dst[offset : offset + request_sizes[id]].tobytes(),
expected_id_to_results[id]["expected_content"],
)

Expand Down

0 comments on commit 74af0b8

Please sign in to comment.