Skip to content

Commit

Permalink
Add accidentally removed testSuite.js
Browse files Browse the repository at this point in the history
  • Loading branch information
allansson committed Jul 1, 2024
1 parent 8a22ff1 commit 2c67cc2
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions tests/testSuite.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { Rate } from 'k6/metrics'

import { papaparseTest } from './papaparseRedingFile.js'
import { httpxBatchTest, httpxTestAbsoluteURLs } from './httpx.js'
import { newAjv } from './ajv-test.js'
import { CrocFlow } from './crocFlow.js'
import { URLWebAPI } from './url.js'
import { testAWS } from './aws.js'
import {
testJsonPath,
testFormurlencoded,
testPapaparse,
testFindBetween,
testNormalDistributionStages,
testRandomBetween,
testRandomItem,
testRandomString,
testuuidv4,
testKahwah,
testGetCurrentStageIndex,
testTagWithCurrentStageIndex,
testTagWithCurrentStageProfile,
testk6chaijs,
testk6chaijscontracts,
} from './basic.js'

let testCasesOK = new Rate('test_case_ok')

const testCases = [
URLWebAPI,
testJsonPath,
testFormurlencoded,
testPapaparse,
testRandomBetween,
testRandomItem,
testuuidv4,
testGetCurrentStageIndex,
testTagWithCurrentStageIndex,
testTagWithCurrentStageProfile,
papaparseTest,
httpxBatchTest,
newAjv,
CrocFlow,
testKahwah,
httpxTestAbsoluteURLs,
testk6chaijs,
testk6chaijscontracts,
testFindBetween,
testNormalDistributionStages,
testRandomString,
testAWS,
]

export const options = {
vus: 1,
iterations: testCases.length,
thresholds: {
checks: ['rate==1.0'],
test_case_ok: ['rate==1.0'],
},
}

export default function () {
try {
testCases[__ITER]()
testCasesOK.add(true)
} catch (e) {
testCasesOK.add(false)
console.log(`test case at index ${__ITER} has failed`)
throw e
}
}

0 comments on commit 2c67cc2

Please sign in to comment.