Skip to content

Commit

Permalink
RavenDB-22983 switched to automatic detection of compression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ppekrol authored and garayx committed Dec 15, 2024
1 parent 6c38efc commit 46a880e
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 181 deletions.
23 changes: 7 additions & 16 deletions test/FastTests/Server/Documents/DocCompression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static string RandomString(Random random, int length)
.Select(s => s[random.Next(s.Length)]).ToArray());
}

[LicenseRequiredFact]
[RavenFact(RavenTestCategory.Compression, LicenseRequired = true)]
public void Can_compact_from_no_compression_to_compressed()
{
var path = NewDataPath();
Expand All @@ -46,7 +46,6 @@ public void Can_compact_from_no_compression_to_compressed()
{
Path = path,
RunInMemory = false,
IgnoreDocumentCompression = true
});

store.Maintenance.Send(new CreateSampleDataOperation());
Expand Down Expand Up @@ -85,7 +84,7 @@ public void Can_compact_from_no_compression_to_compressed()
}
}

[LicenseRequiredFact]
[RavenFact(RavenTestCategory.Compression, LicenseRequired = true)]
public void Can_compact_from_compression_to_not_compressed()
{
var path = NewDataPath();
Expand All @@ -95,7 +94,6 @@ public void Can_compact_from_compression_to_not_compressed()
{
Path = path,
RunInMemory = false,
IgnoreDocumentCompression = true,
ModifyDatabaseRecord = r => r.DocumentsCompression = new DocumentsCompressionConfiguration(true, "Orders")
});

Expand Down Expand Up @@ -135,7 +133,7 @@ public void Can_compact_from_compression_to_not_compressed()
}
}

[LicenseRequiredFact]
[RavenFact(RavenTestCategory.Compression, LicenseRequired = true)]
public void Can_compact_db_with_compressed_collections()
{
var path = NewDataPath();
Expand All @@ -146,7 +144,6 @@ public void Can_compact_db_with_compressed_collections()
Path = path,
RunInMemory = false,
ModifyDatabaseRecord = record => record.DocumentsCompression = new DocumentsCompressionConfiguration(true, "Orders"),
IgnoreDocumentCompression = true,
});

store.Maintenance.Send(new CreateSampleDataOperation());
Expand Down Expand Up @@ -176,14 +173,13 @@ public void Can_compact_db_with_compressed_collections()
operation.WaitForCompletion(TimeSpan.FromMinutes(5));
}

[LicenseRequiredFact]
[RavenFact(RavenTestCategory.Compression, LicenseRequired = true)]
public void Can_write_many_documents_without_breakage()
{
var random = new Random(654);
using var store = GetDocumentStore(new Options
{
ModifyDatabaseRecord = record => record.DocumentsCompression = new DocumentsCompressionConfiguration(true, "Users"),
IgnoreDocumentCompression = true,
});

var rnd = Enumerable.Range(1, 10)
Expand All @@ -205,10 +201,7 @@ public void Can_write_many_documents_without_breakage()
public void Can_set_collection_compressed_when_it_has_docs()
{
var random = new Random(343);
using var store = GetDocumentStore(new Options()
{
IgnoreDocumentCompression = true
});
using var store = GetDocumentStore();

var rnd = Enumerable.Range(1, 10)
.Select(i => new string((char)(65 + i), 256))
Expand Down Expand Up @@ -256,14 +249,13 @@ public void Can_set_collection_compressed_when_it_has_docs()
Assert.True(cmd.Result.ActualSize > cmd.Result.AllocatedSize);
}

[LicenseRequiredFact]
[RavenFact(RavenTestCategory.Compression, LicenseRequired = true)]
public void Can_update_many_documents_without_breakage()
{
var random = new Random(654);
using var store = GetDocumentStore(new Options
{
ModifyDatabaseRecord = record => record.DocumentsCompression = new DocumentsCompressionConfiguration(true, "Users"),
IgnoreDocumentCompression = true,
});

var rnd = Enumerable.Range(1, 10)
Expand Down Expand Up @@ -301,14 +293,13 @@ public void Can_update_many_documents_without_breakage()
}
}

[LicenseRequiredFact]
[RavenFact(RavenTestCategory.Compression, LicenseRequired = true)]
public void Can_update_many_documents_without_breakage_to_be_smaller()
{
var random = new Random(654);
using var store = GetDocumentStore(new Options
{
ModifyDatabaseRecord = record => record.DocumentsCompression = new DocumentsCompressionConfiguration(true, "Users"),
IgnoreDocumentCompression = true,
});

var rnd = Enumerable.Range(1, 10)
Expand Down
3 changes: 1 addition & 2 deletions test/SlowTests/Issues/RavenDB-15754.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ public async Task CanIndexReferencedCompressedDocumentsAndParentDocumentChange()
ModifyDatabaseRecord = x =>
{
x.DocumentsCompression = new DocumentsCompressionConfiguration(compressRevisions: false, compressAllCollections: true);
},
IgnoreDocumentCompression = true
}
}))
{
var company = new Company
Expand Down
Loading

0 comments on commit 46a880e

Please sign in to comment.