Ejemplo n.º 1
0
        public void OnAllMutantsTested(IReadOnlyProjectComponent reportComponent)
        {
            var mutationReport = JsonReport.Build(_options, reportComponent);

            var reportUri = _dashboardClient.PublishReport(mutationReport, _options.ProjectVersion).Result;

            if (reportUri != null)
            {
                if (_options.ReportTypeToOpen == Options.Inputs.ReportType.Dashboard)
                {
                    _processWrapper.Open(reportUri);
                }
                else
                {
                    _consoleWriter.Write(Output.Cyan("Hint: by passing \"--open-report:dashboard or -o:dashboard\" the report will open automatically once Stryker is done."));
                }

                _logger.LogDebug("Your stryker report has been uploaded to: \n {0} \nYou can open it in your browser of choice.", reportUri);
                _consoleWriter.Write(Output.Green($"Your stryker report has been uploaded to: \n {reportUri} \nYou can open it in your browser of choice."));
            }
            else
            {
                _logger.LogError("Uploading to stryker dashboard failed...");
            }

            _consoleWriter.WriteLine();
            _consoleWriter.WriteLine();
        }
Ejemplo n.º 2
0
        public void OnAllMutantsTested(IReadOnlyProjectComponent reportComponent)
        {
            var mutationReport = JsonReport.Build(_options, reportComponent);
            var filename       = _options.ReportFileName + ".html";
            var reportPath     = Path.Combine(_options.OutputPath, "reports", filename);

            reportPath = FilePathUtils.NormalizePathSeparators(reportPath);

            WriteHtmlReport(reportPath, mutationReport.ToJsonHtmlSafe());

            // to make path clickable it should always start with: file:///
            var reportUri = reportPath.Replace("\\", "/");

            reportUri = reportUri.StartsWith("/") ? reportUri : "/" + reportUri;
            reportUri = "file://" + reportUri;

            if (_options.ReportTypeToOpen == Options.Inputs.ReportType.Html)
            {
                _processWrapper.Open(reportUri);
            }
            else
            {
                _consoleWriter.Write(Output.Cyan("Hint: by passing \"--open-report or -o\" the report will open automatically once Stryker is done."));
            }

            _consoleWriter.WriteLine(Output.Green($"\nYour html report has been generated at:\n" +
                                                  $"{reportUri}\n" +
                                                  $"You can open it in your browser of choice."));
        }
Ejemplo n.º 3
0
        public void OnAllMutantsTested(IReadOnlyProjectComponent reportComponent)
        {
            var mutationReport = JsonReport.Build(_options, reportComponent);

            var reportUri = _dashboardClient.PublishReport(mutationReport, _options.ProjectVersion).Result;

            if (reportUri != null)
            {
                if (_options.ReportTypeToOpen == Options.Inputs.ReportType.Dashboard)
                {
                    _processWrapper.Open(reportUri);
                }
                else
                {
                    _console.Write("[Cyan]Hint: by passing \"--open-report:dashboard or -o:dashboard\" the report will open automatically once Stryker is done.[/]");
                }

                _console.WriteLine();
                _console.MarkupLine("[Green]Your report has been uploaded at:[/]");

                if (_console.Profile.Capabilities.Links)
                {
                    // We must print the report path as the link text because on some terminals links might be supported but not actually clickable: https://github.com/spectreconsole/spectre.console/issues/764
                    _console.MarkupLine($"[Green][link={reportUri}]{reportUri}[/][/]");
                }
                else
                {
                    _console.MarkupLine($"[Green]{reportUri}[/]");
                }

                _console.MarkupLine("[Green]You can open it in your browser of choice.[/]");
            }
            else
            {
                _logger.LogError("Uploading to stryker dashboard failed...");
            }

            _console.WriteLine();
            _console.WriteLine();
        }
Ejemplo n.º 4
0
        public void OnAllMutantsTested(IReadOnlyProjectComponent reportComponent)
        {
            var mutationReport = JsonReport.Build(_options, reportComponent);
            var filename       = _options.ReportFileName + ".html";
            var reportPath     = Path.Combine(_options.OutputPath, "reports", filename);

            reportPath = FilePathUtils.NormalizePathSeparators(reportPath);

            WriteHtmlReport(reportPath, mutationReport.ToJsonHtmlSafe());

            var reportUri = "file://" + reportPath.Replace("\\", "/");

            if (_options.ReportTypeToOpen == Options.Inputs.ReportType.Html)
            {
                _processWrapper.Open(reportUri);
            }
            else
            {
                _console.MarkupLine("[Cyan]Hint: by passing \"--open-report or -o\" the report will open automatically once Stryker is done.[/]");
            }

            _console.WriteLine();
            _console.MarkupLine("[Green]Your html report has been generated at:[/]");

            if (_console.Profile.Capabilities.Links)
            {
                // We must print the report path as the link text because on some terminals links might be supported but not actually clickable: https://github.com/spectreconsole/spectre.console/issues/764
                _console.MarkupLine($"[Green][link={reportUri}]{reportPath}[/][/]");
            }
            else
            {
                _console.MarkupLine($"[Green]{reportUri}[/]");
            }

            _console.MarkupLine("[Green]You can open it in your browser of choice.[/]");
        }