Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/github-actions-tests-on-windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Tests on Windows

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
Expand All @@ -17,7 +23,25 @@ jobs:
run: dotnet clean
- name: Install dependencies
run: dotnet restore
- name: Setup Chrome
if: github.event_name == 'pull_request'
uses: browser-actions/setup-chrome@latest
- name: Build
run: dotnet build --configuration Debug --no-restore
- name: Test
run: dotnet test --no-build --no-restore --verbosity normal --filter Category=CI
if: github.event_name == 'pull_request'
id: test
continue-on-error: true
run: |
dotnet test --no-build --no-restore --verbosity normal --filter "Category=CI&FullyQualifiedName!~Mobile&FullyQualifiedName!~Desktop" --logger "trx;LogFileName=test-results.trx"
- name: Publish Test Results
if: github.event_name == 'pull_request' && always()
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
files: '**/test-results.trx'
check_name: 'Test Results'
- name: Check Test Results
if: github.event_name == 'pull_request' && steps.test.outcome == 'failure'
run: |
echo "::warning::Tests failed"
exit 1
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# macOS
.DS_Store

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -131,6 +134,10 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JetBrains Rider
.idea/
*.sln.iml

# TeamCity is a build add-in
_TeamCity*

Expand Down
72 changes: 72 additions & 0 deletions BELLATRIX Dependencies License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Reference | Version | License Type | License
---------------------------------------------------------|-----------------------|---------------------|-----------------------------------------------------------------------------------------------
Allure.Commons | 3.5.0.73 | | https://www.nuget.org/packages/Allure.Net.Commons/2.14.1/License
AngleSharp | 1.4.0 | MIT | https://licenses.nuget.org/MIT
AngleSharp.XPath | 2.0.5 | MIT | https://licenses.nuget.org/MIT
Appium.WebDriver | 8.0.1 | LICENSE.txt | https://www.nuget.org/packages/Appium.WebDriver/8.0.1/License
AutoFixture | 4.18.1 | MIT | https://licenses.nuget.org/MIT
AWSSDK.Core | 4.0.3.8 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
AWSSDK.Rekognition | 4.0.3.10 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
AWSSDK.S3 | 4.0.17 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
AWSSDK.SecretsManager | 4.0.4.3 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
Azure.AI.FormRecognizer | 4.1.0 | MIT | https://licenses.nuget.org/MIT
Azure.Identity | 1.17.1 | MIT | https://licenses.nuget.org/MIT
Azure.Security.KeyVault.Secrets | 4.8.0 | MIT | https://licenses.nuget.org/MIT
Azure.Storage.Blobs | 12.26.0 | MIT | https://licenses.nuget.org/MIT
Bellatrix.API.DemoApps | 1.4.1 | | https://bellatrix.solutions/standard-end-user-license-agreement/
Bellatrix.Desktop.DemoApps | 1.3.1 | | https://bellatrix.solutions/standard-end-user-license-agreement/
Bellatrix.ImageRecognition.SikuliX | 1.1.3 | | https://bellatrix.solutions/standard-end-user-license-agreement/
Bellatrix.Mobile.DemoApps | 1.3.0 | | https://bellatrix.solutions/standard-end-user-license-agreement/
coverlet.collector | 6.0.4 | MIT | https://licenses.nuget.org/MIT
CsvHelper | 33.1.0 | MS-PL OR Apache-2.0 | https://licenses.nuget.org/MS-PL%20OR%20Apache-2.0
CsvHelper.Excel.Core | 27.2.1 | | https://github.com/youngcm2/CsvHelper.Excel/blob/master/LICENSE
HtmlAgilityPack | 1.12.4 | MIT | https://licenses.nuget.org/MIT
JsonSchema.Net | 9.1.0 | OSMFEULA.txt | https://www.nuget.org/packages/JsonSchema.Net/9.1.0/License
mailslurp | 17.0.0 | |
Mapster | 10.0.0-pre01 | |
Microsoft.ApplicationInsights | 2.23.0 | MIT | https://licenses.nuget.org/MIT
Microsoft.Azure.CognitiveServices.Vision.ComputerVision | 7.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.EntityFrameworkCore | 10.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.Extensions.Configuration | 10.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.Extensions.Configuration.Binder | 10.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.Extensions.Configuration.EnvironmentVariables | 10.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.Extensions.Configuration.Json | 10.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.KernelMemory | 0.98.250508.3+bd8d34e | MIT | https://licenses.nuget.org/MIT
Microsoft.NET.Test.Sdk | 18.0.1 | MIT | https://licenses.nuget.org/MIT
Microsoft.Playwright | 1.57.0 | MIT | https://licenses.nuget.org/MIT
Microsoft.Playwright.NUnit | 1.57.0 | MIT | https://licenses.nuget.org/MIT
Microsoft.SemanticKernel | 1.70.0 | MIT | https://licenses.nuget.org/MIT
Microsoft.TeamFoundationServer.Client | 19.225.1 | license.txt | https://www.nuget.org/packages/Microsoft.TeamFoundationServer.Client/19.225.1/License
Microsoft.TeamFoundationServer.ExtendedClient | 19.225.1 | license.txt | https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/19.225.1/License
Moq | 4.20.72 | BSD-3-Clause | https://licenses.nuget.org/BSD-3-Clause
MSTest | 4.0.2 | MIT | https://licenses.nuget.org/MIT
MSTest.TestAdapter | 4.0.2 | MIT | https://licenses.nuget.org/MIT
MSTest.TestFramework | 4.0.2 | MIT | https://licenses.nuget.org/MIT
Newtonsoft.Json | 13.0.4 | MIT | https://licenses.nuget.org/MIT
NJsonSchema | 11.5.2 | MIT | https://licenses.nuget.org/MIT
Npgsql.EntityFrameworkCore.PostgreSQL | 10.0.0 | PostgreSQL | https://licenses.nuget.org/PostgreSQL
NUnit | 4.4.0 | MIT | https://licenses.nuget.org/MIT
NUnit3TestAdapter | 6.0.0 | MIT | https://licenses.nuget.org/MIT
Polly | 8.6.5 | BSD-3-Clause | https://licenses.nuget.org/BSD-3-Clause
ReportPortal.Serilog | 2.0.0 | | https://raw.githubusercontent.com/reportportal/logger-net-serilog/master/LICENSE
ReportPortal.VSTest.TestLogger | 3.8.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
RestSharp | 113.0.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
RestSharp.Serializers.NewtonsoftJson | 113.0.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
Selenium.WebDriver | 4.39.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
Selenium.WebDriver.MSEdgeDriver | 141.0.3537.71 | LICENSE.txt | https://www.nuget.org/packages/Selenium.WebDriver.MSEdgeDriver/141.0.3537.71/License
Serilog.Extensions.Logging.File | 3.0.1-dev-00077 | LICENSE | https://www.nuget.org/packages/Serilog.Extensions.Logging.File/3.0.1-dev-00077/License
Serilog.Settings.Configuration | 10.0.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
Serilog.Sinks.Console | 6.1.1 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
Serilog.Sinks.Debug | 3.0.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
Serilog.Sinks.File | 7.0.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
System.Composition | 10.0.1 | MIT | https://licenses.nuget.org/MIT
System.Drawing.Common | 10.0.1 | MIT | https://licenses.nuget.org/MIT
System.Management | 10.0.1 | MIT | https://licenses.nuget.org/MIT
System.Security.Permissions | 10.0.1 | MIT | https://licenses.nuget.org/MIT
TextCopy | 6.2.1 | MIT | https://licenses.nuget.org/MIT
Titanium.Web.Proxy | 3.2.0 | | https://github.com/justcoding121/titanium-web-proxy/blob/develop/LICENSE
Twilio | 7.13.8 | | https://github.com/twilio/twilio-csharp/blob/HEAD/LICENSE
Unity | 5.11.10 | | https://github.com/unitycontainer/unity/blob/main/LICENSE
VisualRegressionTracker | 4.9.0 | Apache-2.0 | https://licenses.nuget.org/Apache-2.0
WebDriverManager | 2.17.6 | MIT | https://licenses.nuget.org/MIT
WindowsAzure.Storage | 9.3.3 | | https://github.com/Azure/azure-storage-net/blob/master/LICENSE.txt
2 changes: 1 addition & 1 deletion Bellatrix.LLM/Bellatrix.LLM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.68.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.70.0" />
<!-- DO NOT update Microsoft.KernelMemory unless we move to .NET 9 -->
<PackageReference Include="Microsoft.KernelMemory" Version="0.98.250508.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion Bellatrix.LLM/SemanticKernelService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static void EnsureInitialized()
return;

