mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Integration tests on Mono 5.12 and 5.14
Mono 5.12 and 5.14 has a bug that means RestSharp can't handle non-200 responses. Fix status api call so tests start and disable the tests that use non-200 responses on these mono versions
This commit is contained in:
@@ -11,6 +11,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test, Order(0)]
|
[Test, Order(0)]
|
||||||
public void add_downloadclient_without_name_should_return_badrequest()
|
public void add_downloadclient_without_name_should_return_badrequest()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
EnsureNoDownloadClient();
|
EnsureNoDownloadClient();
|
||||||
|
|
||||||
var schema = DownloadClients.Schema().First(v => v.Implementation == "UsenetBlackhole");
|
var schema = DownloadClients.Schema().First(v => v.Implementation == "UsenetBlackhole");
|
||||||
@@ -25,6 +27,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test, Order(0)]
|
[Test, Order(0)]
|
||||||
public void add_downloadclient_without_nzbfolder_should_return_badrequest()
|
public void add_downloadclient_without_nzbfolder_should_return_badrequest()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
EnsureNoDownloadClient();
|
EnsureNoDownloadClient();
|
||||||
|
|
||||||
var schema = DownloadClients.Schema().First(v => v.Implementation == "UsenetBlackhole");
|
var schema = DownloadClients.Schema().First(v => v.Implementation == "UsenetBlackhole");
|
||||||
@@ -39,6 +43,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test, Order(0)]
|
[Test, Order(0)]
|
||||||
public void add_downloadclient_without_watchfolder_should_return_badrequest()
|
public void add_downloadclient_without_watchfolder_should_return_badrequest()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
EnsureNoDownloadClient();
|
EnsureNoDownloadClient();
|
||||||
|
|
||||||
var schema = DownloadClients.Schema().First(v => v.Implementation == "UsenetBlackhole");
|
var schema = DownloadClients.Schema().First(v => v.Implementation == "UsenetBlackhole");
|
||||||
@@ -90,6 +96,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void get_downloadclient_by_unknown_id_should_return_404()
|
public void get_downloadclient_by_unknown_id_should_return_404()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var result = DownloadClients.InvalidGet(1000000);
|
var result = DownloadClients.InvalidGet(1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,6 +32,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test, Order(0)]
|
[Test, Order(0)]
|
||||||
public void add_movie_without_profileid_should_return_badrequest()
|
public void add_movie_without_profileid_should_return_badrequest()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
EnsureNoMovie(680, "Pulp Fiction");
|
EnsureNoMovie(680, "Pulp Fiction");
|
||||||
|
|
||||||
var movie = Movies.Lookup("imdb:tt0110912").Single();
|
var movie = Movies.Lookup("imdb:tt0110912").Single();
|
||||||
@@ -44,6 +46,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test, Order(0)]
|
[Test, Order(0)]
|
||||||
public void add_movie_without_path_should_return_badrequest()
|
public void add_movie_without_path_should_return_badrequest()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
EnsureNoMovie(680, "Pulp Fiction");
|
EnsureNoMovie(680, "Pulp Fiction");
|
||||||
|
|
||||||
var movie = Movies.Lookup("imdb:tt0110912").Single();
|
var movie = Movies.Lookup("imdb:tt0110912").Single();
|
||||||
@@ -96,6 +100,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void get_movie_by_unknown_id_should_return_404()
|
public void get_movie_by_unknown_id_should_return_404()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var result = Movies.InvalidGet(1000000);
|
var result = Movies.InvalidGet(1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,6 +37,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_get_bad_request_if_standard_format_is_empty()
|
public void should_get_bad_request_if_standard_format_is_empty()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var config = NamingConfig.GetSingle();
|
var config = NamingConfig.GetSingle();
|
||||||
config.RenameMovies = true;
|
config.RenameMovies = true;
|
||||||
config.StandardMovieFormat = "";
|
config.StandardMovieFormat = "";
|
||||||
@@ -48,6 +50,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_get_bad_request_if_standard_format_doesnt_contain_title()
|
public void should_get_bad_request_if_standard_format_doesnt_contain_title()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var config = NamingConfig.GetSingle();
|
var config = NamingConfig.GetSingle();
|
||||||
config.RenameMovies = true;
|
config.RenameMovies = true;
|
||||||
config.StandardMovieFormat = "{quality}";
|
config.StandardMovieFormat = "{quality}";
|
||||||
@@ -59,6 +63,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_not_require_format_when_rename_episodes_is_false()
|
public void should_not_require_format_when_rename_episodes_is_false()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var config = NamingConfig.GetSingle();
|
var config = NamingConfig.GetSingle();
|
||||||
config.RenameMovies = false;
|
config.RenameMovies = false;
|
||||||
config.StandardMovieFormat = "";
|
config.StandardMovieFormat = "";
|
||||||
@@ -70,6 +76,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_require_format_when_rename_episodes_is_true()
|
public void should_require_format_when_rename_episodes_is_true()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var config = NamingConfig.GetSingle();
|
var config = NamingConfig.GetSingle();
|
||||||
config.RenameMovies = true;
|
config.RenameMovies = true;
|
||||||
config.StandardMovieFormat = "";
|
config.StandardMovieFormat = "";
|
||||||
@@ -81,6 +89,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_get_bad_request_if_movie_folder_format_does_not_contain_movie_title()
|
public void should_get_bad_request_if_movie_folder_format_does_not_contain_movie_title()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var config = NamingConfig.GetSingle();
|
var config = NamingConfig.GetSingle();
|
||||||
config.RenameMovies = true;
|
config.RenameMovies = true;
|
||||||
config.MovieFolderFormat = "This and That";
|
config.MovieFolderFormat = "This and That";
|
||||||
|
@@ -44,6 +44,8 @@ namespace NzbDrone.Integration.Test.ApiTests
|
|||||||
[Test]
|
[Test]
|
||||||
public void invalid_path_should_return_bad_request()
|
public void invalid_path_should_return_bad_request()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var rootFolder = new RootFolderResource
|
var rootFolder = new RootFolderResource
|
||||||
{
|
{
|
||||||
Path = "invalid_path"
|
Path = "invalid_path"
|
||||||
|
@@ -36,6 +36,7 @@ namespace NzbDrone.Integration.Test
|
|||||||
[TestCase("application/junk")]
|
[TestCase("application/junk")]
|
||||||
public void should_get_unacceptable_with_accept_header(string header)
|
public void should_get_unacceptable_with_accept_header(string header)
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var request = new RestRequest("system/status")
|
var request = new RestRequest("system/status")
|
||||||
{
|
{
|
||||||
|
@@ -11,6 +11,8 @@ namespace NzbDrone.Integration.Test
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_log_on_error()
|
public void should_log_on_error()
|
||||||
{
|
{
|
||||||
|
IgnoreOnMonoVersions("5.12", "5.14");
|
||||||
|
|
||||||
var config = HostConfig.Get(1);
|
var config = HostConfig.Get(1);
|
||||||
config.LogLevel = "Trace";
|
config.LogLevel = "Trace";
|
||||||
HostConfig.Put(config);
|
HostConfig.Put(config);
|
||||||
|
@@ -162,6 +162,22 @@ namespace NzbDrone.Integration.Test
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void IgnoreOnMonoVersions(params string[] version_strings)
|
||||||
|
{
|
||||||
|
if (!PlatformInfo.IsMono)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var current = PlatformInfo.GetVersion();
|
||||||
|
var versions = version_strings.Select(x => new Version(x)).ToList();
|
||||||
|
|
||||||
|
if (versions.Any(x => x.Major == current.Major && x.Minor == current.Minor))
|
||||||
|
{
|
||||||
|
throw new IgnoreException($"Ignored on mono {PlatformInfo.GetVersion()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GetTempDirectory(params string[] args)
|
public string GetTempDirectory(params string[] args)
|
||||||
{
|
{
|
||||||
var path = Path.Combine(TempDirectory, Path.Combine(args));
|
var path = Path.Combine(TempDirectory, Path.Combine(args));
|
||||||
|
Reference in New Issue
Block a user