all
This commit is contained in:
@ -52,3 +52,11 @@ release:
|
||||
- make packages
|
||||
|
||||
|
||||
deploy_staging:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Deploy to staging server"
|
||||
environment:
|
||||
name: staging
|
||||
url: https://yavscpre.pschneider.fr
|
||||
|
||||
|
@ -16,7 +16,7 @@ using Microsoft.Data.Entity.Metadata.Conventions;
|
||||
|
||||
namespace test
|
||||
{
|
||||
[Trait("regres", "no")]
|
||||
[Trait("regression", "II")]
|
||||
public class ServerSideFixture : IDisposable
|
||||
{
|
||||
SiteSettings _siteSetup;
|
||||
@ -99,27 +99,42 @@ namespace test
|
||||
private readonly IHostingEngine hostengnine;
|
||||
|
||||
|
||||
|
||||
void AssertNotNull(object obj, string msg)
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception(msg);
|
||||
}
|
||||
|
||||
//
|
||||
public ServerSideFixture()
|
||||
{
|
||||
host = new WebHostBuilder();
|
||||
AssertNotNull(host, nameof(host));
|
||||
|
||||
hostengnine = host
|
||||
.UseEnvironment("Development")
|
||||
.UseServer("test")
|
||||
.UseServer("test")
|
||||
.UseStartup<test.Startup>()
|
||||
.Build();
|
||||
|
||||
AssertNotNull(hostengnine, nameof(hostengnine));
|
||||
|
||||
App = hostengnine.Start();
|
||||
|
||||
AssertNotNull(App, nameof(App));
|
||||
|
||||
// hostengnine.ApplicationServices
|
||||
|
||||
_mailer = App.Services.GetService(typeof(EMailer)) as EMailer;
|
||||
_loggerFactory = App.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
||||
var siteSetup = App.Services.GetService(typeof(IOptions<SiteSettings>)) as IOptions<SiteSettings>;
|
||||
var testingSetup = App.Services.GetService(typeof(IOptions<Testing>)) as IOptions<Testing>;
|
||||
AssertNotNull(_mailer, nameof(_mailer));
|
||||
MailSender = App.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
||||
AssertNotNull(MailSender, nameof(MailSender));
|
||||
|
||||
_loggerFactory = App.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
||||
AssertNotNull(_loggerFactory, nameof(_loggerFactory));
|
||||
var siteSetup = App.Services.GetService(typeof(IOptions<SiteSettings>)) as IOptions<SiteSettings>;
|
||||
AssertNotNull(siteSetup, nameof(siteSetup));
|
||||
var testingSetup = App.Services.GetService(typeof(IOptions<Testing>)) as IOptions<Testing>;
|
||||
DbContext = App.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
|
||||
|
||||
SiteSetup = siteSetup.Value;
|
||||
|
@ -6,7 +6,7 @@ using Yavsc.Helpers;
|
||||
namespace test
|
||||
{
|
||||
[Collection("Yavsc Abstract tests")]
|
||||
[Trait("regression", "non")]
|
||||
[Trait("regression", "II")]
|
||||
public class AbstractTests
|
||||
{
|
||||
readonly ITestOutputHelper output;
|
||||
|
@ -5,7 +5,7 @@ using Xunit.Abstractions;
|
||||
namespace test.Mandatory
|
||||
{
|
||||
[Collection("Database")]
|
||||
[Trait("regression", "non")]
|
||||
[Trait("regression", "II")]
|
||||
[Trait("dev", "wip")]
|
||||
public class Database: IClassFixture<ServerSideFixture>, IDisposable
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ namespace test
|
||||
{
|
||||
|
||||
[Collection("EMaillingTeststCollection")]
|
||||
[Trait("regression", "non")]
|
||||
[Trait("regression", "II")]
|
||||
public class EMaillingTests : IClassFixture<ServerSideFixture>
|
||||
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ namespace test
|
||||
/// Since node isn't any requirement by here,
|
||||
/// It may regress
|
||||
/// </summary>
|
||||
[Trait("regression", "oui")]
|
||||
[Trait("regression", "allways")]
|
||||
public class NodeTests
|
||||
{
|
||||
void TestNodeJsForAnsitohtml ()
|
||||
|
@ -47,6 +47,7 @@ using Microsoft.AspNet.DataProtection.Infrastructure;
|
||||
using System.IO;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Yavsc.Auth;
|
||||
using Yavsc.Lib;
|
||||
|
||||
namespace test
|
||||
{
|
||||
@ -114,7 +115,10 @@ namespace test
|
||||
services.AddEntityFramework().AddNpgsql().AddDbContext<ApplicationDbContext>();
|
||||
services.AddTransient((s) => new RazorTemplateEngine(s.GetService<RazorEngineHost>()));
|
||||
services.AddLogging();
|
||||
services.AddTransient<ServerSideFixture>();
|
||||
services.AddTransient<MailSender>();
|
||||
services.AddTransient<EMailer>();
|
||||
|
||||
services.AddLocalization(options =>
|
||||
{
|
||||
options.ResourcesPath = "Resources";
|
||||
|
Reference in New Issue
Block a user