Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Test Impact Analysis #154

Draft
wants to merge 189 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
065c418
zmq powered gui
mpdeimos Sep 28, 2020
2385d65
retarget vc projects
mpdeimos Sep 28, 2020
a1e3e9f
codemaid
mpdeimos Sep 28, 2020
e0d81b1
add ZMQ, first concept of one-way profiler communication
mpdeimos Sep 29, 2020
a64c664
add testcase for one-way profiler communication
mpdeimos Sep 29, 2020
f0c0be3
rename gui
mpdeimos Sep 30, 2020
5befda8
add profiler commons project and use in test
mpdeimos Sep 30, 2020
95d8074
Test infra: use .net ZMQ and native ZMQ
mpdeimos Nov 24, 2020
59af32f
Extend Profiler Testee with an interactive mode
mpdeimos Nov 25, 2020
2f6f80d
Add publisher socket to C# IPC implementation
mpdeimos Nov 25, 2020
5c63ba7
Wire subscribe socket in C++ IPC
mpdeimos Nov 25, 2020
d40729c
write function infos to log on test case switch
mpdeimos Nov 25, 2020
1d016b9
Real TIA method call profiling
mpdeimos Dec 1, 2020
ea2fa00
Refactor tests
mpdeimos Dec 2, 2020
2f2e923
No locking until IPC is started
mpdeimos Dec 14, 2020
3022397
Use NetMQ-native threading
mpdeimos Dec 14, 2020
a5d3519
compiler profiler testee with native bitness and as x86, x64
mpdeimos Dec 14, 2020
aee3e91
parameterize tia tests as x64 and x86
mpdeimos Dec 14, 2020
1fbf7e7
test start ipc after app (not working yet)
mpdeimos Jan 22, 2021
82ea47f
commander rework
mpdeimos Jan 22, 2021
3874d31
simplified commander
mpdeimos Jan 22, 2021
519a256
multipart tia start/end
mpdeimos Jan 26, 2021
b421dc6
escaping of characters
mpdeimos Jan 26, 2021
0fec463
store test execution result
mpdeimos Jan 26, 2021
0bf704e
disable mscorlib profiling for TIA
mpdeimos Jan 26, 2021
8d868f8
fix for default socket
mpdeimos Jan 29, 2021
b256b52
Wrap coverage data in report class.
salsolatragus Nov 24, 2020
efa1a83
Write testwise coverage report.
salsolatragus Nov 27, 2020
6f639cf
Merge TraceFile and ParsedTraceFile classes.
salsolatragus Jan 31, 2021
266c6c0
Hide internal data of TraceFile.
salsolatragus Jan 31, 2021
5f9ad5e
Make names consistent.
salsolatragus Jan 31, 2021
c379efa
Ignores method references from unkown assemblies.
salsolatragus Jan 31, 2021
f83ce26
Improve some names.
salsolatragus Jan 31, 2021
985a4a4
Split testwise report and separate conversion from files.
salsolatragus Jan 31, 2021
9abbb23
Generate aggregated report.
salsolatragus Jan 31, 2021
1fcbe09
Introduce ICoverageReport abstraction.
salsolatragus Jan 31, 2021
abd3188
Tests simple report output.
salsolatragus Jan 31, 2021
d30faf1
Tests aggregated trace.
salsolatragus Jan 31, 2021
702224b
Test testwise report contents.
salsolatragus Jan 31, 2021
0769fc1
Remove obsolete method.
salsolatragus Jan 31, 2021
9a7a5f4
Simplify tests.
salsolatragus Jan 31, 2021
0bb95e6
Test generating testwise report.
salsolatragus Feb 1, 2021
760c7b9
Merge SimpleCoverageReport and LineCoverageReport.
salsolatragus Feb 1, 2021
2e0df40
Remove unused import.
salsolatragus Feb 1, 2021
9784045
Remove obsolete class.
salsolatragus Feb 1, 2021
7d2353f
Cleanup testwise report model.
salsolatragus Feb 1, 2021
6ef6870
Simplify creation of testwise report.
salsolatragus Feb 1, 2021
4cd2c43
Merge testwise reports with different tests.
salsolatragus Feb 1, 2021
2fba176
Merge testwise reports.
salsolatragus Feb 1, 2021
dffe644
Send report format to Teamscale.
salsolatragus Feb 1, 2021
d297d3b
Move simple report to own namespace.
salsolatragus Feb 1, 2021
9de811b
Serialize testwise report.
salsolatragus Feb 1, 2021
5c1df8d
Test parsing jitted, inlined, and called events.
salsolatragus Feb 2, 2021
458b210
Assume tests always start.
salsolatragus Feb 2, 2021
54b99b5
Consider test without end.
salsolatragus Feb 2, 2021
4057fab
Add no-test coverage only if any.
salsolatragus Feb 2, 2021
6a8c035
Fix test result labels.
salsolatragus Feb 2, 2021
73b2bd3
Keep non-test coverage.
salsolatragus Feb 2, 2021
4d232e2
cache latest test runs
mpdeimos Feb 2, 2021
3a32c3c
Merge test metadata.
salsolatragus Feb 2, 2021
77888f4
Simplify archiving API.
salsolatragus Feb 2, 2021
2e35d47
Shorten an expression.
salsolatragus Feb 2, 2021
6f74a98
Fix stupid merge error.
salsolatragus Feb 2, 2021
059a5e5
test timing fix
mpdeimos Feb 3, 2021
7563980
error logging
mpdeimos Feb 12, 2021
e13ce46
test name validation
mpdeimos Feb 12, 2021
083ea6d
Extract Tia test baseclass.
salsolatragus Feb 19, 2021
f850e52
Abstract test setup.
salsolatragus Feb 19, 2021
515f5c9
Restructure test infrastructure.
salsolatragus Feb 23, 2021
1a4fb06
Remove TiaTestee.
salsolatragus Feb 23, 2021
c07b91b
Simplify testee.
salsolatragus Feb 23, 2021
ee83cde
Reduce visibility.
salsolatragus Feb 23, 2021
8017b25
Specify bitness on testee rather than profiler.
salsolatragus Feb 24, 2021
5f36782
Add performance testee.
salsolatragus Feb 24, 2021
7f5505f
Configure Commons to build a nuget package.
salsolatragus Mar 2, 2021
f0eca90
Remove unused import.
salsolatragus Mar 2, 2021
8657ed2
Add logging to commander.
salsolatragus Mar 2, 2021
577373d
Merge remote-tracking branch 'origin/tia_report' into tia
salsolatragus Mar 2, 2021
601669b
Performance improvements:
mpdeimos Mar 2, 2021
cfb259b
Merge branch 'tia' of https://github.com/cqse/teamscale-profiler-dotn…
mpdeimos Mar 2, 2021
d52ecaf
Add missing dependency to commander.
salsolatragus Mar 8, 2021
4cc5eb5
support test path prefixes
mpdeimos Feb 12, 2021
5907e52
correct emptiness handling for testwise traces
mpdeimos Feb 12, 2021
d0c4f3e
Add some interface comments.
salsolatragus Mar 10, 2021
e561a15
Reduce default log level to Info.
salsolatragus Mar 10, 2021
609bdfd
Add improvements to branch
Raphael-N Sep 8, 2021
8c869e9
Add comments and fix Testee bitness
Raphael-N Oct 4, 2021
975801d
fix empty traces
mpdeimos Mar 16, 2021
4cafeeb
* keep existing tests also for report merge
mpdeimos Mar 16, 2021
f7503c2
remove support for known test cases
mpdeimos Mar 17, 2022
793f93b
add support for partial coverage reports
mpdeimos Mar 17, 2022
e6c7c79
Potential Fix for crashes at Healthineers
Raphael-N Mar 22, 2022
244bc12
Fix casing
mpdeimos Mar 24, 2022
c780e5f
Commander CLI
mpdeimos Mar 24, 2022
ef2410a
Commander Server
mpdeimos Mar 24, 2022
717a669
Review
mpdeimos Apr 1, 2022
6717a8e
review
mpdeimos Apr 12, 2022
b083f25
add logging
mpdeimos Apr 13, 2022
7cece30
add quiet mode
mpdeimos Apr 13, 2022
889d158
additional null checks
mpdeimos Apr 13, 2022
3d3a934
add nullable library
mpdeimos Apr 13, 2022
823bac7
forbid setting test name to null
mpdeimos Apr 13, 2022
f1a85b3
🤦
mpdeimos Apr 13, 2022
4e08202
better error handling
mpdeimos Apr 13, 2022
725cbe5
Merge pull request #160 from cqse/tia_server_cli
Raphael-N Apr 25, 2022
af822fe
Update Platform version and toolset
Raphael-N Apr 26, 2022
59171c6
Remove ifdefs, rework, add tga toggle to options
Raphael-N Apr 26, 2022
e1ca972
Swap vectors instead of using a toggle boolean
Raphael-N Apr 28, 2022
9afa9aa
Rename method id vectors to primary and backing vectors
Raphael-N Apr 28, 2022
c57da74
Merge pull request #155 from cqse/tia-merge-reports
Raphael-N Apr 28, 2022
6bde083
Add tests for tga and tia configurations
Raphael-N May 12, 2022
776e0bd
Implement int set to achieve faster checks
Raphael-N May 22, 2022
ef52fae
Add documentation to custom set implementation
Raphael-N Jun 1, 2022
c5e0762
Merge branch 'tia' into performance_improvements_tia
Raphael-N Jun 1, 2022
b3d64f2
Fix minor issue
Raphael-N Jun 1, 2022
122a357
Rework
Raphael-N Jun 7, 2022
0bd6864
Merge pull request #158 from cqse/performance_improvements_tia
mpdeimos Jun 8, 2022
3e0225e
Fix issue in functionId_set
Raphael-N Jul 4, 2022
b09bc74
update bummer/update output path
mpdeimos Jul 8, 2022
04d1980
bummer update
mpdeimos Jul 14, 2022
6aeea2c
fix tests
mpdeimos Jul 14, 2022
ec9d95f
Use newer libzmq commands for context shutdown and add timeout to sub…
Raphael-N Aug 1, 2022
68bd98f
pre-initialize profiler ipc
mpdeimos Aug 10, 2022
37db7ce
Add documentation for TIA mode catch in shutdown
Raphael-N Jan 18, 2023
907d385
Merge branch 'master' into tia
Raphael-N Feb 8, 2023
1833413
Fix Test cases
Raphael-N Feb 8, 2023
6f5659f
Consider testwise coverage for artifactory uploads
Raphael-N May 19, 2023
0866873
Change name for artifactory report upload
Raphael-N Jun 16, 2023
ef114a8
Merge branch 'master' into tia
Raphael-N Jun 21, 2023
732af2b
Fix Test after merge
Raphael-N Jun 23, 2023
df39b8d
Remove Worker thread due to issues with many processes
Raphael-N Jul 24, 2023
34570e4
Add Zipping step to Artifactory Upload
Raphael-N Jul 30, 2023
eb09de3
Fix Artifactory Upload
Raphael-N Jul 30, 2023
7e6b4ee
Improve artifactory branches
Raphael-N Jul 30, 2023
13a4cc6
add dialog for recording test duration
Aug 1, 2023
265f77d
implement long <-> string conversion for duration
Aug 1, 2023
488b600
send adjusted duration to profiler
Aug 1, 2023
0013465
fix bugs
Aug 1, 2023
77f704a
fix teamscale findings
Aug 1, 2023
a14794b
Start implementing synchronous communication
Raphael-N Aug 2, 2023
25cc661
Add Socket handling
Raphael-N Aug 2, 2023
352cd4f
Support time configuration in profiler and daemon
Raphael-N Aug 2, 2023
82e4720
Use milliseconds for automated tests
Raphael-N Aug 2, 2023
1af9253
Fix some communication issues
Raphael-N Aug 3, 2023
48ec74d
rework
Aug 3, 2023
69c2fdf
update to newer framework version
Aug 4, 2023
50c49b8
malformed trace lines should not crash upload daemon
Aug 4, 2023
89f82ef
Send PID to ZmqIpcServer as clientID
Aug 4, 2023
b12a785
Update TargetFrameworkVersion in UploadDaemon_Test
Aug 4, 2023
96e5746
rework
Raphael-N Aug 7, 2023
82a9680
Rework
Raphael-N Aug 7, 2023
474fa63
Write as one string instead of per entry
Raphael-N Aug 7, 2023
78b8d62
Add synchronization to jit inlining events
Raphael-N Aug 9, 2023
1a961c8
Fix casing of results
Raphael-N Aug 17, 2023
8e94aa4
Merge branch 'tia_synchronous_events' of https://github.com/cqse/team…
Raphael-N Aug 17, 2023
269a07e
Disable inlining for accurate results
Raphael-N Aug 17, 2023
c584514
Merge pull request #180 from cqse/test-commander-change-duration
Raphael-N Aug 18, 2023
fa7ea27
Fix encoding of test names
Raphael-N Aug 29, 2023
c6fe173
Update Test Times and Add Checks for running Tests
Raphael-N Sep 19, 2023
a16e337
Fix initial test not appearing
Raphael-N Sep 22, 2023
652929c
Fix Process not shutting down
Raphael-N Sep 22, 2023
306ab2e
Improve performance of Upload Daemon
Raphael-N Sep 22, 2023
82c75f9
TS#35530 Check if the trace directory is writable
Raphael-N Sep 25, 2023
77630df
Fix issue with time sending
Raphael-N Oct 4, 2023
0485275
Reduce Memory Usage
Raphael-N Oct 27, 2023
6ef1bcf
Replace newline with space in testname
Raphael-N Oct 27, 2023
668537d
Implement Splitting for too large reports
Raphael-N Oct 30, 2023
7db2f6d
Merge branch 'tia' into tia_synchronous_events
Raphael-N Nov 27, 2023
5d1bb79
Cleanup leftovers from merge
Raphael-N Nov 29, 2023
5aa9762
Minor fixes
Raphael-N Jan 10, 2024
db12283
Fix several Teamscale findings
Raphael-N Jan 26, 2024
ca0da28
Add String report splitting for other upload types
Raphael-N Jan 31, 2024
9311980
Small fixes
Raphael-N Feb 27, 2024
a239651
Fix tests and socket configurations
Raphael-N Feb 28, 2024
20fa0fe
Fix Tests
Raphael-N Mar 20, 2024
62a1aeb
Update tests
Raphael-N Apr 10, 2024
a192408
More Test fixes and add back pipeline
Raphael-N Apr 12, 2024
b0ef272
Merge pull request #183 from cqse/tia_synchronous_events
Raphael-N Apr 12, 2024
38c11b4
Merge branch 'master' into tia
Raphael-N Jun 21, 2024
5160d84
Merge branch 'tia' of https://github.com/cqse/teamscale-profiler-dotn…
Raphael-N Jun 21, 2024
6800edd
Fix merge leftovers
Raphael-N Jun 26, 2024
0a63d9c
TS#38029 Fix remaining tests
Raphael-N Jul 10, 2024
a43ce20
Merge branch 'master' into tia
Raphael-N Jul 10, 2024
e71d373
TS#38029 Update Profiler Testee
Raphael-N Jul 10, 2024
91c8a68
TS#38029 Introduce AssemblyExtractor to fix EmbeddudUploadTarget Hand…
Raphael-N Jul 15, 2024
bd3289a
TS#38029 Fix TS findings
Raphael-N Jul 15, 2024
d660612
TS#38029 Rework functionId_set
Raphael-N Jul 22, 2024
a4a70c8
TS#38029 Refactor trace file parsing
Raphael-N Aug 1, 2024
55b4ec4
TS#38029 Fix leftover issues from TraceFileParser rework
Raphael-N Aug 2, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ obj/
test-tmp/
*.aps
test-data/test-programs/output.pdf
test-data/test-programs/*.pdb
test-data/test-programs/*.exe.config
/packages/
!packages/repositories.config

40 changes: 38 additions & 2 deletions .teamscale.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
server.url = "https://cqse.teamscale.io/"
project.id = "teamscale-net-profiler"
# The Teamscale IDE configuration file format version of this file.

version = "1.0" # Optional, default: 1.0

# Whether this is the root config file.
# If true, configuration discovery stops at this file and does not continue upwards to the filesystem root.

root = true # Optional, default: false

[server]

# The URL of the Teamscale server.
# If set, it must match the URL of a server for which credentials (Username, Access Key) have been configured in the respective IDE.

url = "https://cqse.teamscale.io/" # Optional, but must be set in the merged configuration

[project]

# The Project ID (or one of its Alternative Project IDs) of the Teamscale project.
# Note that the Project ID may be different from the more prominently displayed Project Name.
#
# If a .teamscale.toml file sets the project.id and does not set project.path
# explicitly, then it implicitly sets project.path = "" (i.e., associates the
# current folder with the root folder of the Teamscale project).

id = "teamscale-net-profiler" # Optional, but must be set in the merged configuration

# The branch to use for retrieving data from the server.
#
# If empty or unset, the applicable branch is discovered from the VCS, with the
# Teamscale default branch being a fallback.
# If set and non-empty, branch auto-discovery is not used. Instead, the given branch is used

# The code path within the Teamscale project on the server.
#
# Paths from parent configs will be overwritten.
# Forward-slashes are used as path separators.
# If empty (i.e., path = ""), the Teamscale project root is used as code path.
15 changes: 15 additions & 0 deletions Commander.Cli/Commander.Cli.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>..\Profiler\bin\Release\Commander\Cli</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Commons\Commons.csproj" />
</ItemGroup>

</Project>
130 changes: 130 additions & 0 deletions Commander.Cli/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
using Cqse.Teamscale.Profiler.Commons.Ipc;
using System.Reflection;

var profilerIpc = new ProfilerIpc(new IpcConfig());

bool quiet = args.Contains("-q") || args.Contains("--quiet");
long testStart = 0;

while(true)
{
Command nextCommand = Command.Start;
if (!string.IsNullOrEmpty(profilerIpc.TestName))
{
nextCommand = Command.Stop;
}

(Command command, string? arg) = WaitForCommand(nextCommand);
if (ExecuteCommand(command, arg))
{
return;
}
}

bool ExecuteCommand(Command command, string? arg)
{
switch(command)
{
case Command.Start:
ArgumentNullException.ThrowIfNull(arg, nameof(arg));

profilerIpc.StartTest(arg);
PrintUnlessQuiet($"Started test {arg}");
testStart = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

return false;
case Command.Stop:
ArgumentNullException.ThrowIfNull(arg, nameof(arg));

if (arg.Length > 1)
{
if (Enum.TryParse(arg, ignoreCase: true, out TestExecutionResult result))
{
long testEnd = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
profilerIpc.EndTest(result, durationMs: testEnd - testStart);
PrintUnlessQuiet($"Stopped test with result {arg}");
return false;
}
}
Console.Error.WriteLine($"Unknown test result: {arg}");
return false;
case Command.Exit:
return true;
default:
return false;
}
}

(Command, string?) WaitForCommand(params Command[] commands)
{
Dictionary<string, Command> availableCommands = commands.Append(Command.Exit).ToDictionary(command => command.ToString().ToLower(), command => command);
PrintUnlessQuiet("Available commands:");

foreach(Command command in availableCommands.Values) {
CommandAttribute attribute = CommandAttribute.GetAttribute(command);
string synopsis = string.Join(" ", command.ToString().ToLower(), attribute.Argument);
PrintUnlessQuiet($" * {synopsis}: {attribute.Description}");
}

PrintUnlessQuiet(string.Empty);

while(true) {
string[]? input = Console.ReadLine()?.Split(" ", 2);
if (input == null)
{
continue;
}

PrintUnlessQuiet(string.Empty);

if (availableCommands.TryGetValue(input[0].ToLower(), out Command command)) {
string? arg = null;
if (input.Length > 1)
{
arg = input[1];
}
return (command, arg);
}

Console.Error.WriteLine($"Unknown command: {input[0]}");
}
}

void PrintUnlessQuiet(string message)
{
if (!quiet)
{
Console.WriteLine(message);
}
}

class CommandAttribute : Attribute
{
public const string ValidResultValues = "passed, ignored, skipped, failure, error";

public string Description { get; }
public string? Argument { get; }

public CommandAttribute(string description, string? argument = null)
{
Description = description;
Argument = argument;
}

public static CommandAttribute GetAttribute(Command command)
{
MemberInfo memberInfo = typeof(Command).GetMember(command.ToString()).First();
return memberInfo.GetCustomAttribute<CommandAttribute>()!;
}

}

enum Command
{
[Command("Starts a test named 'name-of-test'", "name-of-test")]
Start,
[Command($"Stops the test with result being one of {CommandAttribute.ValidResultValues}", "result")]
Stop,
[Command("Closes the commander")]
Exit
}
16 changes: 16 additions & 0 deletions Commander.Server/Commander.Server.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Cqse.Teamscale.Profiler.Commander.Server</RootNamespace>
<BaseOutputPath>..\Profiler\bin\Release\Commander\Server</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Commons\Commons.csproj" />
</ItemGroup>


</Project>
77 changes: 77 additions & 0 deletions Commander.Server/ProfilerTestController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using Cqse.Teamscale.Profiler.Commons.Ipc;
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Text.Json.Serialization;
using System.Web;
using System.Xml.Linq;

namespace Cqse.Teamscale.Profiler.Commander.Server
{
[Route("test")]
[ApiController]
public class ProfilerTestController : ControllerBase
{
private readonly ProfilerIpc profilerIpc;
private readonly ILogger logger;

public ProfilerTestController(ProfilerIpc profilerIpc, ILogger<ProfilerTestController> logger)
{
this.profilerIpc = profilerIpc;
this.logger = logger;
}

[HttpGet]
public string GetCurrent()
{
return profilerIpc.TestName;
}

public long GetStart()
{
return profilerIpc.TestStartMS;
}

[HttpPost("start/{testName}")]
public HttpStatusCode StartTest(string testName)
{
if (string.IsNullOrEmpty(testName))
{
throw new BadHttpRequestException("Test name may not be empty");
}

logger.LogInformation("Starting test: {}", testName);
profilerIpc.TestStartMS = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
profilerIpc.StartTest(HttpUtility.UrlDecode(testName));
return HttpStatusCode.NoContent;
}

[HttpPost("stop/{result}")]
public HttpStatusCode StopTest(TestExecutionResult result)
{
long testEnd = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
logger.LogInformation("Stopping test (JaCoCo endpoint): {}; Result: {}; duration: {}", GetCurrent(), result, testEnd - GetStart());
profilerIpc.EndTest(result, durationMs: testEnd - GetStart());
return HttpStatusCode.NoContent;
}

/// <summary>
/// Legacy end test to match the JaCoCo API.
/// </summary>
[HttpPost("end/{name}")]
public HttpStatusCode EndTest(string name, [FromBody] TestResultDto result)
{
long testEnd = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
logger.LogInformation("Stopping test (JaCoCo endpoint): {}; Result: {}; duration: {}", name, result.Result, testEnd - GetStart());
profilerIpc.EndTest(result.Result, durationMs: testEnd - GetStart());

return HttpStatusCode.NoContent;
}

public class TestResultDto
{
[JsonConverter(typeof(JsonStringEnumConverter))]
public TestExecutionResult Result { get; set; }
public string? Message { get; set; }
}
}
}
13 changes: 13 additions & 0 deletions Commander.Server/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Cqse.Teamscale.Profiler.Commons.Ipc;

var builder = WebApplication.CreateBuilder(args);
// explicitly initialize the Ipc, otherwise it might be created upon 1st request and we miss the start event in the profiler
builder.Services.AddSingleton<ProfilerIpc>(new ProfilerIpc(new IpcConfig()));
builder.Services.AddControllers();

var app = builder.Build();
app.MapControllers();
app.UseDefaultFiles();
app.UseStaticFiles();

app.Run();
30 changes: 30 additions & 0 deletions Commander.Server/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38278",
"sslPort": 0
}
},
"profiles": {
"Commander.Server": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5268",
"dotnetRunMessages": true
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
8 changes: 8 additions & 0 deletions Commander.Server/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions Commander.Server/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
6 changes: 6 additions & 0 deletions Commander.Server/wwwroot/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Commander.Server/wwwroot/bootstrap/bootstrap.min.css.map

Large diffs are not rendered by default.

Loading