diff --git a/.travis.yml b/.travis.yml index 6b860e4..612b942 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,28 @@ jobs: include: -# - stage: Build -# language: csharp -# dist: xenial -# mono: none -# dotnet: 3.1 -# install: -# - dotnet clean -# - dotnet restore -# script: -# - dotnet build + - stage: Build + language: csharp + dist: xenial + mono: none + dotnet: 3.1 + install: + - dotnet clean + - dotnet restore + script: + - dotnet build - - stage: test + - stage: Unit tests + language: node_js + node_js: + - 12.15.0 + before_install: + - cd Chat.Web/Client/ + install: + - npm install + script: + - npm test + + - stage: Integration tests language: csharp mono: none dotnet: 3.1 @@ -27,16 +38,6 @@ jobs: - bash Scripts/wait-until-service-is-up.sh - xvfb-run --auto-servernum --server-num=1 --server-args="-screen 0 1024x768x24" dotnet test Chat.Tests.Integration -# - language: node_js -# node_js: -# - 12.15.0 -# before_install: -# - cd Chat.Web/Client/ -# install: -# - npm install -# script: -# - npm test - - stage: Deploy language: minimal services: @@ -57,7 +58,12 @@ jobs: skip_cleanup: true stages: - - Test + - name: Build + if: type != pull_request + - name: Unit tests + if: type != pull_request + - name: Integration tests + if: type = pull_request - name: Deploy if: branch = master AND type != pull_request branches: diff --git a/Chat.Web/Middlewares/HealthCheckMiddleware.cs b/Chat.Web/Middlewares/HealthCheckMiddleware.cs deleted file mode 100644 index 8548edc..0000000 --- a/Chat.Web/Middlewares/HealthCheckMiddleware.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.Net.Http.Headers; - -namespace Chat.Web.Middlewares -{ - public class HealthCheckMiddleware - { - private const string _path = "/healthcheck"; - private readonly RequestDelegate _next; - - public HealthCheckMiddleware(RequestDelegate next) - { - _next = next; - } - - public async Task Invoke(HttpContext context) - { - if (!context.Request.Path.Equals(_path, StringComparison.OrdinalIgnoreCase)) - { - await _next(context); - } - else - { - context.Response.ContentType = "text/plain"; - context.Response.StatusCode = 200; - context.Response.Headers.Add(HeaderNames.Connection, "close"); - await context.Response.WriteAsync("OK"); - } - } - } -}