integration-tests
Robert Dailey 5 months ago
parent db6cf7f897
commit 27f90d7516

@ -82,6 +82,9 @@ internal static class Program
_log = _scope.Resolve<ILogger>();
_log.Debug("Recyclarr Version: {Version}", GitVersionInformation.InformationalVersion);
var paths = _scope.Resolve<IAppPaths>();
_log.Debug("App Data Dir: {AppData}", paths.AppDataDirectory);
_tasks = _scope.Resolve<IOrderedEnumerable<IBaseCommandSetupTask>>().ToArray();
_tasks.ForEach(x => x.OnStart());
}

@ -1,10 +1,9 @@
using System.IO.Abstractions;
using Serilog;
namespace Recyclarr.Platform;
// Do NOT inject ILogger here because it introduces a circular dependency. LoggerFactory depends on IAppPaths.
public class DefaultAppDataSetup(
ILogger log,
IEnvironment env,
IFileSystem fs,
IRuntimeInformation runtimeInfo)
@ -14,8 +13,6 @@ public class DefaultAppDataSetup(
var appDir = GetAppDataDirectory(appDataDirectoryOverride);
var paths = new AppPaths(fs.DirectoryInfo.New(appDir));
log.Debug("App Data Dir: {AppData}", paths.AppDataDirectory);
// Initialize other directories used throughout the application
// Do not initialize the repo directory here; the GitRepositoryFactory handles that later.
paths.CacheDirectory.Create();

@ -7,11 +7,6 @@ public class PlatformAutofacModule : Module
protected override void Load(ContainerBuilder builder)
{
base.Load(builder);
RegisterAppPaths(builder);
}
private static void RegisterAppPaths(ContainerBuilder builder)
{
builder.RegisterType<DefaultAppDataSetup>();
builder.RegisterType<DefaultEnvironment>().As<IEnvironment>();
builder.RegisterType<DefaultRuntimeInformation>().As<IRuntimeInformation>();

@ -14,6 +14,7 @@ namespace Recyclarr.Cli.IntegrationTests;
public abstract class IntegrationTestFixture2 : IDisposable
{
private readonly Lazy<ILifetimeScope> _container;
protected ILifetimeScope Container => _container.Value;
protected MockFileSystem Fs { get; }
protected TestConsole Console { get; } = new();

Loading…
Cancel
Save