From 66616e7314de09ffec8fa9f32dd686935ab9b7bf Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 4 Jan 2021 00:11:27 +0000 Subject: [PATCH] reorg --- src/test/Makefile | 24 +++++++-------- src/test/Mandatory/BatchTests.cs | 4 +-- src/test/Mandatory/RegisterApi.cs | 2 +- src/test/Mandatory/Remoting.cs | 2 +- src/test/Mandatory/Resources.cs | 3 +- .../AbstractTests.cs | 2 +- .../{Mandatory => NonRegression}/Database.cs | 2 +- .../{Mandatory => NonRegression}/EMailling.cs | 2 +- .../{Mandatory => NonRegression}/NodeTests.cs | 2 +- src/test/Startup.cs | 16 ++++++---- src/test/project.json | 30 ++++++++++++++----- 11 files changed, 53 insertions(+), 36 deletions(-) rename src/test/{Mandatory => NonRegression}/AbstractTests.cs (96%) rename src/test/{Mandatory => NonRegression}/Database.cs (97%) rename src/test/{Mandatory => NonRegression}/EMailling.cs (97%) rename src/test/{Mandatory => NonRegression}/NodeTests.cs (98%) diff --git a/src/test/Makefile b/src/test/Makefile index f0dd0f7d..bb79a275 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -1,10 +1,12 @@ CONFIGURATION=Debug BINTARGET=bin/$(CONFIGURATION)/dnx451/test.dll +SOURCE_DIR=$(HOME)/workspace/yavsc +MAKEFILE_DIR=$(SOURCE_DIR)/scripts/make +MSBUILD=msbuild all: test -project.lock.json: project.json - dnu restore --ignore-failed-sources +include $(MAKEFILE_DIR)/dnx.mk ../Yavsc/bin/$(CONFIGURATION)/dnx451/Yavsc.dll: make -C ../Yavsc @@ -18,23 +20,21 @@ project.lock.json: project.json $(BINTARGET): project.lock.json ../Yavsc/bin/$(CONFIGURATION)/dnx451/Yavsc.dll ../Yavsc.Abstract/bin/$(CONFIGURATION)/dnx451/Yavsc.Abstract.dll ../Yavsc.Server/bin/$(CONFIGURATION)/dnx451/Yavsc.Server.dll dnu build --configuration $(CONFIGURATION) -breaking: - dnx test -trait regres=yes +non-regression: $(BINTARGET) node_modules/ansi-to-html + ASPNET_ENV=Development dnx test -maxthreads 1 -trait regression=non -testdev: $(BINTARGET) +regression: $(BINTARGET) node_modules/ansi-to-html + ASPNET_ENV=Development dnx test -maxthreads 1 -trait regression=oui + +test: non-regression + +testdev: $(BINTARGET) ASPNET_ENV=Development dnx test -maxthreads 1 -trait dev=wip node_modules/ansi-to-html: npm install ansi-to-html -test: $(BINTARGET) node_modules/ansi-to-html - ASPNET_ENV=Development dnx test -maxthreads 1 -trait regres=no - -restore: - dnu restore --ignore-failed-sources - clean: rm -rf bin obj testingrepo .PHONY: test - diff --git a/src/test/Mandatory/BatchTests.cs b/src/test/Mandatory/BatchTests.cs index f0032d19..da3027dc 100644 --- a/src/test/Mandatory/BatchTests.cs +++ b/src/test/Mandatory/BatchTests.cs @@ -25,10 +25,8 @@ using Yavsc.Server.Models.IT.SourceCode; namespace test { - - [Collection("Yavsc mandatory success story")] - [Trait("regres", "yes")] + [Trait("regression", "oui")] public class BatchTests: BaseTestContext, IClassFixture, IDisposable { ServerSideFixture _fixture; diff --git a/src/test/Mandatory/RegisterApi.cs b/src/test/Mandatory/RegisterApi.cs index dec1e96c..f228b2bf 100644 --- a/src/test/Mandatory/RegisterApi.cs +++ b/src/test/Mandatory/RegisterApi.cs @@ -22,7 +22,7 @@ using Microsoft.AspNet.Mvc.Razor; namespace test { [Collection("Yavsc Work In Progress")] - [Trait("regres", "yes")] + [Trait("regression", "oui")] [Trait("module", "api")] public class RegiserAPI : BaseTestContext, IClassFixture { diff --git a/src/test/Mandatory/Remoting.cs b/src/test/Mandatory/Remoting.cs index 65f753fe..a3b69a8a 100644 --- a/src/test/Mandatory/Remoting.cs +++ b/src/test/Mandatory/Remoting.cs @@ -19,7 +19,7 @@ using static OAuth.AspNet.AuthServer.Constants; namespace test { [Collection("Yavsc Work In Progress")] - [Trait("regres", "yes")] + [Trait("regression", "oui")] public class Remoting : BaseTestContext, IClassFixture { RegiserAPI r; diff --git a/src/test/Mandatory/Resources.cs b/src/test/Mandatory/Resources.cs index 599292d4..641f267a 100644 --- a/src/test/Mandatory/Resources.cs +++ b/src/test/Mandatory/Resources.cs @@ -2,7 +2,6 @@ namespace test { public class ResxResources { const string resPath = "Resources/Test.TestResources.resx"; - public void HaveAResxLoader() { System.Resources.ResourceReader loader = new System.Resources.ResourceReader(resPath); @@ -20,4 +19,4 @@ namespace test { } } -} \ No newline at end of file +} diff --git a/src/test/Mandatory/AbstractTests.cs b/src/test/NonRegression/AbstractTests.cs similarity index 96% rename from src/test/Mandatory/AbstractTests.cs rename to src/test/NonRegression/AbstractTests.cs index 6c953645..36dd27cb 100644 --- a/src/test/Mandatory/AbstractTests.cs +++ b/src/test/NonRegression/AbstractTests.cs @@ -6,7 +6,7 @@ using Yavsc.Helpers; namespace test { [Collection("Yavsc Abstract tests")] - [Trait("regres", "no")] + [Trait("regression", "non")] public class AbstractTests { readonly ITestOutputHelper output; diff --git a/src/test/Mandatory/Database.cs b/src/test/NonRegression/Database.cs similarity index 97% rename from src/test/Mandatory/Database.cs rename to src/test/NonRegression/Database.cs index 9abb6008..21de12fd 100644 --- a/src/test/Mandatory/Database.cs +++ b/src/test/NonRegression/Database.cs @@ -5,7 +5,7 @@ using Xunit.Abstractions; namespace test.Mandatory { [Collection("Database")] - [Trait("regres", "no")] + [Trait("regression", "non")] [Trait("dev", "wip")] public class Database: IClassFixture, IDisposable { diff --git a/src/test/Mandatory/EMailling.cs b/src/test/NonRegression/EMailling.cs similarity index 97% rename from src/test/Mandatory/EMailling.cs rename to src/test/NonRegression/EMailling.cs index 1013da78..799502c4 100644 --- a/src/test/Mandatory/EMailling.cs +++ b/src/test/NonRegression/EMailling.cs @@ -7,7 +7,7 @@ namespace test { [Collection("EMaillingTeststCollection")] - [Trait("regres", "no")] + [Trait("regression", "non")] public class EMaillingTests : IClassFixture { diff --git a/src/test/Mandatory/NodeTests.cs b/src/test/NonRegression/NodeTests.cs similarity index 98% rename from src/test/Mandatory/NodeTests.cs rename to src/test/NonRegression/NodeTests.cs index 5863e4b3..60261ce3 100755 --- a/src/test/Mandatory/NodeTests.cs +++ b/src/test/NonRegression/NodeTests.cs @@ -6,7 +6,7 @@ using System.Diagnostics; namespace test { - [Trait("regres", "no")] + [Trait("regression", "non")] public class NodeTests { [Fact] diff --git a/src/test/Startup.cs b/src/test/Startup.cs index 17cc8f66..bb30177a 100644 --- a/src/test/Startup.cs +++ b/src/test/Startup.cs @@ -333,7 +333,6 @@ namespace test ApplicationUser user = null; user = DbContext.Users.Include(u => u.Membership).First(u => u.UserName == context.UserName); -#if USERMANAGER if (await _usermanager.CheckPasswordAsync(user, context.Password)) { @@ -359,6 +358,7 @@ namespace test context.HttpContext.User = principal; context.Validated(principal); } +#if USERMANAGER #endif return Task.FromResult(0); } @@ -413,16 +413,17 @@ namespace test #endregion -#if USERMANAGER - _usermanager = usermanager; -#endif + + UserManager _usermanager; public void Configure( IApplicationBuilder app, IHostingEnvironment env, ApplicationDbContext dbContext, IOptions testingSettings, - ILoggerFactory loggerFactory) + UserManager usermanager, + ILoggerFactory loggerFactory + ) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); @@ -430,6 +431,11 @@ namespace test logger.LogInformation(env.EnvironmentName); this.DbContext = dbContext; Testing = testingSettings.Value; + + _usermanager = usermanager; +#if USERMANAGER +#endif + if (Testing.ConnectionStrings == null) logger.LogInformation($" Testing.ConnectionStrings is null : "); else diff --git a/src/test/project.json b/src/test/project.json index 471c8a0f..397c6703 100644 --- a/src/test/project.json +++ b/src/test/project.json @@ -5,6 +5,28 @@ "authors": [ "Paul Schneider " ], + "resource": "Resources/**/*.resx", + "buildOptions": { + "debugType": "full", + "emitEntryPoint": true, + "compile": { + "include": "*.cs", + "exclude": [ + "contrib" + ] + }, + "embed": [ + "Resources/**/*.resx" + ], + "define": ["USERMANAGER"] + }, + "frameworks": { + "dnx451": {} + }, + "commands": { + "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls https://*:5001", + "test": "xunit.runner.dnx" + }, "packOptions": { "repository": { "type": "git", @@ -18,7 +40,6 @@ "summary": "Yet another very small company", "projectUrl": "http://yavsc.pschneider.fr", "tags": [ - "Blog", "Blog", "PoS", "Chat" @@ -64,13 +85,6 @@ "type": "build" } }, - "frameworks": { - "dnx451": {} - }, - "commands": { - "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls https://*:5001", - "test": "xunit.runner.dnx" - }, "userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f", "scripts": { "postrestore": [