Skip to content

Commit

Permalink
use default params for the arb prop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Feb 4, 2025
1 parent 8869811 commit 67d534f
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions test/property/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { execSync } from 'child_process';
import fc from 'fast-check';
import { existsSync, mkdirSync, writeFileSync } from 'fs';

import { defaultPropTestParams } from '../';
import { Canister } from './arbitraries/canister_arb';
import { clear as clearUniquePrimitiveArb } from './arbitraries/unique_primitive_arb';
import { runTests } from './test';
Expand All @@ -19,27 +20,17 @@ export async function runPropTests(
canisterArb: fc.Arbitrary<Canister>,
runTestsSeparately = false
): Promise<void> {
const defaultParams = {
const executionParams = {
...defaultPropTestParams(),
numRuns: runTestsSeparately
? 1
: Number(process.env.AZLE_PROPTEST_NUM_RUNS ?? 1),
endOnFailure: true // TODO This essentially disables shrinking. We don't know how to do shrinking well yet
: Number(process.env.AZLE_PROPTEST_NUM_RUNS ?? 1)
};
// TODO https://github.com/demergent-labs/azle/issues/1568
const numRuns = runTestsSeparately
? Number(process.env.AZLE_PROPTEST_NUM_RUNS ?? 1)
: 1;

const seed =
process.env.AZLE_PROPTEST_SEED !== undefined
? Number(process.env.AZLE_PROPTEST_SEED)
: undefined;

const path = process.env.AZLE_PROPTEST_PATH;

const executionParams =
seed !== undefined ? { ...defaultParams, seed, path } : defaultParams;

try {
for (let i = 0; i < numRuns; i++) {
await fc.assert(
Expand Down

0 comments on commit 67d534f

Please sign in to comment.