Skip to content

Commit

Permalink
exclude benchmarks from running in build
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Aug 21, 2024
1 parent aaa3d7e commit 5090ef1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
5.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
Expand All @@ -60,7 +59,7 @@ jobs:
run: dotnet build ${{ env.Solution_File }} --configuration ${{ env.Configuration }} --no-restore

- name: Test
run: dotnet test "${{ env.Test_Proj }}" --no-build --verbosity normal --results-directory ${{ github.workspace }}/_TestResults --logger "trx;logfilename=tests.trx"
run: dotnet test "${{ env.Test_Proj }}" --no-build --verbosity normal --results-directory ${{ github.workspace }}/_TestResults --logger "trx;logfilename=tests.trx" -filter Name\!~Benchmarks

- name: Upload test results
uses: actions/upload-artifact@v2 # upload test results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using Examine.Lucene.Search;
using Examine.Search;
using Lucene.Net.Analysis.Core;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers.Classic;
using Lucene.Net.QueryParsers.Flexible.Standard;
using Lucene.Net.QueryParsers.Flexible.Standard.Config;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Lucene.Net.Util;
Expand Down Expand Up @@ -247,12 +243,12 @@ public async Task LuceneSimple()
var topDocsCollector = TopScoreDocCollector.Create(MaxResults, null, true);

searcher.Search(query, topDocsCollector);
var topDocs = ((TopScoreDocCollector)topDocsCollector).GetTopDocs(0, MaxResults);
var topDocs = topDocsCollector.GetTopDocs(0, MaxResults);

var totalItemCount = topDocs.TotalHits;

var results = new List<ISearchResult>(topDocs.ScoreDocs.Length);
for (int i = 0; i < topDocs.ScoreDocs.Length; i++)
for (var i = 0; i < topDocs.ScoreDocs.Length; i++)
{
var scoreDoc = topDocs.ScoreDocs[i];
var docId = scoreDoc.Doc;
Expand All @@ -263,7 +259,7 @@ public async Task LuceneSimple()
results.Add(result);
}
var searchAfterOptions = LuceneSearchExecutor.GetSearchAfterOptions(topDocs);
float maxScore = topDocs.MaxScore;
var maxScore = topDocs.MaxScore;

// enumerate (forces the result to execute)
var logOutput = "ThreadID: " + Thread.CurrentThread.ManagedThreadId + ", Results: " + string.Join(',', results.Select(x => $"{x.Id}-{x.Values.Count}-{x.Score}").ToArray());
Expand Down

0 comments on commit 5090ef1

Please sign in to comment.