Skip to content

Commit

Permalink
ignore almost all
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed Apr 23, 2024
1 parent 93f719f commit 33beae1
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 151 deletions.
25 changes: 13 additions & 12 deletions Snowflake.Data.Tests/IntegrationTests/EasyLoggingIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Snowflake.Data.Tests.IntegrationTests
{
[TestFixture, NonParallelizable]
[Ignore("debugging")] // !!!
public class EasyLoggingIT: SFBaseTest
{
private static readonly string s_workingDirectory = Path.Combine(Path.GetTempPath(), "easy_logging_test_configs_", Path.GetRandomFileName());
Expand All @@ -24,7 +25,7 @@ public static void BeforeAll()
Directory.CreateDirectory(s_workingDirectory);
}
}

[OneTimeTearDown]
public static void AfterAll()
{
Expand All @@ -36,7 +37,7 @@ public static void AfterEach()
{
EasyLoggingStarter.Instance.Reset(EasyLoggingLogLevel.Warn);
}

[Test]
public void TestEnableEasyLogging()
{
Expand All @@ -48,7 +49,7 @@ public void TestEnableEasyLogging()

// act
conn.Open();

// assert
Assert.IsTrue(EasyLoggerManager.HasEasyLoggingAppender());
}
Expand All @@ -65,31 +66,31 @@ public void TestFailToEnableEasyLoggingForWrongConfiguration()

// act
var thrown = Assert.Throws<SnowflakeDbException>(() => conn.Open());

// assert
Assert.That(thrown.Message, Does.Contain("Connection string is invalid: Unable to connect"));
Assert.IsFalse(EasyLoggerManager.HasEasyLoggingAppender());
}
}

[Test]
public void TestFailToEnableEasyLoggingWhenConfigHasWrongPermissions()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Assert.Ignore("skip test on Windows");
}

// arrange
var configFilePath = CreateConfigTempFile(s_workingDirectory, Config("WARN", s_workingDirectory));
Syscall.chmod(configFilePath, FilePermissions.S_IRUSR | FilePermissions.S_IWUSR | FilePermissions.S_IWGRP);
using (IDbConnection conn = new SnowflakeDbConnection())
{
conn.ConnectionString = ConnectionString + $"CLIENT_CONFIG_FILE={configFilePath}";

// act
var thrown = Assert.Throws<SnowflakeDbException>(() => conn.Open());

// assert
Assert.That(thrown.Message, Does.Contain("Connection string is invalid: Unable to connect"));
Assert.IsFalse(EasyLoggerManager.HasEasyLoggingAppender());
Expand All @@ -103,16 +104,16 @@ public void TestFailToEnableEasyLoggingWhenLogDirectoryNotAccessible()
{
Assert.Ignore("skip test on Windows");
}

// arrange
var configFilePath = CreateConfigTempFile(s_workingDirectory, Config("WARN", "/"));
using (IDbConnection conn = new SnowflakeDbConnection())
{
conn.ConnectionString = ConnectionString + $"CLIENT_CONFIG_FILE={configFilePath}";

// act
var thrown = Assert.Throws<SnowflakeDbException>(() => conn.Open());

// assert
Assert.That(thrown.Message, Does.Contain("Connection string is invalid: Unable to connect"));
Assert.That(thrown.InnerException.Message, Does.Contain("Failed to create logs directory"));
Expand All @@ -121,4 +122,4 @@ public void TestFailToEnableEasyLoggingWhenLogDirectoryNotAccessible()

}
}
}
}
1 change: 1 addition & 0 deletions Snowflake.Data.Tests/IntegrationTests/MaxLobSizeIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Snowflake.Data.Tests.IntegrationTests
[TestFixture(ResultFormat.ARROW)]
[TestFixture(ResultFormat.JSON)]
[Parallelizable(ParallelScope.Children)]
[Ignore("debugging")] // !!!
class MaxLobSizeIT : SFBaseTest
{
private readonly ResultFormat _resultFormat;
Expand Down
Loading

0 comments on commit 33beae1

Please sign in to comment.