From 4843f21fe4dfe40a14cfae71e3f78226b89cd6ae Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Mon, 28 Oct 2024 14:04:44 -0600 Subject: [PATCH] update http tests to run benchmarks --- tests/end_to_end/http_server/apollo_server/test/test.ts | 5 +++-- tests/end_to_end/http_server/audio_and_video/test/test.ts | 5 +++-- tests/end_to_end/http_server/autoreload/test/test.ts | 5 +++-- tests/end_to_end/http_server/bitcoinjs_lib/test/test.ts | 5 +++-- tests/end_to_end/http_server/bitcore_lib/test/test.ts | 5 +++-- tests/end_to_end/http_server/ethers/test/test.ts | 5 +++-- tests/end_to_end/http_server/ethers_base/test/test.ts | 5 +++-- tests/end_to_end/http_server/express/test/test.ts | 5 +++-- tests/end_to_end/http_server/fetch_ic/test/test.ts | 4 +++- tests/end_to_end/http_server/file_protocol/test/test.ts | 5 +++-- tests/end_to_end/http_server/fs/test/test.ts | 5 +++-- .../end_to_end/http_server/http_outcall_fetch/test/test.ts | 5 +++-- tests/end_to_end/http_server/ic_evm_rpc/test/test.ts | 5 +++-- .../end_to_end/http_server/internet_identity/test/test.ts | 4 +++- tests/end_to_end/http_server/large_files/test/test.ts | 5 +++-- tests/end_to_end/http_server/nest/test/test.ts | 5 +++-- .../end_to_end/http_server/open_value_sharing/test/test.ts | 6 ++++-- tests/end_to_end/http_server/sqlite/test/test.ts | 5 +++-- tests/end_to_end/http_server/sqlite_drizzle/test/test.ts | 7 ++++--- tests/end_to_end/http_server/sqlite_typeorm/test/test.ts | 5 +++-- tests/end_to_end/http_server/tfjs/test/test.ts | 5 +++-- tests/end_to_end/http_server/web_assembly/test/test.ts | 5 +++-- 22 files changed, 68 insertions(+), 43 deletions(-) diff --git a/tests/end_to_end/http_server/apollo_server/test/test.ts b/tests/end_to_end/http_server/apollo_server/test/test.ts index c39221986e..a75088c499 100644 --- a/tests/end_to_end/http_server/apollo_server/test/test.ts +++ b/tests/end_to_end/http_server/apollo_server/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('apollo_server'); +const canisterName = 'apollo_server'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/audio_and_video/test/test.ts b/tests/end_to_end/http_server/audio_and_video/test/test.ts index bd945d95c7..3862bbc932 100644 --- a/tests/end_to_end/http_server/audio_and_video/test/test.ts +++ b/tests/end_to_end/http_server/audio_and_video/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('backend'); +const canisterName = 'backend'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/autoreload/test/test.ts b/tests/end_to_end/http_server/autoreload/test/test.ts index 3c54d7f29e..21aa4594e7 100644 --- a/tests/end_to_end/http_server/autoreload/test/test.ts +++ b/tests/end_to_end/http_server/autoreload/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('autoreload'); +const canisterName = 'autoreload'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/bitcoinjs_lib/test/test.ts b/tests/end_to_end/http_server/bitcoinjs_lib/test/test.ts index 6df2b5432c..c33432b203 100644 --- a/tests/end_to_end/http_server/bitcoinjs_lib/test/test.ts +++ b/tests/end_to_end/http_server/bitcoinjs_lib/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('bitcoinjs_lib'); +const canisterName = 'bitcoinjs_lib'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/bitcore_lib/test/test.ts b/tests/end_to_end/http_server/bitcore_lib/test/test.ts index 2eca2497a9..624de176fa 100644 --- a/tests/end_to_end/http_server/bitcore_lib/test/test.ts +++ b/tests/end_to_end/http_server/bitcore_lib/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('bitcore_lib'); +const canisterName = 'bitcore_lib'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/ethers/test/test.ts b/tests/end_to_end/http_server/ethers/test/test.ts index eeb3cf7726..d79925532d 100644 --- a/tests/end_to_end/http_server/ethers/test/test.ts +++ b/tests/end_to_end/http_server/ethers/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('ethers'); +const canisterName = 'ethers'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/ethers_base/test/test.ts b/tests/end_to_end/http_server/ethers_base/test/test.ts index 0a8b49527f..3a732d551e 100644 --- a/tests/end_to_end/http_server/ethers_base/test/test.ts +++ b/tests/end_to_end/http_server/ethers_base/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('server'); +const canisterName = 'server'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/express/test/test.ts b/tests/end_to_end/http_server/express/test/test.ts index f0f03fa3ed..158c722cbe 100644 --- a/tests/end_to_end/http_server/express/test/test.ts +++ b/tests/end_to_end/http_server/express/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('express'); +const canisterName = 'express'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/fetch_ic/test/test.ts b/tests/end_to_end/http_server/fetch_ic/test/test.ts index c26dcfa29a..52a8f7566d 100644 --- a/tests/end_to_end/http_server/fetch_ic/test/test.ts +++ b/tests/end_to_end/http_server/fetch_ic/test/test.ts @@ -2,4 +2,6 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -runTests(getTests('backend')); +const canisterName = 'backend'; + +runTests(getTests(canisterName), canisterName); diff --git a/tests/end_to_end/http_server/file_protocol/test/test.ts b/tests/end_to_end/http_server/file_protocol/test/test.ts index bd945d95c7..3862bbc932 100644 --- a/tests/end_to_end/http_server/file_protocol/test/test.ts +++ b/tests/end_to_end/http_server/file_protocol/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('backend'); +const canisterName = 'backend'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/fs/test/test.ts b/tests/end_to_end/http_server/fs/test/test.ts index c91d144342..d487891b80 100644 --- a/tests/end_to_end/http_server/fs/test/test.ts +++ b/tests/end_to_end/http_server/fs/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('fs'); +const canisterName = 'fs'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/http_outcall_fetch/test/test.ts b/tests/end_to_end/http_server/http_outcall_fetch/test/test.ts index 0a8b49527f..3a732d551e 100644 --- a/tests/end_to_end/http_server/http_outcall_fetch/test/test.ts +++ b/tests/end_to_end/http_server/http_outcall_fetch/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('server'); +const canisterName = 'server'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/ic_evm_rpc/test/test.ts b/tests/end_to_end/http_server/ic_evm_rpc/test/test.ts index 0a8b49527f..3a732d551e 100644 --- a/tests/end_to_end/http_server/ic_evm_rpc/test/test.ts +++ b/tests/end_to_end/http_server/ic_evm_rpc/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('server'); +const canisterName = 'server'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/internet_identity/test/test.ts b/tests/end_to_end/http_server/internet_identity/test/test.ts index c26dcfa29a..52a8f7566d 100644 --- a/tests/end_to_end/http_server/internet_identity/test/test.ts +++ b/tests/end_to_end/http_server/internet_identity/test/test.ts @@ -2,4 +2,6 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -runTests(getTests('backend')); +const canisterName = 'backend'; + +runTests(getTests(canisterName), canisterName); diff --git a/tests/end_to_end/http_server/large_files/test/test.ts b/tests/end_to_end/http_server/large_files/test/test.ts index bd945d95c7..3862bbc932 100644 --- a/tests/end_to_end/http_server/large_files/test/test.ts +++ b/tests/end_to_end/http_server/large_files/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('backend'); +const canisterName = 'backend'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/nest/test/test.ts b/tests/end_to_end/http_server/nest/test/test.ts index 519e141ad2..0cdf9444d9 100644 --- a/tests/end_to_end/http_server/nest/test/test.ts +++ b/tests/end_to_end/http_server/nest/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('api'); +const canisterName = 'api'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/open_value_sharing/test/test.ts b/tests/end_to_end/http_server/open_value_sharing/test/test.ts index 43b3a29f62..bd7a3c9de1 100644 --- a/tests/end_to_end/http_server/open_value_sharing/test/test.ts +++ b/tests/end_to_end/http_server/open_value_sharing/test/test.ts @@ -5,10 +5,12 @@ import { agent, consumerActor } from './consumer_actor'; import { createActor as createWalletActor } from './dfx_generated/wallet'; import { getTests } from './tests'; -const walletActor = createWalletActor(getCanisterId('wallet'), { +const canisterName = 'backend'; +const canisterId = getCanisterId(canisterName); +const walletActor = createWalletActor(canisterId, { agentOptions: { host: 'http://127.0.0.1:8000' } }); -runTests(getTests(consumerActor, walletActor, agent)); +runTests(getTests(consumerActor, walletActor, agent), canisterName); diff --git a/tests/end_to_end/http_server/sqlite/test/test.ts b/tests/end_to_end/http_server/sqlite/test/test.ts index 89fc73328b..7431d1d64e 100644 --- a/tests/end_to_end/http_server/sqlite/test/test.ts +++ b/tests/end_to_end/http_server/sqlite/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('sqlite'); +const canisterName = 'sqlite'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/sqlite_drizzle/test/test.ts b/tests/end_to_end/http_server/sqlite_drizzle/test/test.ts index 6e764d1823..f9772ada08 100644 --- a/tests/end_to_end/http_server/sqlite_drizzle/test/test.ts +++ b/tests/end_to_end/http_server/sqlite_drizzle/test/test.ts @@ -1,7 +1,8 @@ import { getCanisterId } from 'azle/dfx'; import { runTests } from 'azle/test'; -import { getTests } from 'sqlite_example/test/tests'; +import { getTests } from 'sqlite_drizzle/test/tests'; -const canisterId = getCanisterId('sqlite_drizzle'); +const canisterName = 'sqlite_drizzle'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/sqlite_typeorm/test/test.ts b/tests/end_to_end/http_server/sqlite_typeorm/test/test.ts index c6ddad17f5..04d8e37556 100644 --- a/tests/end_to_end/http_server/sqlite_typeorm/test/test.ts +++ b/tests/end_to_end/http_server/sqlite_typeorm/test/test.ts @@ -2,6 +2,7 @@ import { getCanisterId } from 'azle/dfx'; import { runTests } from 'azle/test'; import { getTests } from 'sqlite_example/test/tests'; -const canisterId = getCanisterId('sqlite_typeorm'); +const canisterName = 'sqlite_typeorm'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/tfjs/test/test.ts b/tests/end_to_end/http_server/tfjs/test/test.ts index 519e141ad2..0cdf9444d9 100644 --- a/tests/end_to_end/http_server/tfjs/test/test.ts +++ b/tests/end_to_end/http_server/tfjs/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('api'); +const canisterName = 'api'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName); diff --git a/tests/end_to_end/http_server/web_assembly/test/test.ts b/tests/end_to_end/http_server/web_assembly/test/test.ts index 23b8952a1e..5c0bd8020c 100644 --- a/tests/end_to_end/http_server/web_assembly/test/test.ts +++ b/tests/end_to_end/http_server/web_assembly/test/test.ts @@ -3,6 +3,7 @@ import { runTests } from 'azle/test'; import { getTests } from './tests'; -const canisterId = getCanisterId('web_assembly'); +const canisterName = 'web_assembly'; +const canisterId = getCanisterId(canisterName); -runTests(getTests(canisterId)); +runTests(getTests(canisterId), canisterName);