Change attribute to a Filter to disable test on CI

This commit is contained in:
SignalRT 2024-04-18 21:29:37 +02:00
parent 75cad1f3a5
commit e6b7141188
3 changed files with 3 additions and 25 deletions

View File

@ -45,7 +45,7 @@ jobs:
- name: Build
run: dotnet build LLamaSharp.sln -c ${{ matrix.config }} --no-restore
- name: Test
run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt
run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt --filter Category!=NoCI
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3

View File

@ -1,22 +0,0 @@
namespace LLama.Unittest;
/// <summary>
/// Extend Fact attributes to know if we are running on release or debug. The assumption is that on CI we run on Release
/// </summary>
public class IgnoreOnCiFact : FactAttribute
{
public IgnoreOnCiFact() {
if( IsRelease()) {
Skip = "Ignore on CI";
}
}
private static bool IsRelease()
{
#if DEBUG
return false;
#else
return true;
#endif
}
}

View File

@ -33,7 +33,7 @@ namespace LLama.Unittest
_lLavaWeights.Dispose();
}
[IgnoreOnCiFact]
[Fact,Trait("Category", "NoCI")]
public void EmbedImageAsFileName()
{
int n_past = 0;
@ -41,7 +41,7 @@ namespace LLama.Unittest
Assert.True( _lLavaWeights.EvalImageEmbed( _context, emb, ref n_past ) );
}
[IgnoreOnCiFact]
[Fact,Trait("Category", "NoCI")]
public void EmbedImageAsBinary()
{
int n_past = 0;