var llmSettings = ConfigurationService.GetSection<LargeLanguageModelsSettings>();
if (llmSettings == null)
if (llmSettings is null or { EnableSelfHealing: false, EnableSmartFailureAnalysis: false })
return;

var genSettings = llmSettings.ModelSettings[0];
Expand Down
Binary file added BellatrixTestFramework.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Bellatrix.Api/Bellatrix.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>

<PackageReference Include="Newtonsoft.Json.Schema" Version="4.0.1" />
<PackageReference Include="JsonSchema.Net" Version="9.1.0" />

<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="Polly" Version="8.6.5" />
Expand Down
37 changes: 16 additions & 21 deletions src/Bellatrix.Api/assertions/AssertExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
using System.Linq;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Xml;
using System.Xml.Schema;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
using Json.Schema;
using RestSharp;

namespace Bellatrix.Api;
Expand Down Expand Up @@ -212,20 +212,17 @@ public static void AssertSchema(this MeasuredResponse response, Uri schemaUri)
AssertXmlSchema(response, schemaUri);
}
}

private static void AssertJsonSchema(MeasuredResponse response, string schemaContent)
{
JSchema jsonSchema;

JsonSchema jsonSchema;
try
{
jsonSchema = JSchema.Parse(schemaContent);
jsonSchema = JsonSchema.FromText(schemaContent);
}
catch (Exception ex)
{
throw new ArgumentException("Schema is not valid schema", ex);
}

AssertJsonSchema(response, jsonSchema);
}

