public void should_log_on_error() { var config = HostConfig.Get(1); config.LogLevel = "Trace"; HostConfig.Put(config); var logFile = Path.Combine(_runner.AppData, "logs", "radarr.trace.txt"); var logLines = File.ReadAllLines(logFile); var result = Movies.InvalidPost(new MovieResource()); logLines = File.ReadAllLines(logFile).Skip(logLines.Length).ToArray(); logLines.Should().Contain(v => v.Contains("|Trace|Http|Req")); logLines.Should().Contain(v => v.Contains("|Trace|Http|Res")); logLines.Should().Contain(v => v.Contains("|Debug|Api|")); }
protected override void InitializeTestTarget() { Indexers.Post(new Api.Indexers.IndexerResource { EnableRss = false, EnableSearch = false, ConfigContract = nameof(NewznabSettings), Implementation = nameof(Newznab), Name = "NewznabTest", Protocol = Core.Indexers.DownloadProtocol.Usenet, Fields = SchemaBuilder.ToSchema(new NewznabSettings()) }); // Change Console Log Level to Debug so we get more details. var config = HostConfig.Get(1); config.ConsoleLogLevel = "Debug"; HostConfig.Put(config); }
protected override void InitializeTestTarget() { WaitForCompletion(() => Tasks.All().SelectList(x => x.TaskName).Contains("CheckHealth")); Indexers.Post(new Prowlarr.Api.V1.Indexers.IndexerResource { Enable = false, ConfigContract = nameof(FileListSettings), Implementation = nameof(FileList), Name = "NewznabTest", Protocol = Core.Indexers.DownloadProtocol.Usenet, Fields = SchemaBuilder.ToSchema(new FileListSettings()) }); // Change Console Log Level to Debug so we get more details. var config = HostConfig.Get(1); config.ConsoleLogLevel = "Debug"; HostConfig.Put(config); }
public void should_log_on_error() { var config = HostConfig.Get(1); config.LogLevel = "Trace"; HostConfig.Put(config); var resultGet = Indexers.All(); var logFile = "prowlarr.trace.txt"; var logLines = Logs.GetLogFileLines(logFile); var resultPost = Indexers.InvalidPost(new Prowlarr.Api.V1.Indexers.IndexerResource()); // Skip 2 and 1 to ignore the logs endpoint logLines = Logs.GetLogFileLines(logFile).Skip(logLines.Length + 2).ToArray(); Array.Resize(ref logLines, logLines.Length - 1); logLines.Should().Contain(v => v.Contains("|Trace|Http|Req") && v.Contains("/api/v1/indexer/")); logLines.Should().Contain(v => v.Contains("|Trace|Http|Res") && v.Contains("/api/v1/indexer/: 400.BadRequest")); logLines.Should().Contain(v => v.Contains("|Debug|Api|") && v.Contains("/api/v1/indexer/: 400.BadRequest")); }
protected override void InitializeTestTarget() { // Make sure tasks have been initialized so the config put below doesn't cause errors WaitForCompletion(() => Tasks.All().SelectList(x => x.TaskName).Contains("RssSync")); Indexers.Post(new Radarr.Api.V3.Indexers.IndexerResource { EnableRss = false, EnableInteractiveSearch = false, EnableAutomaticSearch = false, ConfigContract = nameof(NewznabSettings), Implementation = nameof(Newznab), Name = "NewznabTest", Protocol = Core.Indexers.DownloadProtocol.Usenet, Fields = SchemaBuilder.ToSchema(new NewznabSettings()) }); // Change Console Log Level to Debug so we get more details. var config = HostConfig.Get(1); config.ConsoleLogLevel = "Debug"; HostConfig.Put(config); }
public void should_log_on_error() { IgnoreOnMonoVersions("5.12", "5.14"); var config = HostConfig.Get(1); config.LogLevel = "Trace"; HostConfig.Put(config); var resultGet = Author.All(); var logFile = "Readarr.trace.txt"; var logLines = Logs.GetLogFileLines(logFile); var result = Author.InvalidPost(new Readarr.Api.V1.Author.AuthorResource()); // Skip 2 and 1 to ignore the logs endpoint logLines = Logs.GetLogFileLines(logFile).Skip(logLines.Length + 2).ToArray(); Array.Resize(ref logLines, logLines.Length - 1); logLines.Should().Contain(v => v.Contains("|Trace|Http|Req") && v.Contains("/api/v1/author/")); logLines.Should().Contain(v => v.Contains("|Trace|Http|Res") && v.Contains("/api/v1/author/: 400.BadRequest")); logLines.Should().Contain(v => v.Contains("|Debug|Api|") && v.Contains("/api/v1/author/: 400.BadRequest")); }