From 44121a7c9e7dddf63739c6bcbb696075fa798b59 Mon Sep 17 00:00:00 2001 From: cfaur09 Date: Mon, 3 Feb 2025 15:07:22 +0200 Subject: [PATCH 1/3] Add e2e tests for transactions filtering by isScCall parameter --- .../chain-simulator/transactions.cs-e2e.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/chain-simulator/transactions.cs-e2e.ts b/src/test/chain-simulator/transactions.cs-e2e.ts index 042f97ee0..9d96f2d72 100644 --- a/src/test/chain-simulator/transactions.cs-e2e.ts +++ b/src/test/chain-simulator/transactions.cs-e2e.ts @@ -208,6 +208,33 @@ describe('Transactions e2e tests with chain simulator', () => { } } }); + + it('should return transactions filtered by isScCall parameter', async () => { + const response = await axios.get(`${config.apiServiceUrl}/transactions?isScCall=true`); + expect(response.status).toBe(200); + + for (const transaction of response.data) { + expect(transaction.isScCall).toBe(true); + } + }); + + it('should return transactions without isScCall field when isScCall parameter is not provided', async () => { + const response = await axios.get(`${config.apiServiceUrl}/transactions`); + expect(response.status).toBe(200); + + for (const transaction of response.data) { + expect(transaction.isScCall).toBeUndefined(); + } + }); + + it('should return transactions without isScCall field when isScCall parameter is false', async () => { + const response = await axios.get(`${config.apiServiceUrl}/transactions?isScCall=false`); + expect(response.status).toBe(200); + + for (const transaction of response.data) { + expect(transaction.isScCall).toBeUndefined(); + } + }); }); describe('GET /transactions/count', () => { From 56337e2eb9a2e721631a2c35d9be0a40dafc88c4 Mon Sep 17 00:00:00 2001 From: cfaur09 Date: Mon, 3 Feb 2025 15:22:28 +0200 Subject: [PATCH 2/3] refactor isScCall undefined test --- src/test/chain-simulator/transactions.cs-e2e.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/chain-simulator/transactions.cs-e2e.ts b/src/test/chain-simulator/transactions.cs-e2e.ts index 9d96f2d72..620880805 100644 --- a/src/test/chain-simulator/transactions.cs-e2e.ts +++ b/src/test/chain-simulator/transactions.cs-e2e.ts @@ -218,13 +218,15 @@ describe('Transactions e2e tests with chain simulator', () => { } }); - it('should return transactions without isScCall field when isScCall parameter is not provided', async () => { + it('should handle isScCall field appropriately when isScCall parameter is not provided', async () => { const response = await axios.get(`${config.apiServiceUrl}/transactions`); expect(response.status).toBe(200); + expect(response.data.length).toBeGreaterThan(0); - for (const transaction of response.data) { - expect(transaction.isScCall).toBeUndefined(); - } + const hasScCalls = response.data.some((tx: { isScCall?: boolean }) => tx.isScCall === true); + const hasNonScCalls = response.data.some((tx: { isScCall?: boolean }) => tx.isScCall === false); + + expect(hasScCalls || hasNonScCalls).toBe(true); }); it('should return transactions without isScCall field when isScCall parameter is false', async () => { From a69f7da39bdc1d11b4c465932bfe5ca0a3393bbd Mon Sep 17 00:00:00 2001 From: cfaur09 Date: Mon, 3 Feb 2025 15:24:50 +0200 Subject: [PATCH 3/3] update load tests gh action --- .github/workflows/load-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/load-tests.yml b/.github/workflows/load-tests.yml index 5f14d7355..50568016a 100644 --- a/.github/workflows/load-tests.yml +++ b/.github/workflows/load-tests.yml @@ -58,7 +58,7 @@ jobs: run: k6 run ./k6/script.js - name: Upload result file for base branch - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: base-results path: k6/output/summary.json @@ -119,7 +119,7 @@ jobs: run: k6 run ./k6/script.js - name: Upload result file for head branch - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: head-results path: k6/output/summary.json @@ -135,7 +135,7 @@ jobs: - uses: actions/checkout@v2 - name: Download all artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: artifacts @@ -159,7 +159,7 @@ jobs: head: ${{ github.event.pull_request.head.sha }} - name: Upload the report markdown - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: github.event_name == 'pull_request' with: name: report-markdown