diff --git a/ci/ip-intelligence-performance.Tests.ps1 b/ci/ip-intelligence-performance.Tests.ps1 index 161e7c2d..5af2e038 100644 --- a/ci/ip-intelligence-performance.Tests.ps1 +++ b/ci/ip-intelligence-performance.Tests.ps1 @@ -93,14 +93,35 @@ It 'writes the summary the performance step reports' { & $script:Script -RepoName $script:Product -Name 'test' | Out-Null # common-ci compares results_.json, one file for each configuration, - # which also holds Device Detection's figures, so these carry the product. + # which also holds Device Detection's figures, so these are lookups, the + # names most languages graph IP Intelligence under. $folder = Join-Path $script:Product 'test-results' 'performance-summary' Get-ChildItem $folder | ForEach-Object Name | Should -Be 'results_test.json' $results = Get-Content (Join-Path $folder 'results_test.json') | ConvertFrom-Json - $results.HigherIsBetter.IpIntelligence_DetectionsPerSecond | Should -Be 1 - $results.LowerIsBetter.IpIntelligence_AvgMillisecsPerDetection | - Should -Be 1 + @($results.HigherIsBetter.PSObject.Properties.Name) | + Should -Be @('LookupsPerSecond') + @($results.LowerIsBetter.PSObject.Properties.Name) | + Should -Be @('AvgMillisecsPerLookup') + $results.HigherIsBetter.LookupsPerSecond | Should -Be 1 + $results.LowerIsBetter.AvgMillisecsPerLookup | Should -Be 1 +} + +It 'adds figures that Device Detection does not write' { + & $script:Script -RepoName $script:Product -Name 'test' | Out-Null + + # The root step merges this summary into Device Detection's and fails on + # a figure both write, so none of these may be a Device Detection name. + $deviceDetection = Join-Path $PSScriptRoot '..' 'device-detection' 'ci' ` + 'run-performance-tests.ps1' + $results = Get-Content (Join-Path $script:Product 'test-results' ` + 'performance-summary' 'results_test.json') | ConvertFrom-Json + $text = Get-Content -Raw $deviceDetection + foreach ($section in $results.HigherIsBetter, $results.LowerIsBetter) { + foreach ($name in $section.PSObject.Properties.Name) { + $text | Should -Not -Match "\b$name\b" + } + } } It 'fails rather than skipping when the free Lite file is absent' { diff --git a/ip-intelligence/ci/run-performance-tests.ps1 b/ip-intelligence/ci/run-performance-tests.ps1 index 45735340..e781818e 100644 --- a/ip-intelligence/ci/run-performance-tests.ps1 +++ b/ip-intelligence/ci/run-performance-tests.ps1 @@ -41,15 +41,17 @@ try { python fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/performance_console.py --data_file "$assets/$dataFileName" --evidence_file "$assets/$evidenceFileName" --json_output $pwd/summary.json || $(throw "performance tests failed with $LASTEXITCODE") # The root step puts every product's figures in the one summary of the - # configuration, and Device Detection measures the same things, so these - # carry the product's name. + # configuration, beside Device Detection's detections, so these are + # written as lookups. Those are the names most languages graph IP + # Intelligence under, so the graph is + # perf-graph--LookupsPerSecond-latest.png as theirs is. $Results = Get-Content $pwd/summary.json | ConvertFrom-Json @{ HigherIsBetter = @{ - IpIntelligence_DetectionsPerSecond = $Results.DetectionsPerSecond + LookupsPerSecond = $Results.DetectionsPerSecond }; LowerIsBetter = @{ - IpIntelligence_AvgMillisecsPerDetection = $Results.MsPerDetection + AvgMillisecsPerLookup = $Results.MsPerDetection } } | ConvertTo-Json | Out-File $perfSummary/results_$Name.json } finally {