Browse Source

Create an Specific Fact attribute to disable some test on CI and execute that test on Debug

pull/672/head
SignalRT 2 years ago
parent
commit
bb5d7e189d
3 changed files with 24 additions and 3 deletions
  1. +0
    -1
      LLama.Unittest/BeamTests.cs
  2. +22
    -0
      LLama.Unittest/IgnoreOnCIFact.cs
  3. +2
    -2
      LLama.Unittest/LLavaWeightsTests.cs

+ 0
- 1
LLama.Unittest/BeamTests.cs View File

@@ -28,7 +28,6 @@ public sealed class BeamTests
_model.Dispose();
}

//[Fact(Skip = "Very very slow in CI")]
[Fact]
public void BasicBeam()
{


+ 22
- 0
LLama.Unittest/IgnoreOnCIFact.cs View File

@@ -0,0 +1,22 @@
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
}
}

+ 2
- 2
LLama.Unittest/LLavaWeightsTests.cs View File

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


Loading…
Cancel
Save