From e406cf08a817f1ceb88d1565019c6491c569d9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Liu?= Date: Mon, 8 Jul 2024 10:56:11 -0400 Subject: [PATCH] [integration] - fixed ts number display, made test run even if previous ones fail, changed test to use both py and ts delete --- .github/workflows/test.integration.yaml | 6 +++++- integration/py/read.py | 4 ++-- integration/py/stream.py | 4 ++-- integration/py/write.py | 2 +- integration/tests/ws-d-r-small.json | 8 +------- integration/tests/ws-d-r.json | 2 +- integration/ts/src/read.ts | 9 ++++++--- integration/ts/src/stream.ts | 10 +++++++--- integration/ts/src/write.ts | 12 ++++++++---- 9 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.integration.yaml b/.github/workflows/test.integration.yaml index d51391319f..81ac7b5afa 100644 --- a/.github/workflows/test.integration.yaml +++ b/.github/workflows/test.integration.yaml @@ -17,7 +17,7 @@ permissions: packages: write jobs: - test-integration-ubuntu-mini: + test-integration-ubuntu: runs-on: "Ubuntu" timeout-minutes: 1440 steps: @@ -61,11 +61,13 @@ jobs: if: steps.filter.outputs.changed == 'true' run: ./run-integration.sh tests/ws-d-r.json working-directory: ./integration + continue-on-error: true - name: Benchmark test if: steps.filter.outputs.changd == 'true' run: ./run-integration.sh tests/benchmark-test.json working-directory: ./integration + continue-on-error: true test-integration-windows: runs-on: "Windows" @@ -107,9 +109,11 @@ jobs: shell: powershell run: ./run-integration.ps1 tests/ws-d-r-mini.json working-directory: ./integration + continue-on-error: true - name: Benchmark Test if: steps.filter.outputs.changed == 'true' shell: powershell run: ./run-integration.ps1 tests/benchmark-test-small.json working-directory: ./integration + continue-on-error: true diff --git a/integration/py/read.py b/integration/py/read.py index 5b8cd44c93..5c9b35e5f6 100644 --- a/integration/py/read.py +++ b/integration/py/read.py @@ -110,14 +110,14 @@ def generate_test_report( else "FAIL!!" ) assertion_result = ( - f"""Expected samples: {self._tc.samples_expected}; Actual samples: {samples}\n{assertion_passed}""" + f"""Expected samples: {self._tc.samples_expected:,.2f}; Actual samples: {samples:,.2f}\n{assertion_passed}""" if self._tc.samples_expected != 0 else "" ) s = f""" -- Python Read ({self._tc.identifier})-- -Samples read: {samples} +Samples read: {samples:,.2f} Time taken: {time} Calculated Samples per Second: {samples_per_second:,.2f} Configuration: diff --git a/integration/py/stream.py b/integration/py/stream.py index d33c92d930..5cc2d756c0 100644 --- a/integration/py/stream.py +++ b/integration/py/stream.py @@ -76,13 +76,13 @@ def test_with_timing(self): ''' s = f''' -- Python Stream ({self._tc.identifier})-- -Samples streamed: {samples} +Samples streamed: {samples:,.2f} Time taken: {time} Calculated Samples per Second: {samples_per_second:,.2f} Configuration: \tNumber of streamers: 1 \tNumber of channels: {len(self._tc.channels)} -\tSamples expected: {self._tc.samples_expected} +\tSamples expected: {self._tc.samples_expected:,.2f} {err_assertion} ''' diff --git a/integration/py/write.py b/integration/py/write.py index 8fa2c6225d..1c957bb16d 100644 --- a/integration/py/write.py +++ b/integration/py/write.py @@ -134,7 +134,7 @@ def generate_test_report(self, time: sy.TimeSpan, err_assertion: str) -> str: samples_per_second = samples / (float(time) / float(sy.TimeSpan.SECOND)) s = f''' -- Python Write ({self._tc.identifier}) -- -Samples written: {samples} +Samples written: {samples:,.0f} Time taken: {time} Calculated Samples per Second: {samples_per_second:,.2f} Configuration: diff --git a/integration/tests/ws-d-r-small.json b/integration/tests/ws-d-r-small.json index 0f3523c64f..297e487c9e 100644 --- a/integration/tests/ws-d-r-small.json +++ b/integration/tests/ws-d-r-small.json @@ -220,7 +220,6 @@ { "op": "stream", "client": "ts", - "starts_after": [], "params": { "channels": [ "int0", @@ -237,7 +236,6 @@ { "op": "stream", "client": "py", - "starts_after": [], "params": { "channels": [ "int1", @@ -253,8 +251,7 @@ [ { "op": "delete", - "client": "py", - "starts_after": [], + "client": "ts", "params": { "time_range": { "start": 100000000000000, @@ -299,7 +296,6 @@ { "op": "delete", "client": "py", - "starts_after": [], "params": { "time_range": { "start": 100000000000000, @@ -340,7 +336,6 @@ { "op": "read", "client": "py", - "starts_after": [], "params": { "num_iterators": 5, "channel_groups": [ @@ -384,7 +379,6 @@ { "op": "read", "client": "ts", - "starts_after": [], "params": { "num_iterators": 5, "channel_groups": [ diff --git a/integration/tests/ws-d-r.json b/integration/tests/ws-d-r.json index 1f7f424cd6..4429a74309 100644 --- a/integration/tests/ws-d-r.json +++ b/integration/tests/ws-d-r.json @@ -298,7 +298,7 @@ }, { "op": "delete", - "client": "py", + "client": "ts", "starts_after": [], "params": { "time_range": { diff --git a/integration/ts/src/read.ts b/integration/ts/src/read.ts index 9fea65f41e..af640bbb8f 100644 --- a/integration/ts/src/read.ts +++ b/integration/ts/src/read.ts @@ -106,12 +106,12 @@ class ReadTest { const time: TimeSpan = start.span(end); const samplesPerSecond = samples / (Number(time) / Number(TimeSpan.SECOND)); const assertionPassed = this.tc.samplesExpected == 0 || approxEqual(samples, this.tc.samplesExpected); - const assertionResult = `Expected samples: ${this.tc.samplesExpected}; Actual samples: ${samples}`; + const assertionResult = `Expected samples: ${formatNumber(this.tc.samplesExpected)}; Actual samples: ${formatNumber(samples)}`; const s = ` -- TypeScript Read (${this.tc.identifier}) -- -Samples read: ${samples} +Samples read: ${formatNumber(samples)} Time taken: ${time} -Calculated Samples per Second: ${samplesPerSecond.toFixed(2)} +Calculated Samples per Second: ${formatNumber(samplesPerSecond)} Configuration: \tNumber of iterators: ${this.tc.numIterators} \tNumber of channels: ${this.tc.numChannels()} @@ -152,6 +152,9 @@ Expected error: ${this.tc.expectedError}; Actual error: ${actualError}\n${errorA } } +function formatNumber(x: number): string { + return x.toFixed(2).toString().replace(/\B(? { try { await new WriteTest(process.argv).testWithTiming()