Skip to content

Commit

Permalink
Adding some tests for Arabic characters (have not ran these yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
travjenkins authored and psFried committed Aug 9, 2024
1 parent d0ba54e commit 27e7d73
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client/test/journal_client_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ snapshotTest("JournalClient.read content test", async ({ assertSnapshot }) => {
assertSnapshot(filtered_results, masks);
});

snapshotTest("JournalClient.read Arabic content test", async ({ assertSnapshot }) => {
const client = new JournalClient(BASE_URL, await makeJwt({}));

const req = {
journal: "acmeCo/arabic-greetings/pivot=00",
offset: "10",
endOffset: "1024",
};
const stream = (await client.read(req)).unwrap();
const docStream = parseJournalDocuments(stream!);
const results = await readStreamToEnd(docStream);

let filtered_results = results.filter(r=>!(r._meta as any).ack).slice(0,5)

const masks = ["/*/_meta/uuid", "/*/ts"];
assertSnapshot(filtered_results, masks);
});

Deno.test("JournalClient.read unauthorized prefix", async () => {
const client = new JournalClient(BASE_URL, await makeJwt({}));

Expand Down
7 changes: 7 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export GATEWAY_PORT=28318

export BUILD_ID=test-build-id
export CATALOG_SOURCE="test/acmeCo/source-hello-world.flow.yaml"
export CATALOG_SOURCE_ARABIC="test/acmeCo/arabic-source-hello-world.flow.yaml"

# This is needed in order for docker run commands to work on ARM macs.
export DOCKER_DEFAULT_PLATFORM="linux/amd64"
Expand Down Expand Up @@ -117,6 +118,12 @@ ${FLOW_BIN} api build \
--build-id=${BUILD_ID} \
--source=${CATALOG_SOURCE} || bail "Build failed."

# Build the catalog for some minor multi language testing
${FLOW_BIN} api build \
--build-db=${TESTDIR}/builds/${BUILD_ID} \
--build-id=${BUILD_ID} \
--source=${CATALOG_SOURCE_ARABIC} || bail "Build failed."

log "Build finished"

# Activate the catalog.
Expand Down
20 changes: 20 additions & 0 deletions test/acmeCo/arabic-source-hello-world.flow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
storageMappings:
"":
stores:
- provider: GCS
bucket: example
collections:
acmeCo/arabic-greetings:
schema: greetings.schema.yaml
key: [/ts]
captures:
acmeCo/arabic-source-hello-world:
endpoint:
connector:
image: ghcr.io/estuary/source-hello-world:dev
config: source-hello-world.config.yaml
bindings:
- resource:
name: greetings
prefix: 'مرحبا #{}'
target: acmeCo/arabic-greetings

0 comments on commit 27e7d73

Please sign in to comment.