init
This commit is contained in:
32
scripts/test_report.ps1
Normal file
32
scripts/test_report.ps1
Normal file
@ -0,0 +1,32 @@
|
||||
param([switch]$JsFeature)
|
||||
|
||||
$dir = "target/test-reports"
|
||||
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
||||
$docDir = "doc"
|
||||
New-Item -ItemType Directory -Force -Path $docDir | Out-Null
|
||||
|
||||
if ($JsFeature) {
|
||||
$featureArgs = "--features js"
|
||||
$header = "## JS feature"
|
||||
$outFile = "$docDir/performance-js.md"
|
||||
} else {
|
||||
$featureArgs = ""
|
||||
$header = "## Default features"
|
||||
$outFile = "$docDir/performance-default.md"
|
||||
}
|
||||
|
||||
$names = @('test_rhai_expr_set_and_get','test_conditional_node_then_else','test_http_node_with_mock','test_stateful_engine','test_db_and_mq_nodes','test_group_parallel_sleep','test_expr_set_without_engine_error')
|
||||
if ($JsFeature) { $names += 'test_js_expr_and_fork_join' }
|
||||
|
||||
$md = "# dsl-flow Test Performance`n`n$header`n"
|
||||
foreach ($n in $names) {
|
||||
if ($JsFeature) {
|
||||
$t = Measure-Command { & cargo test -p dsl-flow --features js -- --exact $n --nocapture --quiet }
|
||||
} else {
|
||||
$t = Measure-Command { & cargo test -p dsl-flow -- --exact $n --nocapture --quiet }
|
||||
}
|
||||
$sec = [math]::Round($t.TotalSeconds, 3)
|
||||
$md += ("- {0}: {1}s{2}" -f $n, $sec, [Environment]::NewLine)
|
||||
}
|
||||
|
||||
Set-Content -Path $outFile -Value $md
|
||||
Reference in New Issue
Block a user