Paste a piece of source code where test was failed
https://github.com/nvborisenko/reportportal-extensions-sourceback.git
Install ReportPortal.Extensions.SourceBack nuget package into tests project and see in report where exactly test was failed.
pdb file. When test fails, SourceBack package tracks exceptions stacktrace and inserts corresponding piece of code. This works even if you build and execute tests on different machines.
portable or embedded debug type option. This is already set for the most of projects by default. To change it: right click on the project in Solution Explorer window and then Properties > Build > Advanced > Debugging Information.
ReportPortal.config.json file
{
"Extensions": {
"SourceBack": {
"OffsetUp": 4,
"OffsetDown": 2
}
}
}
And alternative is via environment variables like ReportPortal_Extensions_SourceBack_OffsetUp. Read more about it.
List of configuration parameters
| Name | Description |
|---|---|
| ReportPortalExtensionsSourceBackOffsetUp | How many lines of code above to capture. Default: 4. |
| ReportPortalExtensionsSourceBackOffsetDown | How many lines of code below to capture. Default: 2. |
| ReportPortalExtensionsSourceBack_OpenWith | Program where to open highlighted line of code. Currently only Visual Studio Code is supported. Default: vscode. |
Sometimes this extension doesn't highlight the line of code properly if project is built with Code Optimization enabled. Usually this option is disabled in Debug configuration (Right click on the project Properties > Build > Disable Optimize code).
ReportPortal_TraceLevel=Verbose to turn on internal report portal tracing. See verbosed messages in ReportPortal.*.log files.