Skip to content

Commit

Permalink
Merge pull request #2257 from demergent-labs/battle_testing
Browse files Browse the repository at this point in the history
Make benchmarks work again
  • Loading branch information
lastmjs authored Nov 1, 2024
2 parents c788c8c + 24938a9 commit 67e8fab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
7 changes: 1 addition & 6 deletions src/build/experimental/commands/compile/get_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ export async function getContext(
...stableContext.wasmData,
consumer,
managementDid,
recordBenchmarks:
process.env.npm_lifecycle_event === 'pre_tests' ||
process.env.npm_lifecycle_event === 'pretest' ||
process.env.npm_lifecycle_event === 'test'
? process.env.AZLE_RECORD_BENCHMARKS !== 'false'
: process.env.AZLE_RECORD_BENCHMARKS === 'true'
recordBenchmarks: process.env.AZLE_RECORD_BENCHMARKS === 'true'
};

return {
Expand Down
7 changes: 1 addition & 6 deletions src/build/stable/commands/compile/get_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ export function getContext(
const wasmData: WasmData = {
envVars,
mainJsPath: join(canisterPath, `main.js`),
recordBenchmarks:
process.env.npm_lifecycle_event === 'pre_tests' ||
process.env.npm_lifecycle_event === 'pretest' ||
process.env.npm_lifecycle_event === 'test'
? process.env.AZLE_RECORD_BENCHMARKS !== 'false'
: process.env.AZLE_RECORD_BENCHMARKS === 'true'
recordBenchmarks: process.env.AZLE_RECORD_BENCHMARKS === 'true'
};

return {
Expand Down
2 changes: 1 addition & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function processEnvVars(): {
} {
const runTests = process.env.AZLE_RUN_TESTS ?? 'true';
const runTypeChecks = process.env.AZLE_RUN_TYPE_CHECKS ?? 'true';
const recordBenchmarks = process.env.AZLE_RECORD_BENCHMARKS ?? 'true';
const recordBenchmarks = process.env.AZLE_RECORD_BENCHMARKS ?? 'false';

const hasOnly = [runTests, runTypeChecks].includes('only');

Expand Down

0 comments on commit 67e8fab

Please sign in to comment.