SeaLights .NET Core agent - Command Reference
Creating a session ID
Standard Session ID
dotnet ./<agent-path>/SL.DotNet.dll config --appName <arg> --branchName <arg> --buildName <arg> --includeNamespace <arg> [--excludeNamespace <arg>] [--include <arg>] [--exclude <arg>] [--buildSessionId <arg> | --buildSessionIdFile <arg>] [--token <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]
Parameter | Description |
---|---|
| Name of the application |
| The source branch of the application |
| The build label of the current build |
| Comma-separated list of namespaces to include in scan. |
| Comma-separated list of packages to exclude from scan. |
| Comma-separated list of files to include in scan. Default: |
| Comma-separated list of files to exclude from scan. |
| Optional: A user provided session ID |
| Optional: A user provided Build Session ID file. |
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
| (optional) Allows the agent identify methods by the fully qualified name (FQN) and support pipelines with multiple compilations of the same version |
Pull Request Session ID
dotnet ./<agent-path>/SL.DotNet.dll prConfig --appName <arg> --pullRequestNumber <arg> --targetBranch <arg> --latestCommit <arg> --repositoryUrl <arg> --includeNamespace <arg> [--excludeNamespace <arg>] [--include <arg>] [--exclude <arg>] [--buildSessionId <arg> | --buildSessionIdFile <arg>] [--token <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]
Parameter | Description |
---|---|
| Name of the application |
| The number assigned to the Pull Request from the source control |
| The branch to which this PR will be merged into (already reported to SeaLights) |
| The full SHA of the last commit made to the Pull Request |
| The pull request URL for the PR to be scanned, up until the section before the |
| Comma-separated list of namespaces to include in scan. |
| Comma-separated list of packages to exclude from scan. |
| Comma-separated list of files to include in scan. Default: |
| Comma-separated list of files to exclude from scan. |
| Optional: A user provided session ID |
| Optional: A user provided Build Session ID file. |
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
| (optional) Allows the agent identify methods by the fully qualified name (FQN) and support pipelines with multiple compilations of the same version |
Scanning a build
Scanning files
The project must contain all the PDB files!
dotnet ./<agent-path>/SL.DotNet.dll scan {--buildSessionId <arg> | --buildSessionIdFile <arg>} --workspacePath <arg> --ignoreGeneratedCode true [--firstModule {true|false}] [--uniqueModuleId <arg>] [--baseDir <arg>] [--scm <arg>] [--token <arg> | --tokenFile <arg>] [--proxy <arg> [--proxyUsername <arg> --proxyPassword <arg>]]
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Path to the source workspace |
| Must be provided when scanning the first module |
| A unique module ID to be used for seperate modules |
| Base path where all relative paths should start from. By default the agent searches for the solution file and uses its path for this value |
| Hashing algorithm to use. Available options are md5 (default), sha1, sha256, sha384, sha512 |
| The SCM that is used in order to provide integration with. Values: auto, git, none |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
| Scan additional folder to collect more runtime components (.git/dll/exe ) for scanning. The path is an absolute path. |
| Comma-separated list of absolute paths to the folders where the agent will recursively search for *.pdb files |
Ending multi-modules scan
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Indicates that the build succeeded (considered failed if not specified) |
| Additional build status message to report (optional) |
| Build duration in milliseconds (optional) |
Coverage Collection operation
Starting the Application/Process via the Agent (run
command)
A single process can be run with the SeaLights agent as a test listener to capture the test footprints or events from a testing framework (like MSTest, NUnit, and XUnit).
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Name of the application to run with the test listener |
| Path to working directory. Current working directory will be used if not specified |
| Sets the COM32 profiler DLL registration method. |
| Command line arguments to pass the target application |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
| (Optional) One or several tags (comma separated) to be passed to Sealights in order to label this instance in the cockpit. |
| (Optional) Set instrumentation mode, default value is
|
| (Optional) Set to |
Configuring a Background Listener
Environment variables required for Background test listener
You need to run your process with the following environment variables:
.NET Core/ Windows | |
.NET Core/ Linux |
Parameter | Description |
---|---|
| Enable Sealights profiling to capture coverage by setting the value to 1. |
| Linux: |
| Name of the profiler executable for an x86 architecture:
|
| Name of the profiler executable for an x64 architecture:
|
| A random alphanumeric ID that was provided during the startBackgroundTestListener |
| Optional: Level of logs to generate - Default is 0 (none), Fatal=1, Error=4, Debug=6, All=999 |
| Optional: Folder to save log files in |
Starting Background test listener
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| A random alphanumeric ID (%RANDOM% in command line) This ID needs to be passed to any process that you want to capture cover |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
Stop Background test listener
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| A random alphanumeric ID that was provided during the startBackgroundTestListener |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
MS Windows - Specific commands
Installing/Uninstalling the Coverage Collector service
Parameter | Description |
---|---|
| Install the Coverage Collector Service |
| Start the service |
| Uninstall the service. This command should be executed alone. |
Register the Profiler for a Windows Service
This command will add the Environment REG_MULTI_SZ
record to the target service inside the Windows registry (Related Windows Registry path: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
) with a list of the environment variables required to start the Sealights profiler.
Parameter | Description |
---|---|
| REQUIRED Target service name |
| Forces overwriting existing registry entries. Default value: |
| Unregister the Profiler and removes the Environment Variables from the Registry. |
Register the Profiler for IIS
This command registers the Sealight profiler with two specific IIS services: WAS
and W3SVC
. So this command is equivalent to instrumentService
running twice (for each of these IIS services).
Parameter | Description |
---|---|
| Forces overwriting existing registry entries. Default value: |
| Unregister the Profiler and removes the Environment Variables from the Registry. |
Starting coverage collection session
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
|
|
| For IIS, provide the Application pool. Since there could be multiple applications running on a single IIS server, it is important to make note of the Application Pool name that corresponds to the hosted application from which coverage will be collected. You can provide a star ( |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| (Optional) IIS Host to start the session remotely on. |
| Address of proxy to run connection through. To use the system proxy just provide the value 'system' |
| The proxy username if needed |
| The proxy password if needed |
Stopping coverage collection session
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Close all the sessions at once. |
|
|
| For IIS, provide the Application pool. Since there could be multiple applications running on a single IIS server, it is important to make note of the Application Pool name that corresponds to the hosted application from which coverage will be collected. You can provide a star ( |
| Unique ID for a set of test labs in case multiple labs are running similtaniously |
| (Optional) IIS Host to stop the session remotely on. |
Reporting a Test Stage
Starting a test stage
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Name of the test stage |
| Unique ID for a set of test labs in case multiple labs are running similtaniously |
| Address of proxy to run connection through. To use the system proxy just provide the value 'system' |
| The proxy username if needed |
| The proxy password if needed |
Upload report files
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Name of the test stage |
| Path to report file or directory containing all the valid reports (Non recursive). Supported formats are MSTest (TRX files), xUnit.Net and NUnit (XML files). |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through. To use the system proxy just provide the value ' |
| The proxy username if needed |
| The proxy password if needed |
Ending a test stage
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing the access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Unique ID for a set of test labs in case multiple labs are running similtaniously |
| Address of proxy to run connection through |
| The proxy username if needed |
| The proxy password if needed |
Logging
If you're facing technical issue, you can consult our dedicated FAQ section at https://sealights.atlassian.net/l/cp/kkgraz02 as we’ve listed there the most common problems and solutions for your benefit.
Agents Commands
To enable logs when executing direct agent commands, you can set the following parameters with any of the above commands
Both console output and file options are compatible and non-exclusive.
For logging into the console, add
For logging into a file, add
Parameter | Description |
---|---|
| Set to true to enable logs |
| Set to true to enable log output to the console |
| Set to true to enable log output to a file |
| Provide the name of the log file |
| Limit the number of log files to create. Default: 10 |
| Limit the size of the log file. Default: 10*1024 KB |
| Level of logs to generate by the Profiler entity as a Integer value: Default is 0 (none), Fatal=1, Error=4, Debug=6, All=999 |
| Folder to save Profiler log files in. Value from this options will be passed to the environment variable |
| Set to true to enable performance monitoring of the host machine. Default value: |
Background Listener
To enable logs, you can add the following environment variables to the registry in addition to the regular variables set for the Profiler as explained in the section Running background processes above.
If the below variables are set, any agent’s command will print values in the configuration data (in the Profiler section).
Parameter | Description |
---|---|
| Level of logs to generate as a Integer value: None= |
| Folder to save log files in. |