Skip to content

Commit

Permalink
C#: Fail CI on warnings. (valkey-io#904)
Browse files Browse the repository at this point in the history
* C#: Fail CI on warnings.

* Fix found warnings.
  • Loading branch information
nihohit authored Feb 6, 2024
1 parent 3a3c436 commit c95b13e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- name: Test
working-directory: ./csharp
run: dotnet test --framework net6.0
run: dotnet test --framework net6.0 /warnaserror

- uses: ./.github/workflows/test-benchmark
with:
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/csharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CommandLineOptions
public int dataSize { get; set; } = 100;

[Option('c', "concurrentTasks", Required = false, HelpText = "The number of concurrent operations to perform.", Default = new[] { 1, 10, 100, 1000 })]
public IEnumerable<int> concurrentTasks { get; set; }
public IEnumerable<int> concurrentTasks { get; set; } = Enumerable.Empty<int>();

[Option('l', "clients", Required = false, HelpText = "Which clients should run")]
public string clientsToRun { get; set; } = "all";
Expand All @@ -32,7 +32,7 @@ public class CommandLineOptions
public string host { get; set; } = "localhost";

[Option('C', "clientCount", Required = false, HelpText = "Number of clients to run concurrently", Default = new[] { 1 })]
public IEnumerable<int> clientCount { get; set; }
public IEnumerable<int> clientCount { get; set; } = Enumerable.Empty<int>();

[Option('t', "tls", HelpText = "Should benchmark a TLS server")]
public bool tls { get; set; } = false;
Expand Down Expand Up @@ -337,7 +337,7 @@ private static int number_of_iterations(int num_of_concurrent_tasks)

public static async Task Main(string[] args)
{
CommandLineOptions options = new ();
CommandLineOptions options = new();
Parser.Default
.ParseArguments<CommandLineOptions>(args).WithParsed<CommandLineOptions>(parsed => { options = parsed; });

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/install_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function runNodeBenchmark(){
function runCSharpBenchmark(){
cd ${BENCH_FOLDER}/csharp
dotnet clean
dotnet build --configuration Release
dotnet build --configuration Release /warnaserror
dotnet run --framework net6.0 --configuration Release --resultsFile=../$1 --dataSize $2 --concurrentTasks $concurrentTasks --clients $chosenClients --host $host --clientCount $clientCount $tlsFlag $portFlag $minimalFlag
}

Expand Down

0 comments on commit c95b13e

Please sign in to comment.