main
Paul Schneider 5 years ago
parent dd0414bcd8
commit 66616e7314
11 changed files with 53 additions and 36 deletions

@ -1,10 +1,12 @@
CONFIGURATION=Debug CONFIGURATION=Debug
BINTARGET=bin/$(CONFIGURATION)/dnx451/test.dll BINTARGET=bin/$(CONFIGURATION)/dnx451/test.dll
SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/make
MSBUILD=msbuild
all: test all: test
project.lock.json: project.json include $(MAKEFILE_DIR)/dnx.mk
dnu restore --ignore-failed-sources
../Yavsc/bin/$(CONFIGURATION)/dnx451/Yavsc.dll: ../Yavsc/bin/$(CONFIGURATION)/dnx451/Yavsc.dll:
make -C ../Yavsc make -C ../Yavsc
@ -18,8 +20,13 @@ 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 $(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) dnu build --configuration $(CONFIGURATION)
breaking: non-regression: $(BINTARGET) node_modules/ansi-to-html
dnx test -trait regres=yes ASPNET_ENV=Development dnx test -maxthreads 1 -trait regression=non
regression: $(BINTARGET) node_modules/ansi-to-html
ASPNET_ENV=Development dnx test -maxthreads 1 -trait regression=oui
test: non-regression
testdev: $(BINTARGET) testdev: $(BINTARGET)
ASPNET_ENV=Development dnx test -maxthreads 1 -trait dev=wip ASPNET_ENV=Development dnx test -maxthreads 1 -trait dev=wip
@ -27,14 +34,7 @@ testdev: $(BINTARGET)
node_modules/ansi-to-html: node_modules/ansi-to-html:
npm install 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: clean:
rm -rf bin obj testingrepo rm -rf bin obj testingrepo
.PHONY: test .PHONY: test