Expand All @@ -237,26 +234,24 @@ private static void AssertJsonSchema(MeasuredResponse response, Uri schemaUri)
AssertJsonSchema(response, schemaResponse.Content);
}

private static void AssertJsonSchema(MeasuredResponse response, JSchema jsonSchema)
private static void AssertJsonSchema(MeasuredResponse response, JsonSchema jsonSchema)
{
IList<string> messages;

var trimmedContent = response.Content.TrimStart();

bool isSchemaValid =
trimmedContent.StartsWith("{", StringComparison.Ordinal)
? JObject.Parse(response.Content).IsValid(jsonSchema, out messages)
: JArray.Parse(response.Content).IsValid(jsonSchema, out messages);

if (!isSchemaValid)
var jsonDocument = JsonDocument.Parse(response.Content);
var result = jsonSchema.Evaluate(jsonDocument.RootElement);
if (!result.IsValid)
{
var sb = new StringBuilder();
sb.AppendLine("JSON Schema is not valid. Error Messages:");
foreach (var errorMessage in messages)
foreach (var detail in result.Details)
{
sb.AppendLine(errorMessage);
if (detail.Errors != null)
{
foreach (var error in detail.Errors)
{
sb.AppendLine($"{detail.InstanceLocation}: {error.Value}");
}
}
}

throw new ApiAssertException(sb.ToString());
}
}
Expand Down
Loading
Loading