Skip to content

Commit

Permalink
streamline logging API (microsoft#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdeligia authored Oct 17, 2022
1 parent 4755418 commit 1c05bbd
Show file tree
Hide file tree
Showing 188 changed files with 6,495 additions and 4,371 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-coyote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ jobs:
./Samples/Scripts/build-tests.ps1 -local -nuget
shell: pwsh
- name: Test Coyote samples
run: dotnet ./Samples/Common/bin/net6.0/TestDriver.dll
run: ./Samples/Scripts/run-tests.ps1
shell: pwsh
25 changes: 0 additions & 25 deletions Samples/BoundedBuffer/BoundedBuffer.sln

This file was deleted.

2 changes: 1 addition & 1 deletion Samples/BoundedBuffer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Coyote.IO;
using Microsoft.Coyote.Logging;
using Microsoft.Coyote.Runtime;

namespace Microsoft.Coyote.Samples.BoundedBuffer
Expand Down
25 changes: 0 additions & 25 deletions Samples/CoffeeMachineActors/CoffeeMachineActors.sln

This file was deleted.

25 changes: 0 additions & 25 deletions Samples/CoffeeMachineTasks/CoffeeMachineTasks.sln

This file was deleted.

2 changes: 1 addition & 1 deletion Samples/Common/LogWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

using System;
using Microsoft.Coyote.IO;
using Microsoft.Coyote.Logging;

namespace Microsoft.Coyote.Samples.Common
{
Expand Down
25 changes: 0 additions & 25 deletions Samples/DrinksServingRobotActors/DrinksServingRobotActors.sln

This file was deleted.

25 changes: 0 additions & 25 deletions Samples/HelloWorldActors/HelloWorldActors.sln

This file was deleted.

25 changes: 0 additions & 25 deletions Samples/Monitors/Monitors.sln

This file was deleted.

14 changes: 7 additions & 7 deletions Samples/Scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ if ($null -eq $sdk_version) {
# Build the task-based samples.
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../AccountManager/AccountManager.sln" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../BoundedBuffer/BoundedBuffer.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../BoundedBuffer/BoundedBuffer.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../CoffeeMachineTasks/CoffeeMachineTasks.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../CoffeeMachineTasks/CoffeeMachineTasks.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent

# Build the actor samples.
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../HelloWorldActors/HelloWorldActors.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../HelloWorldActors/HelloWorldActors.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../CoffeeMachineActors/CoffeeMachineActors.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../CoffeeMachineActors/CoffeeMachineActors.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../DrinksServingRobotActors/DrinksServingRobotActors.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../DrinksServingRobotActors/DrinksServingRobotActors.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../CloudMessaging/CloudMessaging.sln" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../Timers/Timers.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../Timers/Timers.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../Monitors/Monitors.sln" `
Invoke-DotnetBuild -dotnet $dotnet -solution "$PSScriptRoot/../Monitors/Monitors.csproj" `
-config $configuration -local $local.IsPresent -nuget $nuget.IsPresent

# Build the web app samples.
Expand Down
20 changes: 20 additions & 0 deletions Samples/Scripts/run-tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
param(
[string]$dotnet="dotnet"
)

Import-Module $PSScriptRoot/../../Scripts/common.psm1 -Force
CheckPSVersion

Write-Comment -prefix "." -text "Testing the Coyote samples" -color "yellow"

$framework = "net6.0"
$tests = "$PSScriptRoot/../Common/bin/$framework/TestDriver.dll"
if (-not (Test-Path $tests)) {
Write-Error "tests for the Coyote samples not found."
exit
}

$error_msg = "Failed to test the Coyote samples"
Invoke-ToolCommand -tool $dotnet -cmd $tests -error_msg $error_msg

Write-Comment -prefix "." -text "Successfully tested the Coyote samples" -color "green"
25 changes: 0 additions & 25 deletions Samples/Timers/Timers.sln

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace ImageGallery.Store.Cosmos
/// </summary>
public class ClientProvider : IClientProvider, IDisposable
{
private bool IsDsposed = false;
private bool IsDisposed = false;

protected CosmosClient CosmosClient { get; }

Expand Down Expand Up @@ -47,7 +47,7 @@ public void Dispose()

protected virtual void Dispose(bool disposing)
{
if (this.IsDsposed)
if (this.IsDisposed)
{
return;
}
Expand All @@ -57,7 +57,7 @@ protected virtual void Dispose(bool disposing)
this.CosmosClient.Dispose();
}

this.IsDsposed = true;
this.IsDisposed = true;
}
}
}
7 changes: 4 additions & 3 deletions Scripts/common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ function Invoke-CoyoteTool([String]$cmd, [String]$dotnet, [String]$framework, [S
function Invoke-DotnetBuild([String]$dotnet, [String]$solution, [String]$config, [bool]$local, [bool]$nuget) {
Write-Comment -prefix "..." -text "Building $solution"

$nuget_config_file = "$PSScriptRoot/../NuGet.config"
$platform = "/p:Platform=`"Any CPU`""
$restore_command = "restore $solution"
$build_command = "build -c $config $solution --no-restore"
if ($local -and $nuget) {
$restore_command = "$restore_command --configfile $nuget_config_file $platform"
$nuget_config_file = "$PSScriptRoot/../NuGet.config"
$restore_command = "$restore_command --configfile $nuget_config_file /p:UseLocalNugetPackages=true $platform"
$build_command = "$build_command /p:UseLocalNugetPackages=true $platform"
} elseif ($local) {
$restore_command = "$restore_command --configfile $nuget_config_file $platform"
$nuget_config_file = "$PSScriptRoot/../Samples/NuGet.config"
$restore_command = "$restore_command --configfile $nuget_config_file /p:UseLocalCoyote=true $platform"
$build_command = "$build_command /p:UseLocalCoyote=true $platform"
}

Expand Down
Loading

0 comments on commit 1c05bbd

Please sign in to comment.