Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenabling tests for the UI projects in CI #1807

Merged
merged 4 commits into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 78 additions & 77 deletions .github/workflows/healthchecks_ui_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,82 +59,83 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
- name: Restore UI
run: dotnet restore ./src/HealthChecks.UI/HealthChecks.UI.csproj
- name: Restore UI.Client
run: dotnet restore ./src/HealthChecks.UI.Client/HealthChecks.UI.Client.csproj
- name: Restore UI.Core
run: dotnet restore ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj
- name: Restore UI.Data
run: dotnet restore ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj
- name: Restore UI.InMemory.Storage
run: dotnet restore ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj
- name: Restore UI.MySql.Storage
run: dotnet restore ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj
- name: Restore UI.PostgreSQL.Storage
run: dotnet restore ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj
- name: Restore UI.SQLite.Storage
run: dotnet restore ./src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj
- name: Restore UI.SqlServer.Storage
run: dotnet restore ./src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj
- name: Restore UI.K8s.Operator
run: dotnet restore ./src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj
- name: Restore
run: |
dotnet restore ./src/HealthChecks.UI/HealthChecks.UI.csproj &&
dotnet restore ./test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj &&
dotnet restore ./src/HealthChecks.UI.Client/HealthChecks.UI.Client.csproj &&
dotnet restore ./test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj &&
dotnet restore ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj &&
dotnet restore ./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj &&
dotnet restore ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj &&
dotnet restore ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj &&
dotnet restore ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj &&
dotnet restore ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj &&
dotnet restore ./src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj &&
dotnet restore ./src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj &&
dotnet restore ./src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj

- name: Check formatting UI
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI/HealthChecks.UI.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.Client
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Client/HealthChecks.UI.Client.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.Core
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.Data
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.InMemory.Storage
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.MySql.Storage
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.PostgreSQL.Storage
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.SQLite.Storage
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.SqlServer.Storage
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting UI.K8s.Operator
run: dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Check formatting
run: |
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI/HealthChecks.UI.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Client/HealthChecks.UI.Client.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)

- name: Build UI
run: dotnet build --no-restore ./src/HealthChecks.UI/HealthChecks.UI.csproj
env:
NODE_OPTIONS: --openssl-legacy-provider
- name: Build UI.Client
run: dotnet build --no-restore ./src/HealthChecks.UI.Client/HealthChecks.UI.Client.csproj
- name: Build UI.Core
run: dotnet build --no-restore ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj
- name: Build UI.Data
run: dotnet build --no-restore ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj
- name: Build UI.InMemory.Storage
run: dotnet build --no-restore ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj
- name: Build UI.MySql.Storage
run: dotnet build --no-restore ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj
- name: Build UI.PostgreSQL.Storage
run: dotnet build --no-restore ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj
- name: Build UI.SQLite.Storage
run: dotnet build --no-restore ./src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj
- name: Build UI.SqlServer.Storage
run: dotnet build --no-restore ./src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj
- name: Build UI.K8s.Operator
run: dotnet build --no-restore ./src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj
#- name: Test
# run: >
# dotnet test
# ./test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj
# --no-restore
# --no-build
# --collect "XPlat Code Coverage"
# --results-directory .coverage
# --
# DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
#- name: Upload Coverage
# uses: codecov/codecov-action@v3
# with:
# flags: UI
# directory: .coverage
- name: Build
run: |
dotnet build --no-restore ./src/HealthChecks.UI/HealthChecks.UI.csproj &&
dotnet build --no-restore ./test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.Client/HealthChecks.UI.Client.csproj &&
dotnet build --no-restore ./test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.Core/HealthChecks.UI.Core.csproj &&
dotnet build --no-restore ./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj &&
dotnet build --no-restore ./src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj

- name: Test
run: >
dotnet test
./test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj
--no-restore
--no-build
--collect "XPlat Code Coverage"
--results-directory .coverage
--
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover &&
dotnet test
./test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj
--no-restore
--no-build
--collect "XPlat Code Coverage"
--results-directory .coverage
--
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover &&
dotnet test
./test/HealthChecks.UI.Core.Tests/HealthChecks.UI.Core.Tests.csproj
--no-restore
--no-build
--collect "XPlat Code Coverage"
--results-directory .coverage
--
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover

- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
flags: UI
directory: .coverage
10 changes: 5 additions & 5 deletions build/docker-images/HealthChecks.UI.Image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0.1-bullseye-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0.101-bullseye-slim AS sdk-with-node
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS sdk-with-node

ENV NODE_VERSION 8.11.1
ENV NODE_DOWNLOAD_SHA 0e20787e2eda4cc31336d8327556ebc7417e8ee0a6ba0de96a09b0ec2b841f60
ENV NODE_VERSION 18.16.0
ENV NODE_DOWNLOAD_SHA fc83046a93d2189d919005a348db3b2372b598a145d84eb9781a3a4b0f032e95
RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
&& rm nodejs.tar.gz \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs

FROM sdk-with-node AS updated-npm
RUN npm i -g npm@5
RUN npm i -g npm@9

FROM updated-npm AS build
WORKDIR /src
Expand Down
33 changes: 16 additions & 17 deletions src/HealthChecks.UI/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,35 @@ const webpack = require('webpack');
const path = require('path');

module.exports = {
devtool: 'none',
mode: "development",
devtool: "hidden-source-map",
entry: path.resolve(__dirname, "../client/index.tsx"),
resolve: {
extensions: [".tsx", ".ts", ".js", ".json"]
},
output: {
path: path.join(__dirname, "../assets"),
filename: 'healthchecks-bundle.js'
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: [".tsx", ".ts", ".js", ".json"],
// Add support for TypeScripts fully qualified ESM imports.
extensionAlias: {
".js": [".js", ".ts"],
".cjs": [".cjs", ".cts"],
".mjs": [".mjs", ".mts"]
}
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader",
exclude: [/(node_modules)/]
},
// all files with a `.ts`, `.cts`, `.mts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: "ts-loader" },
{
loader: 'url-loader',
test: /\.(png|jpg|gif|svg|woff2)$/
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
}
}
]
},
plugins: [
new webpack.DllReferencePlugin({
context: ".",
manifest: require("../assets/vendors-manifest.json")
})
]
}
};
7 changes: 3 additions & 4 deletions src/HealthChecks.UI/build/webpack.dll.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ module.exports = {
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, "../assets", "[name]-manifest.json"),
name: "[name]"
}),
new webpack.optimize.OccurrenceOrderPlugin()
]
name: "[name]"
})
]
};
Loading