Skip to content

Commit

Permalink
test(e2e): add health check and functional tests (#110)
Browse files Browse the repository at this point in the history
add following e2e health check and functional tests:
Interface Partner Health Check (BPDM, ClearingHouse, SdFactory, Wallet),
System Health Check (DB API tests and BaseDataLoadCheck),
Notification init scenario,
Registration scenarios,
Service account CUD scenarios,
Create app scenario.

as well as a GH workflow for manual trigger.
  • Loading branch information
irinamesh authored and evegufy committed Sep 21, 2023
1 parent aae9911 commit 1504e56
Show file tree
Hide file tree
Showing 49 changed files with 3,746 additions and 13 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/test-automation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
###############################################################
###############################################################
# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
Expand Down Expand Up @@ -60,14 +60,14 @@ jobs:
project: ${{ secrets.REPORTPORTAL_PROJECT }}
uuid: ${{ secrets.REPORTPORTAL_AUTHENTICATION_UUID }}
url: ${{ vars.REPORTPORTAL_URL }}
run:
echo "project"
echo "uuid"
run: |
cd tests/endtoend
jq --arg project "$project" \
--arg uuid "$uuid" \
--arg url "$url" \
'.server |= ( .project = $project | .authentication.uuid = $uuid | .url = $url )' \
ReportPortal.config.json > temp.json && mv temp.json ReportPortal.config.json
ReportPortal.config.json > temp.json
mv temp.json ReportPortal.config.json
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Build
run: dotnet build src --configuration Release --no-restore
- name: Tests - Interface Health Check
if: contains(fromJSON('["all", "interface health check"]'), github.event.inputs.test_category)
if: contains(fromJSON('["interface health check"]'), github.event.inputs.test_category)
continue-on-error: true # required for now as health checks still fail at the moment
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
Expand All @@ -100,7 +100,7 @@ jobs:
name: e2e-test-report
path: tests/endtoend/TestResults/e2eInterfaceHealthCheckResults.html
- name: Tests - Portal Health Check
if: contains(fromJSON('["all", "portal health check"]'), github.event.inputs.test_category)
if: contains(fromJSON('["portal health check"]'), github.event.inputs.test_category)
continue-on-error: true # required for now
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
Expand All @@ -118,7 +118,7 @@ jobs:
name: e2e-test-report
path: tests/endtoend/TestResults/e2ePortalHealthCheckResults.html
- name: Tests - Registration Tests
if: contains(fromJSON('["all", "registration"]'), github.event.inputs.test_category)
if: contains(fromJSON('["registration"]'), github.event.inputs.test_category)
continue-on-error: true # required as registration can fail
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
Expand All @@ -137,7 +137,7 @@ jobs:
name: e2e-test-report
path: tests/endtoend/TestResults/e2eRegistrationTestResults.html
- name: Tests - Portal Tests
if: contains(fromJSON('["all", "portal"]'), github.event.inputs.test_category)
if: contains(fromJSON('["portal"]'), github.event.inputs.test_category)
continue-on-error: true # required for now
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
Expand All @@ -156,3 +156,32 @@ jobs:
with:
name: e2e-test-report
path: tests/endtoend/TestResults/e2ePortalTestResults.html
- name: Tests - All E2E Tests
if: contains(fromJSON('["all"]'), github.event.inputs.test_category)
continue-on-error: true
env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
BASE_PORTAL_URL: ${{ vars.BASE_PORTAL_URL }}
BASE_CENTRAL_IDP_URL: ${{ vars.BASE_CENTRAL_IDP_URL }}
CLEARING_HOUSE_URL: ${{ vars.CLEARING_HOUSE_URL }}
CLEARING_HOUSE_TOKEN_URL: ${{ vars.CLEARING_HOUSE_TOKEN_URL }}
SD_FACTORY_BASE_URL: ${{ vars.SD_FACTORY_BASE_URL }}
WALLET_BASE_URL: ${{ vars.WALLET_BASE_URL }}
BPDM_URL: ${{ vars.BPDM_URL }}
INTERFACE_HEALTH_CHECK_TECH_CLIENT_ID: ${{ secrets.INTERFACE_HEALTH_CHECK_TECH_CLIENT_ID }}
INTERFACE_HEALTH_CHECK_TECH_CLIENT_SECRET: ${{ secrets.INTERFACE_HEALTH_CHECK_TECH_CLIENT_SECRET }}
CLEARING_HOUSE_CLIENT_ID: ${{ secrets.CLEARING_HOUSE_CLIENT_ID }}
CLEARING_HOUSE_CLIENT_SECRET: ${{ secrets.CLEARING_HOUSE_CLIENT_SECRET }}
NOTIFICATION_OFFER_ID: ${{ vars.NOTIFICATION_OFFER_ID }}
PORTAL_USER_COMPANY_NAME: ${{ vars.PORTAL_USER_COMPANY_NAME }}
BASE_PORTAL_BACKEND_URL: ${{ vars.BASE_PORTAL_BACKEND_URL }}
TEMPMAIL_APIKEY: ${{ secrets.TEMPMAIL_APIKEY }}
PORTAL_USER_NAME: ${{ secrets.PORTAL_USER_NAME }}
PORTAL_USER_PASSWORD: ${{ secrets.PORTAL_USER_PASSWORD }}
run: dotnet test tests/endtoend --no-restore --verbosity minimal --logger "html;logfilename=e2eAllResults.html"
- name: 'Upload Artifact'
if: always()
uses: actions/upload-artifact@v3
with:
name: e2e-test-report
path: tests/endtoend/TestResults/e2eAllResults.html
2 changes: 1 addition & 1 deletion .github/workflows/unit.tests-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
- name: Check Format
run: dotnet format src --verify-no-changes --no-restore
- name: Test
run: dotnet test src --no-restore --verbosity normal
run: dotnet test src --filter FullyQualifiedName\!~Org.Eclipse.TractusX.Portal.Backend.EndToEnd.Tests --no-restore --verbosity normal
12 changes: 11 additions & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,28 @@ nuget/nuget/-/Fare/2.1.1, MIT, approved, clearlydefined
nuget/nuget/-/FluentAssertions/6.11.0, Apache-2.0 AND MIT, approved, #10061
nuget/nuget/-/Flurl.Http.Signed/3.2.4, MIT, approved, #3503
nuget/nuget/-/Flurl.Signed/3.0.6, MIT, approved, #3501
nuget/nuget/-/HtmlAgilityPack/1.11.49, MIT, approved, #9293
nuget/nuget/-/Humanizer.Core/2.14.1, MIT, approved, #10060
nuget/nuget/-/Laraue.EfCoreTriggers.Common/7.1.1, MIT, approved, #10247
nuget/nuget/-/Laraue.EfCoreTriggers.PostgreSql/7.1.1, MIT, approved, #10248
nuget/nuget/-/MailKit/4.1.0, MIT, approved, #10076
nuget/nuget/-/MimeKit/4.1.0, BSD-3-Clause AND LicenseRef-Permission-Notice AND LicenseRef-FSF AND LicenseRef-Permissive-license-with-conditions AND MIT AND CC-PDDC, approved, #10079
nuget/nuget/-/Mono.TextTemplating/2.2.1, MIT, approved, clearlydefined
nuget/nuget/-/NHamcrest/3.2.0, MIT, approved, #9299
nuget/nuget/-/NJsonSchema/10.9.0, MIT, approved, #9300
nuget/nuget/-/Namotion.Reflection/2.1.2, MIT, approved, #9320
nuget/nuget/-/Newtonsoft.Json/12.0.2, MIT, approved, clearlydefined
nuget/nuget/-/Newtonsoft.Json/13.0.1, MIT AND BSD-3-Clause, approved, #3266
nuget/nuget/-/Newtonsoft.Json/13.0.2, MIT AND BSD-3-Clause, approved, #3266
nuget/nuget/-/Newtonsoft.Json/13.0.3, MIT AND BSD-3-Clause, approved, #3266
nuget/nuget/-/Newtonsoft.Json/9.0.1, MIT, approved, clearlydefined
nuget/nuget/-/Npgsql.EntityFrameworkCore.PostgreSQL/7.0.4, PostgreSQL AND MIT AND Apache-2.0, approved, #10081
nuget/nuget/-/Npgsql/7.0.4, PostgreSQL, approved, #10062
nuget/nuget/-/PasswordGenerator/2.1.0, MIT, approved, #3192
nuget/nuget/-/Portable.BouncyCastle/1.9.0, MIT, approved, clearlydefined
nuget/nuget/-/ReportPortal.Client/3.4.0, Apache-2.0, approved, #9298
nuget/nuget/-/ReportPortal.Shared/3.5.0, Apache-2.0, approved, #9301
nuget/nuget/-/ReportPortal.XUnit/2.4.5, Apache-2.0, approved, #9296
nuget/nuget/-/RestAssured.Net/4.0.0, Apache-2.0, approved, #9294
nuget/nuget/-/SSH.NET/2020.0.2, MIT AND ISC AND LicenseRef-Public-domain AND (MIT AND MS-PL), approved, #10073
nuget/nuget/-/Serilog.AspNetCore/7.0.0, Apache-2.0 AND MIT, approved, #10084
nuget/nuget/-/Serilog.Enrichers.CorrelationId/3.0.1, MIT, approved, clearlydefined
Expand All @@ -38,6 +47,7 @@ nuget/nuget/-/Serilog.Sinks.File/5.0.0, Apache-2.0, approved, clearlydefined
nuget/nuget/-/Serilog/3.0.1, Apache-2.0, approved, #10063
nuget/nuget/-/SharpZipLib/1.4.2, MIT AND GFDL-1.3-or-later AND (Apache-2.0 AND MIT) AND WTFPL AND bzip2-1.0.6 AND LicenseRef-Permissive-license-with-conditions AND LicenseRef-Permission-Notice, approved, #10058
nuget/nuget/-/SshNet.Security.Cryptography/1.3.0, MIT, approved, clearlydefined
nuget/nuget/-/Stubble.Core/1.10.8, MIT AND BSD-2-Clause, approved, #9297
nuget/nuget/-/SwashBuckle.AspNetCore/6.5.0, MIT AND Apache-2.0, approved, #7159
nuget/nuget/-/Swashbuckle.AspNetCore.Swagger/6.5.0, MIT AND Apache-2.0, approved, #7160
nuget/nuget/-/Swashbuckle.AspNetCore.SwaggerGen/6.5.0, MIT AND Apache-2.0, approved, #7156
Expand Down
15 changes: 15 additions & 0 deletions src/Portal.Backend.sln
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.Models.Tests", "..\tests\framework\Framework.Models.Tests\Framework.Models.Tests.csproj", "{EA9BA26E-83F6-47C4-BA3B-880AF1AD6A82}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.ProcessIdentity", "framework\Framework.ProcessIdentity\Framework.ProcessIdentity.csproj", "{4CA307AB-A0F8-4AA5-A09D-91F47DA3054A}"
EmdProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndToEnd.Tests", "..\tests\endtoend\EndToEnd.Tests.csproj", "{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework.PublicInfos", "framework\Framework.PublicInfos\Framework.PublicInfos.csproj", "{47E089E3-E875-4045-9E58-C1223BE899E9}"
EndProject
Expand Down Expand Up @@ -1352,6 +1354,18 @@ Global
{A5BEDD89-7280-466E-8D14-EC5E177AAD07}.Release|x64.Build.0 = Release|Any CPU
{A5BEDD89-7280-466E-8D14-EC5E177AAD07}.Release|x86.ActiveCfg = Release|Any CPU
{A5BEDD89-7280-466E-8D14-EC5E177AAD07}.Release|x86.Build.0 = Release|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Debug|x64.ActiveCfg = Debug|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Debug|x64.Build.0 = Debug|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Debug|x86.ActiveCfg = Debug|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Debug|x86.Build.0 = Debug|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Release|Any CPU.Build.0 = Release|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Release|x64.ActiveCfg = Release|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Release|x64.Build.0 = Release|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Release|x86.ActiveCfg = Release|Any CPU
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB}.Release|x86.Build.0 = Release|Any CPU
{6113B579-C995-47F8-9AC1-4CC6EFDDD883}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6113B579-C995-47F8-9AC1-4CC6EFDDD883}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6113B579-C995-47F8-9AC1-4CC6EFDDD883}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -1526,6 +1540,7 @@ Global
{47E089E3-E875-4045-9E58-C1223BE899E9} = {23500169-FC01-4D2B-A997-E7FAE2169FC0}
{9D574E57-75A6-4965-AF23-ACE0BB9CD0B3} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{E1D41A07-F468-4D13-8185-35F127230B17} = {46383371-8252-4598-9350-A97692851408}
{5D70E30D-E9A2-472B-9834-BDB9824F8DEB} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
{6113B579-C995-47F8-9AC1-4CC6EFDDD883} = {68D43DB1-DFC5-4F15-A2B4-6BA18B875F9E}
{19639645-A115-4824-865F-5559DA8B892A} = {282CEF03-292F-4A49-83C6-997567D0FF5F}
{3B41408A-CDFE-4EEE-9660-FE6755FD2075} = {323C198D-A8C6-4EB0-8B79-72624275E35F}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ public enum NotificationTypeId
SERVICE_RELEASE_REJECTION = 20,

/// <summary>
/// Notification when a the user roles are updated
/// Notification when the user roles are updated
/// </summary>
ROLE_UPDATE_CORE_OFFER = 21,

/// <summary>
/// Notification when a the user roles are updated for an offer
/// Notification when the user roles are updated for an offer
/// </summary>
ROLE_UPDATE_APP_OFFER = 22,

Expand Down
19 changes: 19 additions & 0 deletions tests/endtoend/AlphabeticalOrderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;

namespace Org.Eclipse.TractusX.Portal.Backend.EndToEnd.Tests;

public class AlphabeticalOrderer : ITestCaseOrderer
{
public IEnumerable<TTestCase> OrderTestCases<TTestCase>(
IEnumerable<TTestCase> testCases) where TTestCase : ITestCase =>
testCases.OrderBy(testCase => testCase.TestMethod.Method.Name);
}

public class DisplayNameOrderer : ITestCollectionOrderer
{
public IEnumerable<ITestCollection> OrderTestCollections(
IEnumerable<ITestCollection> testCollections) =>
testCollections.OrderBy(collection => collection.DisplayName);
}
Loading

0 comments on commit 1504e56

Please sign in to comment.