@ -25,10 +25,8 @@ using Yavsc.Server.Models.IT.SourceCode;
namespace test namespace test
{ {
[Collection("Yavsc mandatory success story")] [Collection("Yavsc mandatory success story")]
[Trait("regres", "yes")] [Trait("regression", "oui")]
public class BatchTests: BaseTestContext, IClassFixture<ServerSideFixture>, IDisposable public class BatchTests: BaseTestContext, IClassFixture<ServerSideFixture>, IDisposable
{ {
ServerSideFixture _fixture; ServerSideFixture _fixture;

@ -22,7 +22,7 @@ using Microsoft.AspNet.Mvc.Razor;
namespace test namespace test
{ {
[Collection("Yavsc Work In Progress")] [Collection("Yavsc Work In Progress")]
[Trait("regres", "yes")] [Trait("regression", "oui")]
[Trait("module", "api")] [Trait("module", "api")]
public class RegiserAPI : BaseTestContext, IClassFixture<ServerSideFixture> public class RegiserAPI : BaseTestContext, IClassFixture<ServerSideFixture>
{ {

@ -19,7 +19,7 @@ using static OAuth.AspNet.AuthServer.Constants;
namespace test namespace test
{ {
[Collection("Yavsc Work In Progress")] [Collection("Yavsc Work In Progress")]
[Trait("regres", "yes")] [Trait("regression", "oui")]
public class Remoting : BaseTestContext, IClassFixture<ServerSideFixture> public class Remoting : BaseTestContext, IClassFixture<ServerSideFixture>
{ {
RegiserAPI r; RegiserAPI r;

@ -2,7 +2,6 @@
namespace test { namespace test {
public class ResxResources { public class ResxResources {
const string resPath = "Resources/Test.TestResources.resx"; const string resPath = "Resources/Test.TestResources.resx";
public void HaveAResxLoader() public void HaveAResxLoader()
{ {
System.Resources.ResourceReader loader = new System.Resources.ResourceReader(resPath); System.Resources.ResourceReader loader = new System.Resources.ResourceReader(resPath);

@ -6,7 +6,7 @@ using Yavsc.Helpers;
namespace test namespace test
{ {
[Collection("Yavsc Abstract tests")] [Collection("Yavsc Abstract tests")]
[Trait("regres", "no")] [Trait("regression", "non")]
public class AbstractTests public class AbstractTests
{ {
readonly ITestOutputHelper output; readonly ITestOutputHelper output;

@ -5,7 +5,7 @@ using Xunit.Abstractions;
namespace test.Mandatory namespace test.Mandatory
{ {
[Collection("Database")] [Collection("Database")]
[Trait("regres", "no")] [Trait("regression", "non")]
[Trait("dev", "wip")] [Trait("dev", "wip")]
public class Database: IClassFixture<ServerSideFixture>, IDisposable public class Database: IClassFixture<ServerSideFixture>, IDisposable
{ {

@ -7,7 +7,7 @@ namespace test
{ {
[Collection("EMaillingTeststCollection")] [Collection("EMaillingTeststCollection")]
[Trait("regres", "no")] [Trait("regression", "non")]
public class EMaillingTests : IClassFixture<ServerSideFixture> public class EMaillingTests : IClassFixture<ServerSideFixture>
{ {

@ -6,7 +6,7 @@ using System.Diagnostics;
namespace test namespace test
{ {
[Trait("regres", "no")] [Trait("regression", "non")]
public class NodeTests public class NodeTests
{ {
[Fact] [Fact]

@ -333,7 +333,6 @@ namespace test
ApplicationUser user = null; ApplicationUser user = null;
user = DbContext.Users.Include(u => u.Membership).First(u => u.UserName == context.UserName); user = DbContext.Users.Include(u => u.Membership).First(u => u.UserName == context.UserName);
#if USERMANAGER
if (await _usermanager.CheckPasswordAsync(user, context.Password)) if (await _usermanager.CheckPasswordAsync(user, context.Password))
{ {
@ -359,6 +358,7 @@ namespace test
context.HttpContext.User = principal; context.HttpContext.User = principal;
context.Validated(principal); context.Validated(principal);
} }
#if USERMANAGER
#endif #endif
return Task.FromResult(0); return Task.FromResult(0);
} }
@ -413,16 +413,17 @@ namespace test
#endregion #endregion
#if USERMANAGER
_usermanager = usermanager; UserManager<ApplicationUser> _usermanager;
#endif
public void Configure( public void Configure(
IApplicationBuilder app, IApplicationBuilder app,
IHostingEnvironment env, IHostingEnvironment env,
ApplicationDbContext dbContext, ApplicationDbContext dbContext,
IOptions<Testing> testingSettings, IOptions<Testing> testingSettings,
ILoggerFactory loggerFactory) UserManager<ApplicationUser> usermanager,
ILoggerFactory loggerFactory
)
{ {
loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug(); loggerFactory.AddDebug();
@ -430,6 +431,11 @@ namespace test
logger.LogInformation(env.EnvironmentName); logger.LogInformation(env.EnvironmentName);
this.DbContext = dbContext; this.DbContext = dbContext;
Testing = testingSettings.Value; Testing = testingSettings.Value;
_usermanager = usermanager;
#if USERMANAGER
#endif
if (Testing.ConnectionStrings == null) if (Testing.ConnectionStrings == null)
logger.LogInformation($" Testing.ConnectionStrings is null : "); logger.LogInformation($" Testing.ConnectionStrings is null : ");
else else

@ -5,6 +5,28 @@
"authors": [ "authors": [
"Paul Schneider <paul@pschneider.fr>" "Paul Schneider <paul@pschneider.fr>"
], ],
"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": { "packOptions": {
"repository": { "repository": {
"type": "git", "type": "git",
@ -18,7 +40,6 @@
"summary": "Yet another very small company", "summary": "Yet another very small company",
"projectUrl": "http://yavsc.pschneider.fr", "projectUrl": "http://yavsc.pschneider.fr",
"tags": [ "tags": [
"Blog",
"Blog", "Blog",
"PoS", "PoS",
"Chat" "Chat"
@ -64,13 +85,6 @@
"type": "build" "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", "userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f",
"scripts": { "scripts": {
"postrestore": [ "postrestore": [

Loading…