Skip to content

Commit

Permalink
Dispose LiteDb storage in IntegrationTest (close #112)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Boocock committed Jul 4, 2021
1 parent 3a2d826 commit ed378ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ FakesAssemblies/
.vs/

integration_test.db
integration_test-journal.db
integration_test-log.db

snowplow-demo-app.db
snowplow-demo-app-journal.db
snowplow-demo-app-log.db

project.lock.json
9 changes: 2 additions & 7 deletions Snowplow.Tracker.Tests/IntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ public class IntegrationTest
{

private Tracker tracker = Tracker.Instance;

private const string _testDbFilename = @"integration_test.db";
private const string _testDbJournalFilename = @"integration_test-journal.db";

// --- Mocks

Expand Down Expand Up @@ -585,6 +583,8 @@ public void testTracker()
tracker.Stop();

Assert.IsFalse(tracker.Started);

storage.Dispose();
}

[TestInitialize]
Expand All @@ -594,11 +594,6 @@ public void cleanupDb()
{
File.Delete(_testDbFilename);
}

if (File.Exists(_testDbJournalFilename))
{
File.Delete(_testDbJournalFilename);
}
}

[TestCleanup]
Expand Down
6 changes: 3 additions & 3 deletions Snowplow.Tracker.Tests/LoadTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class LoadTest
private const string _collectorHostUri = @"snowplow-snowplow-pmz0wkw27skf-1566534576.eu-west-1.elb.amazonaws.com";

private const string _testDbFilename = @"load_test.db";
private const string _testDbJournalFilename = @"load_test-journal.db";
private const string _testDbLogFilename = @"load_test-log.db";
private const string _testClientSessionFilename = @"load_test-session.xml";

// --- Tests
Expand Down Expand Up @@ -121,9 +121,9 @@ public void cleanupDb()
File.Delete(_testDbFilename);
}

if (File.Exists(_testDbJournalFilename))
if (File.Exists(_testDbLogFilename))
{
File.Delete(_testDbJournalFilename);
File.Delete(_testDbLogFilename);
}

if (File.Exists(_testClientSessionFilename))
Expand Down

0 comments on commit ed378ea

Please sign in to comment.